Skip to content

Commit

Permalink
Merge branch 'master' into internal-lint-test-formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
bradzacher committed Mar 30, 2020
2 parents 8a4396c + bfdffb4 commit a6fcb8d
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .cspell.json
Expand Up @@ -11,7 +11,8 @@
"**/**/ROADMAP.md",
"**/*.{json,snap}",
".cspell.json",
"yarn.lock"
"yarn.lock",
".github/workflows/**"
],
"dictionaries": [
"typescript",
Expand Down
50 changes: 39 additions & 11 deletions .github/workflows/ci.yml
Expand Up @@ -13,7 +13,7 @@ env:

jobs:
primary_code_validation_and_tests:
name: Primary code validation and tests
name: Typecheck and tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -49,15 +49,6 @@ jobs:
- name: Typecheck all packages
run: yarn typecheck

- name: Check code formatting
run: yarn format-check

- name: Run linting
run: yarn lint

- name: Validate spelling
run: yarn check:spelling

- name: Run unit tests
run: yarn test
env:
Expand All @@ -71,6 +62,43 @@ jobs:
flags: unittest
name: codecov

linting_and_style:
name: Code style and lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ env.PRIMARY_NODE_VERSION }}
uses: actions/setup-node@v1
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v1
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
# This also runs a build as part of the postinstall bootstrap
- name: Install dependencies and build
run: |
yarn --ignore-engines --frozen-lockfile
yarn check-clean-workspace-after-install
- name: Check code formatting
run: yarn format-check

- name: Run linting
run: yarn lint

- name: Validate spelling
run: yarn check:spelling

integration_tests:
name: Run integration tests on primary Node.js version
runs-on: ubuntu-latest
Expand Down Expand Up @@ -143,7 +171,7 @@ jobs:
publish_canary_version:
name: Publish the latest code as a canary version
runs-on: ubuntu-latest
needs: [primary_code_validation_and_tests, unit_tests_on_other_node_versions, integration_tests]
needs: [primary_code_validation_and_tests, unit_tests_on_other_node_versions, linting_and_style, integration_tests]
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2
Expand Down
7 changes: 6 additions & 1 deletion packages/eslint-plugin/src/util/types.ts
Expand Up @@ -323,7 +323,12 @@ export function isAnyOrAnyArrayTypeDiscriminated(
}
if (
checker.isArrayType(type) &&
isTypeAnyType(checker.getTypeArguments(type)[0])
isTypeAnyType(
// getTypeArguments was only added in TS3.7
checker.getTypeArguments
? checker.getTypeArguments(type)[0]
: (type.typeArguments ?? [])[0],
)
) {
return AnyType.AnyArray;
}
Expand Down

0 comments on commit a6fcb8d

Please sign in to comment.