From 1765a178e456b152bd48192eb5db7e8541e2adf2 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Thu, 21 May 2020 10:18:02 -0700 Subject: [PATCH 01/18] chore: remove v3 canary Ci step --- .github/workflows/ci.yml | 45 ---------------------------------------- 1 file changed, 45 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2abf37cfcf99..e7a0a39c3c18 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -326,48 +326,3 @@ jobs: run: npx lerna publish --loglevel=verbose --canary --exact --force-publish --yes env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - # TODO - delete this before merging v3 into master - publish_v3_prerelease_version: - name: Publish the latest code as a v3 prerelease version - runs-on: ubuntu-latest - needs: [typecheck, test_on_primary_node_version, unit_tests_on_other_node_versions, linting_and_style, integration_tests] - if: github.ref == 'refs/heads/v3' - steps: - - uses: actions/checkout@v2 - # Fetch all history for all tags and branches in this job because lerna needs it - - run: | - git fetch --prune --unshallow - - - name: Use Node.js ${{ env.PRIMARY_NODE_VERSION }} - uses: actions/setup-node@v1 - with: - node-version: ${{ env.PRIMARY_NODE_VERSION }} - registry-url: https://registry.npmjs.org/ - - - 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- - - - name: Install dependencies - run: | - yarn --ignore-engines --frozen-lockfile --ignore-scripts - yarn lerna:init - yarn check:clean-workspace-after-install - - - name: Build - run: | - yarn build - - - name: Publish all packages to npm - run: npx lerna publish premajor --loglevel=verbose --canary --exact --force-publish --yes --dist-tag rc-v3 - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} From 6f7578eb3b666f778f919081adae101dc0fba984 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Thu, 21 May 2020 11:52:43 -0700 Subject: [PATCH 02/18] chore: update yarn.lock --- yarn.lock | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/yarn.lock b/yarn.lock index 9ccd008ee131..66c94e36911b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1677,6 +1677,29 @@ dependencies: "@types/yargs-parser" "*" +"@typescript-eslint/experimental-utils@^2.5.0": + version "2.34.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.34.0.tgz#d3524b644cdb40eebceca67f8cf3e4cc9c8f980f" + integrity sha512-eS6FTkq+wuMJ+sgtuNTtcqavWXqsflWcfBnlYhg/nS4aZ1leewkXGbvBhaapn1q6qf4M71bsR1tez5JTRMuqwA== + dependencies: + "@types/json-schema" "^7.0.3" + "@typescript-eslint/typescript-estree" "2.34.0" + eslint-scope "^5.0.0" + eslint-utils "^2.0.0" + +"@typescript-eslint/typescript-estree@2.34.0": + version "2.34.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.34.0.tgz#14aeb6353b39ef0732cc7f1b8285294937cf37d5" + integrity sha512-OMAr+nJWKdlVM9LOqCqh3pQQPwxHAN7Du8DR6dmwCrAmxtiXQnhHJ6tBNtf+cggqfo51SG/FCwnKhXCIM7hnVg== + dependencies: + debug "^4.1.1" + eslint-visitor-keys "^1.1.0" + glob "^7.1.6" + is-glob "^4.0.1" + lodash "^4.17.15" + semver "^7.3.2" + tsutils "^3.17.1" + "@zkochan/cmd-shim@^3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@zkochan/cmd-shim/-/cmd-shim-3.1.0.tgz#2ab8ed81f5bb5452a85f25758eb9b8681982fd2e" From e9586c61e2d865d11ce9c2b27436eee0f43298e7 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Thu, 21 May 2020 12:06:00 -0700 Subject: [PATCH 03/18] chore: fix broken parser test --- packages/parser/tests/lib/parser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/parser/tests/lib/parser.ts b/packages/parser/tests/lib/parser.ts index 442332b3a840..f8050773c6c2 100644 --- a/packages/parser/tests/lib/parser.ts +++ b/packages/parser/tests/lib/parser.ts @@ -1,5 +1,5 @@ import { TSESLint } from '@typescript-eslint/experimental-utils'; -import * as typescriptESTree from '@typescript-eslint/typescript-estree'; +import * as typescriptESTree from '@typescript-eslint/typescript-estree/dist/parser'; import { parse, parseForESLint } from '../../src/parser'; import * as scope from '../../src/analyze-scope'; From 23b4b662717f96f9dbbf161ac31d38a5871aed23 Mon Sep 17 00:00:00 2001 From: Hans Bergren Date: Thu, 21 May 2020 15:17:47 -0400 Subject: [PATCH 04/18] docs(eslint-plugin): remove `ignoreRHS` from `no-unnecessary-condition` (#2052) --- .../eslint-plugin/docs/rules/no-unnecessary-condition.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md b/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md index 5b24b4cc9659..09e6730c3c5d 100644 --- a/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md +++ b/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md @@ -64,14 +64,6 @@ function bar(arg?: string | null) { Accepts an object with the following options: -- `ignoreRhs` (default `false`) - doesn't check if the right-hand side of `&&` and `||` is a necessary condition. For example, the following code is valid with this option on: - -```ts -function head(items: T[]) { - return items.length && items[0].toUpperCase(); -} -``` - - `allowConstantLoopConditions` (default `false`) - allows constant expressions in loops. Example of correct code for when `allowConstantLoopConditions` is `true`: From 729f2a219a46db49b1a5331bddaf37a59d2e1b1c Mon Sep 17 00:00:00 2001 From: Minh Nguyen Date: Thu, 21 May 2020 20:58:45 +0100 Subject: [PATCH 05/18] docs(eslint-plugin): remove mention of `eslint-recommended` (#2053) --- packages/eslint-plugin/README.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md index c2d4531eae07..b32cb4a1782b 100644 --- a/packages/eslint-plugin/README.md +++ b/packages/eslint-plugin/README.md @@ -55,15 +55,11 @@ You can also enable all the recommended rules for our plugin. Add `plugin:@types ### Recommended Configs -You can also use [`eslint:recommended`](https://eslint.org/docs/rules/) (the set of rules which are recommended for all projects by the ESLint Team) with this plugin. As noted in the root README, not all ESLint core rules are compatible with TypeScript, so you need to add both `eslint:recommended` and `plugin:@typescript-eslint/eslint-recommended` (which will adjust the one from ESLint appropriately for TypeScript) to your config: +You can also use [`eslint:recommended`](https://eslint.org/docs/rules/) (the set of rules which are recommended for all projects by the ESLint Team) with this plugin: ```json { - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended" - ] + "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"] } ``` @@ -75,7 +71,6 @@ Some highly valuable rules simply require type-checking in order to be implement { "extends": [ "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/recommended-requiring-type-checking" ] From 159c225e2a3276031b9c037bb2e2f22094fbbf6b Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Thu, 21 May 2020 13:14:51 -0700 Subject: [PATCH 06/18] chore: link GH release in changelogs (#2055) --- CHANGELOG.md | 1 + packages/eslint-plugin-internal/CHANGELOG.md | 1 + packages/eslint-plugin-tslint/CHANGELOG.md | 1 + packages/eslint-plugin/CHANGELOG.md | 1 + packages/experimental-utils/CHANGELOG.md | 1 + packages/parser/CHANGELOG.md | 1 + packages/shared-fixtures/CHANGELOG.md | 1 + packages/typescript-estree/CHANGELOG.md | 1 + 8 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ca1bbfb5c89..33ba91679d6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline # [3.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.34.0...v3.0.0) (2020-05-21) +## [Please see the release notes for v3.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0) ### Bug Fixes diff --git a/packages/eslint-plugin-internal/CHANGELOG.md b/packages/eslint-plugin-internal/CHANGELOG.md index 69d260c66425..c478ff5d54ea 100644 --- a/packages/eslint-plugin-internal/CHANGELOG.md +++ b/packages/eslint-plugin-internal/CHANGELOG.md @@ -5,6 +5,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline # [3.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.34.0...v3.0.0) (2020-05-21) +## [Please see the release notes for v3.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0) ### Features diff --git a/packages/eslint-plugin-tslint/CHANGELOG.md b/packages/eslint-plugin-tslint/CHANGELOG.md index b23cc268c611..623480b9f513 100644 --- a/packages/eslint-plugin-tslint/CHANGELOG.md +++ b/packages/eslint-plugin-tslint/CHANGELOG.md @@ -5,6 +5,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline # [3.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.34.0...v3.0.0) (2020-05-21) +## [Please see the release notes for v3.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0) ### Features diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 8eb54a7b5741..219ab07728b3 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -5,6 +5,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline # [3.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.34.0...v3.0.0) (2020-05-21) +## [Please see the release notes for v3.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0) ### Bug Fixes diff --git a/packages/experimental-utils/CHANGELOG.md b/packages/experimental-utils/CHANGELOG.md index 22fd20879645..145814e11cbb 100644 --- a/packages/experimental-utils/CHANGELOG.md +++ b/packages/experimental-utils/CHANGELOG.md @@ -5,6 +5,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline # [3.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.34.0...v3.0.0) (2020-05-21) +## [Please see the release notes for v3.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0) ### Bug Fixes diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index f804624a6b0c..ac98e63c944b 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -5,6 +5,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline # [3.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.34.0...v3.0.0) (2020-05-21) +## [Please see the release notes for v3.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0) ### Bug Fixes diff --git a/packages/shared-fixtures/CHANGELOG.md b/packages/shared-fixtures/CHANGELOG.md index 772c8d67d50b..971eeae5e6fb 100644 --- a/packages/shared-fixtures/CHANGELOG.md +++ b/packages/shared-fixtures/CHANGELOG.md @@ -5,6 +5,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline # [3.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.34.0...v3.0.0) (2020-05-21) +## [Please see the release notes for v3.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0) ### Features diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index 4e5b9086492b..53f5793ea372 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -5,6 +5,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline # [3.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.34.0...v3.0.0) (2020-05-21) +## [Please see the release notes for v3.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0) ### Bug Fixes From 5eedbff01178ea33b98ab22e556df4c1a195f839 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Thu, 21 May 2020 15:21:46 -0700 Subject: [PATCH 07/18] fix(typescript-estree): mark TS 3.8 and 3.9 as "supported" (#2057) 3.8 isn't truly supported yet (#1436), but it will work fine - just can't lint private fields. We _want_ people to upgrade as 3.9 is much better and faster! So this increases the version range so 3.8 and 3.9 will stop logging the unsupported warning. #1436 is pinned in our issues, so that's about as good as we can do. --- packages/typescript-estree/src/parser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/typescript-estree/src/parser.ts b/packages/typescript-estree/src/parser.ts index 7c2744d32a02..88fa5d503b8f 100644 --- a/packages/typescript-estree/src/parser.ts +++ b/packages/typescript-estree/src/parser.ts @@ -20,7 +20,7 @@ const log = debug('typescript-eslint:typescript-estree:parser'); * This needs to be kept in sync with the top-level README.md in the * typescript-eslint monorepo */ -const SUPPORTED_TYPESCRIPT_VERSIONS = '>=3.3.1 <3.8.0'; +const SUPPORTED_TYPESCRIPT_VERSIONS = '>=3.3.1 <3.10.0'; /* * The semver package will ignore prerelease ranges, and we don't want to explicitly document every one * List them all separately here, so we can automatically create the full string From 765ec4bb1c83f6b7f50564c3b104336178f29b6d Mon Sep 17 00:00:00 2001 From: dnalborczyk Date: Thu, 21 May 2020 18:54:08 -0400 Subject: [PATCH 08/18] docs: update supported TS version in readme (#2059) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 13c792bdd976..c4a26f31cf07 100644 --- a/README.md +++ b/README.md @@ -234,7 +234,7 @@ The latest version under the `canary` tag **(latest commit to master)** is: ## Supported TypeScript Version -**The version range of TypeScript currently supported by this parser is `>=3.3.1 <3.8.0`.** +**The version range of TypeScript currently supported by this parser is `>=3.3.1 <3.10.0`.** These versions are what we test against. From 66f1627b11a566d5b925a577e800f99d5c808be2 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Sat, 23 May 2020 01:47:38 +0800 Subject: [PATCH 09/18] fix(typescript-estree): handle `BigInt` with `_` numeric separator (#2067) --- .../lib/__snapshots__/javascript.ts.snap | 50 ++++++++++ .../bigIntLiterals/numeric-separator.src.js | 1 + packages/typescript-estree/src/convert.ts | 7 +- .../tests/ast-alignment/parse.ts | 1 + .../lib/__snapshots__/javascript.ts.snap | 98 +++++++++++++++++++ .../semantic-diagnostics-enabled.ts.snap | 2 + 6 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 packages/shared-fixtures/fixtures/javascript/bigIntLiterals/numeric-separator.src.js diff --git a/packages/parser/tests/lib/__snapshots__/javascript.ts.snap b/packages/parser/tests/lib/__snapshots__/javascript.ts.snap index 654b09e21ab6..48864fb74025 100644 --- a/packages/parser/tests/lib/__snapshots__/javascript.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/javascript.ts.snap @@ -6815,6 +6815,56 @@ Object { } `; +exports[`javascript fixtures/bigIntLiterals/numeric-separator.src 1`] = ` +Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 8, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 0, + "block": Object { + "range": Array [ + 0, + 8, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 1, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 0, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [], +} +`; + exports[`javascript fixtures/bigIntLiterals/octal.src 1`] = ` Object { "$id": 1, diff --git a/packages/shared-fixtures/fixtures/javascript/bigIntLiterals/numeric-separator.src.js b/packages/shared-fixtures/fixtures/javascript/bigIntLiterals/numeric-separator.src.js new file mode 100644 index 000000000000..75db46096c10 --- /dev/null +++ b/packages/shared-fixtures/fixtures/javascript/bigIntLiterals/numeric-separator.src.js @@ -0,0 +1 @@ +1_2_3n; diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 74f97e526a41..f23bac14ecb6 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -1931,7 +1931,12 @@ export class Converter { case SyntaxKind.BigIntLiteral: { const range = getRange(node, this.ast); const rawValue = this.ast.text.slice(range[0], range[1]); - const bigint = rawValue.slice(0, -1); // remove suffix `n` + const bigint = rawValue + // remove suffix `n` + .slice(0, -1) + // `BigInt` doesn't accept numeric separator + // and `bigint` property should not include numeric separator + .replace(/_/g, ''); const value = typeof BigInt !== 'undefined' ? BigInt(bigint) : null; return this.createNode(node, { type: AST_NODE_TYPES.Literal, diff --git a/packages/typescript-estree/tests/ast-alignment/parse.ts b/packages/typescript-estree/tests/ast-alignment/parse.ts index 42f6e0f68fcb..cd9c2db02f8e 100644 --- a/packages/typescript-estree/tests/ast-alignment/parse.ts +++ b/packages/typescript-estree/tests/ast-alignment/parse.ts @@ -29,6 +29,7 @@ function parseWithBabelParser(text: string, jsx = true): any { 'dynamicImport', 'estree', 'bigInt', + 'numericSeparator', 'importMeta', 'optionalChaining', 'nullishCoalescingOperator', diff --git a/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap index 1ae708c8a404..004a3cabe0f6 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap @@ -16780,6 +16780,104 @@ Object { } `; +exports[`javascript fixtures/bigIntLiterals/numeric-separator.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "bigint": "123", + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "raw": "1_2_3n", + "type": "Literal", + "value": 123n, + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Identifier", + "value": "1_2_3n", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + exports[`javascript fixtures/bigIntLiterals/octal.src 1`] = ` Object { "body": Array [ diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index bdc9a9a52dc3..f94806437fe5 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -224,6 +224,8 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/bigIntLiterals/hex.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/bigIntLiterals/numeric-separator.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/bigIntLiterals/octal.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/binaryLiterals/invalid.src 1`] = ` From 66f127810ba3eaee1435724c16c0269b1e3fe37c Mon Sep 17 00:00:00 2001 From: IKEDA Sho Date: Sat, 23 May 2020 02:55:59 +0900 Subject: [PATCH 10/18] docs(eslint-plugin): [explicit-module-boundary-types] fix allowedNames config example (#2061) --- .../eslint-plugin/docs/rules/explicit-module-boundary-types.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md b/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md index 5a33f9e9a359..453ec03a12a4 100644 --- a/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md +++ b/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md @@ -237,7 +237,7 @@ You may pass function/method names you would like this rule to ignore, like so: "@typescript-eslint/explicit-module-boundary-types": [ "error", { - "allowedName": ["ignoredFunctionName", "ignoredMethodName"] + "allowedNames": ["ignoredFunctionName", "ignoredMethodName"] } ] } From 071e5a04d09d0dbf1d57e5835c4957fd04641e55 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Fri, 22 May 2020 11:44:40 -0700 Subject: [PATCH 11/18] docs: various updates based on v3 feedback (#2070) --- docs/getting-started/linting/FAQ.md | 44 +++++++++++++++++++ docs/getting-started/linting/MONOREPO.md | 1 - docs/getting-started/linting/README.md | 3 -- docs/getting-started/linting/TYPED_LINTING.md | 1 - .../rules/explicit-module-boundary-types.md | 5 +++ .../docs/rules/naming-convention.md | 20 +++++++++ packages/eslint-plugin/src/configs/README.md | 25 +++++++++-- 7 files changed, 90 insertions(+), 9 deletions(-) diff --git a/docs/getting-started/linting/FAQ.md b/docs/getting-started/linting/FAQ.md index 33410ed3c46b..799b7b626bad 100644 --- a/docs/getting-started/linting/FAQ.md +++ b/docs/getting-started/linting/FAQ.md @@ -11,6 +11,10 @@ --- +
+
+
+ ## My linting feels really slow As mentioned in the [type-aware linting doc](./TYPED_LINTING.md), if you're using type-aware linting, your lint times should be roughly the same as your build times. @@ -61,8 +65,16 @@ This rule helps ensure your codebase follows a consistent indentation pattern. H We recommend not using this rule, and instead using a tool like [`prettier`](https://www.npmjs.com/package/) to enforce a standardized formatting. +
+
+
+ --- +
+
+
+ ## I get errors telling me "The file must be included in at least one of the projects provided" This error means that the file that's being linted is not included in any of the tsconfig files you provided us. A lot of the time this happens when users have test files or similar that are not included. @@ -78,8 +90,16 @@ There are a couple of solutions to this, depending on what you want to achieve. - Check the `include` option of each of the tsconfigs that you provide to `parserOptions.project` - you must ensure that all files match an `include` glob, or else our tooling will not be able to find it. - If your file shouldn't be a part of one of your existing tsconfigs (for example, it is a script/tool local to the repo), then consider creating a new tsconfig (we advise calling it `tsconfig.eslint.json`) in your project root which lists this file in its `include`. +
+
+
+ --- +
+
+
+ ## I use a framework (like Vue) that requires custom file extensions, and I get errors like "You should add `parserOptions.extraFileExtensions` to your config" You can use `parserOptions.extraFileExtensions` to specify an array of non-TypeScript extensions to allow, for example: @@ -92,8 +112,16 @@ You can use `parserOptions.extraFileExtensions` to specify an array of non-TypeS }, ``` +
+
+
+ --- +
+
+
+ ## I am using a rule from ESLint core, and it doesn't work correctly with TypeScript code This is a pretty common thing because TypeScript adds new features that ESLint doesn't know about. @@ -111,16 +139,32 @@ The first step is to [check our list of "extension" rules here](../../../package If you don't find an existing extension rule, or the extension rule doesn't work for your case, then you can go ahead and check our issues. [The contributing guide outlines the best way to raise an issue](../../../CONTRIBUTING.md#raising-issues). +
+
+
+ --- +
+
+
+ ## One of my lint rules isn't working correctly on a pure JavaScript file This is to be expected - ESLint rules do not check file extensions on purpose, as it causes issues in environments that use non-standard extensions (for example, a `.vue` and a `.md` file can both contain TypeScript code to be linted). If you have some pure JavaScript code that you do not want to apply certain lint rules to, then you can use [ESLint's `overrides` configuration](https://eslint.org/docs/user-guide/configuring#configuration-based-on-glob-patterns) to turn off certain rules, or even change the parser based on glob patterns. +
+
+
+ --- +
+
+
+ ## TypeScript should be installed locally Make sure that you have installed TypeScript locally i.e. by using `npm install typescript`, not `npm install -g typescript`, diff --git a/docs/getting-started/linting/MONOREPO.md b/docs/getting-started/linting/MONOREPO.md index 00200300f5d1..30669920d832 100644 --- a/docs/getting-started/linting/MONOREPO.md +++ b/docs/getting-started/linting/MONOREPO.md @@ -28,7 +28,6 @@ For example, this is how we specify all of our `tsconfig.json` within this repo. plugins: ['@typescript-eslint'], extends: [ 'eslint:recommended', - 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', 'plugin:@typescript-eslint/recommended-requiring-type-checking', ], diff --git a/docs/getting-started/linting/README.md b/docs/getting-started/linting/README.md index bb1fd058e89b..0d699b195050 100644 --- a/docs/getting-started/linting/README.md +++ b/docs/getting-started/linting/README.md @@ -102,7 +102,6 @@ To use one of these complete config packages, you would replace the `extends` wi ], extends: [ - 'eslint:recommended', -- 'plugin:@typescript-eslint/eslint-recommended', - 'plugin:@typescript-eslint/recommended', + 'airbnb-typescript', ], @@ -124,7 +123,6 @@ Using this config is as simple as adding it to the end of your `extends`: ], extends: [ 'eslint:recommended', - 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', + 'prettier/@typescript-eslint', ], @@ -153,7 +151,6 @@ Every plugin that is out there includes documentation on the various rules they ], extends: [ 'eslint:recommended', - 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', + 'plugin:jest/recommended', ], diff --git a/docs/getting-started/linting/TYPED_LINTING.md b/docs/getting-started/linting/TYPED_LINTING.md index fd6fe4fb2f4c..188a7e71ed1d 100644 --- a/docs/getting-started/linting/TYPED_LINTING.md +++ b/docs/getting-started/linting/TYPED_LINTING.md @@ -17,7 +17,6 @@ How can we tap into this? There are two small changes you need to make to your c plugins: ['@typescript-eslint'], extends: [ 'eslint:recommended', - 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', + 'plugin:@typescript-eslint/recommended-requiring-type-checking', ], diff --git a/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md b/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md index 453ec03a12a4..b91036ec6434 100644 --- a/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md +++ b/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md @@ -26,6 +26,7 @@ export var arrowFn = () => 'test'; // All arguments should be typed export var arrowFn = (arg): string => `test ${arg}`; +export var arrowFn = (arg: any): string => `test ${arg}`; export class Test { // Should indicate that no value is returned (void) @@ -51,6 +52,10 @@ export var fn = function (): number { // A return value of type string export var arrowFn = (arg: string): string => `test ${arg}`; +// All arguments should be typed +export var arrowFn = (arg: string): string => `test ${arg}`; +export var arrowFn = (arg: unknown): string => `test ${arg}`; + // Class is not exported class Test { method() { diff --git a/packages/eslint-plugin/docs/rules/naming-convention.md b/packages/eslint-plugin/docs/rules/naming-convention.md index e27aa6e3d2fd..90a86eeb56df 100644 --- a/packages/eslint-plugin/docs/rules/naming-convention.md +++ b/packages/eslint-plugin/docs/rules/naming-convention.md @@ -320,10 +320,30 @@ Group Selectors are provided for convenience, and essentially bundle up sets of } ``` +### Enforce that interface names do not begin with an `I` + +```json +{ + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "interface", + "format": ["PascalCase"], + "prefix": ["T"], + "custom": { + "regex": "^I[A-Z]", + "match": false + } + } + ] +} +``` + ### Enforce the codebase follows ESLint's `camelcase` conventions ```json { + "camelcase": "off", "@typescript-eslint/naming-convention": [ "error", { diff --git a/packages/eslint-plugin/src/configs/README.md b/packages/eslint-plugin/src/configs/README.md index 5105a31eeff8..3f232c7d9df2 100644 --- a/packages/eslint-plugin/src/configs/README.md +++ b/packages/eslint-plugin/src/configs/README.md @@ -6,6 +6,8 @@ These configs exist for your convenience. They contain configuration intended to The `eslint-recommended` ruleset is meant to be used after extending `eslint:recommended`. It disables rules that are already checked by the TypeScript compiler and enables rules that promote using the more modern constructs TypeScript allows for. +This config is automatically included if you use either the `recommended` or `recommended-requiring-type-checking` configs. + ```cjson { "extends": [ @@ -15,9 +17,11 @@ The `eslint-recommended` ruleset is meant to be used after extending `eslint:rec } ``` +We will not add new rules to the `eslint-recommended` set unless we release a major package version (i.e. it is seen as a breaking change). + ## `recommended` -The recommended set is an **_opinionated_** set of rules that we think you should use because: +The `recommended` set is an **_opinionated_** set of rules that we think you should use because: 1. They help you adhere to TypeScript best practices. 2. They help catch probable issue vectors in your code. @@ -30,9 +34,9 @@ That being said, it is not the only way to use `@typescript-eslint/eslint-plugin - The style used by many OSS TypeScript projects. 2. The combined state of community contributed rulesets at the time of creation. -We will not add new rules to the recommended set unless we release a major package version (i.e. it is seen as a breaking change). +We will not add new rules to the `recommended` set unless we release a major package version (i.e. it is seen as a breaking change). -### Altering the recommended set to suit your project +### Altering the `recommended` set to suit your project If you disagree with a rule (or it disagrees with your codebase), consider using your local config to change the rule config so it works for your project. @@ -46,7 +50,20 @@ If you disagree with a rule (or it disagrees with your codebase), consider using } ``` -### Suggesting changes to the recommended set +### Suggesting changes to the `recommended` set If you feel _very_, **very**, ***very*** strongly that a specific rule should (or should not) be in the recommended ruleset, please feel free to file an issue along with a **detailed** argument explaining your reasoning. We expect to see you citing concrete evidence supporting why (or why not) a rule is considered best practice. **Please note that if your reasoning is along the lines of "it's what my project/company does", or "I don't like the rule", then we will likely close the request without discussion.** + +## `recommended-requiring-type-checking` + +Similar to `recommended`, the `recommended-requiring-type-checking` set is an **_opinionated_** set of rules. The difference being that all rules in this set will require type information to use. + +We will not add new rules to the `recommended-requiring-type-checking` set unless we release a major package version (i.e. it is seen as a breaking change). + +## `all` + +The `all` set simply contains every single rule in this plugin, turn on with its default configuration. +There may be some conflicts between the rules as defaults do not quite align - please file an issue if you encounter any of these. + +This set is considered unstable, as any new rules will be added with only a minor package version bump. From 1cb1cb50eda63ec2f99a5f526b4cd8633bef4388 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Fri, 22 May 2020 12:36:17 -0700 Subject: [PATCH 12/18] docs(eslint-plugin): [naming-convention] document ignoring quoted properties (#2071) --- .../docs/rules/naming-convention.md | 47 ++++++++++++++ .../tests/rules/naming-convention.test.ts | 63 +++++++++++++++++++ 2 files changed, 110 insertions(+) diff --git a/packages/eslint-plugin/docs/rules/naming-convention.md b/packages/eslint-plugin/docs/rules/naming-convention.md index 90a86eeb56df..634d281d66cc 100644 --- a/packages/eslint-plugin/docs/rules/naming-convention.md +++ b/packages/eslint-plugin/docs/rules/naming-convention.md @@ -307,6 +307,8 @@ Group Selectors are provided for convenience, and essentially bundle up sets of ### Enforce that type parameters (generics) are prefixed with `T` +This allows you to emulate the old `generic-type-naming` rule. + ```json { "@typescript-eslint/naming-convention": [ @@ -322,6 +324,8 @@ Group Selectors are provided for convenience, and essentially bundle up sets of ### Enforce that interface names do not begin with an `I` +This allows you to emulate the old `interface-name-prefix` rule. + ```json { "@typescript-eslint/naming-convention": [ @@ -339,6 +343,49 @@ Group Selectors are provided for convenience, and essentially bundle up sets of } ``` +### Ignore properties that require quotes + +Sometimes you have to use a quoted name that breaks the convention (for example, HTTP headers). +If this is a common thing in your codebase, then you can use the `filter` option in one of two ways: + +You can use the `filter` option to ignore specific names only: + +```jsonc +{ + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "property", + "format": ["strictCamelCase"], + "filter": { + // you can expand this regex to add more allowed names + "regex": "^(Property-Name-One|Property-Name-Two)$", + "match": false + } + } + ] +} +``` + +You can use the `filter` option to ignore names that require quoting: + +```jsonc +{ + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "property", + "format": ["strictCamelCase"], + "filter": { + // you can expand this regex as you find more cases that require quoting that you want to allow + "regex": "[- ]", + "match": false + } + } + ] +} +``` + ### Enforce the codebase follows ESLint's `camelcase` conventions ```json diff --git a/packages/eslint-plugin/tests/rules/naming-convention.test.ts b/packages/eslint-plugin/tests/rules/naming-convention.test.ts index 3787dd4acdde..f6b0143c17fe 100644 --- a/packages/eslint-plugin/tests/rules/naming-convention.test.ts +++ b/packages/eslint-plugin/tests/rules/naming-convention.test.ts @@ -758,6 +758,40 @@ ruleTester.run('naming-convention', rule, { }, ], }, + { + code: ` + const foo = { + 'Property-Name': 'asdf', + }; + `, + options: [ + { + format: ['strictCamelCase'], + selector: 'default', + filter: { + regex: /-/.source, + match: false, + }, + }, + ], + }, + { + code: ` + const foo = { + 'Property-Name': 'asdf', + }; + `, + options: [ + { + format: ['strictCamelCase'], + selector: 'default', + filter: { + regex: /^(Property-Name)$/.source, + match: false, + }, + }, + ], + }, ], invalid: [ ...createInvalidTestCases(cases), @@ -965,5 +999,34 @@ ruleTester.run('naming-convention', rule, { }, ], }, + { + code: ` + const foo = { + 'Property Name': 'asdf', + }; + `, + options: [ + { + format: ['strictCamelCase'], + selector: 'default', + filter: { + regex: /-/.source, + match: false, + }, + }, + ], + errors: [ + { + line: 3, + messageId: 'doesNotMatchFormat', + data: { + // eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum + type: 'Property', + name: 'Property Name', + formats: 'strictCamelCase', + }, + }, + ], + }, ], }); From 893b8dd173e02205ba9c9ff88104f62f28cadb93 Mon Sep 17 00:00:00 2001 From: Bill Barry Date: Sat, 23 May 2020 17:58:34 -0400 Subject: [PATCH 13/18] docs(eslint-plugin): [naming-convention] improve comment text regarding ESLint's camelCase (#2080) --- packages/eslint-plugin/docs/rules/naming-convention.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-plugin/docs/rules/naming-convention.md b/packages/eslint-plugin/docs/rules/naming-convention.md index 634d281d66cc..5938857d70e0 100644 --- a/packages/eslint-plugin/docs/rules/naming-convention.md +++ b/packages/eslint-plugin/docs/rules/naming-convention.md @@ -51,7 +51,7 @@ type Options = { types?: Types[]; }[]; -// the default config essentially does the same thing as ESLint's camelcase rule +// the default config is similar to ESLint's camelcase rule but more strict const defaultOptions: Options = [ { selector: 'default', From 014341bb23261f609fc2a6fe7fece191466a084a Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Sun, 24 May 2020 14:39:13 +1200 Subject: [PATCH 14/18] fix(experimental-utils): export `CLIEngine` & `ESLint` (#2083) --- packages/experimental-utils/src/ts-eslint/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/experimental-utils/src/ts-eslint/index.ts b/packages/experimental-utils/src/ts-eslint/index.ts index 05a5b0b54ada..48af8aacb957 100644 --- a/packages/experimental-utils/src/ts-eslint/index.ts +++ b/packages/experimental-utils/src/ts-eslint/index.ts @@ -1,4 +1,6 @@ export * from './AST'; +export * from './CLIEngine'; +export * from './ESLint'; export * from './Linter'; export * from './ParserOptions'; export * from './Rule'; From f2fa82c532ae858ccfb064268cfcc9df657a54be Mon Sep 17 00:00:00 2001 From: eeeee Date: Mon, 25 May 2020 08:28:37 -0700 Subject: [PATCH 15/18] fix(eslint-plugin): [unbound-method] fix crash due to missing `Intl` (#2090) --- packages/eslint-plugin/src/rules/unbound-method.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/eslint-plugin/src/rules/unbound-method.ts b/packages/eslint-plugin/src/rules/unbound-method.ts index c27f732ca34b..ade042298875 100644 --- a/packages/eslint-plugin/src/rules/unbound-method.ts +++ b/packages/eslint-plugin/src/rules/unbound-method.ts @@ -82,6 +82,11 @@ const SUPPORTED_GLOBALS = [ 'Intl', ] as const; const nativelyBoundMembers = SUPPORTED_GLOBALS.map(namespace => { + if (!(namespace in global)) { + // node.js might not have namespaces like Intl depending on compilation options + // https://nodejs.org/api/intl.html#intl_options_for_building_node_js + return []; + } const object = global[namespace]; return Object.getOwnPropertyNames(object) .filter( From cae037ff9b20363b970cc600a09505b98bf10a14 Mon Sep 17 00:00:00 2001 From: YeonJuan Date: Tue, 26 May 2020 00:47:35 +0900 Subject: [PATCH 16/18] fix(eslint-plugin): [no-throw-literal] handle intersection and union types (#2085) --- .../src/rules/no-throw-literal.ts | 7 ++++ .../tests/rules/no-throw-literal.test.ts | 38 +++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/packages/eslint-plugin/src/rules/no-throw-literal.ts b/packages/eslint-plugin/src/rules/no-throw-literal.ts index ffa8a614e6b6..b85e0cc742db 100644 --- a/packages/eslint-plugin/src/rules/no-throw-literal.ts +++ b/packages/eslint-plugin/src/rules/no-throw-literal.ts @@ -28,6 +28,13 @@ export default util.createRule({ const checker = program.getTypeChecker(); function isErrorLike(type: ts.Type): boolean { + if (type.isIntersection()) { + return type.types.some(isErrorLike); + } + if (type.isUnion()) { + return type.types.every(isErrorLike); + } + const symbol = type.getSymbol(); if (!symbol) { return false; diff --git a/packages/eslint-plugin/tests/rules/no-throw-literal.test.ts b/packages/eslint-plugin/tests/rules/no-throw-literal.test.ts index 7d7b95acbb2e..09ecadeb6296 100644 --- a/packages/eslint-plugin/tests/rules/no-throw-literal.test.ts +++ b/packages/eslint-plugin/tests/rules/no-throw-literal.test.ts @@ -96,6 +96,19 @@ throw new CustomError(); class CustomError extends Error {} throw new CustomError(); `, + ` +function foo() { + throw Object.assign(new Error('message'), { foo: 'bar' }); +} + `, + { + code: ` +const foo: Error | SyntaxError = bar(); +function bar() { + throw foo; +} + `, + }, ], invalid: [ { @@ -352,5 +365,30 @@ function foo(fn: () => Promise) { }, ], }, + { + code: ` +function foo() { + throw Object.assign({ foo: 'foo' }, { bar: 'bar' }); +} + `, + errors: [ + { + messageId: 'object', + }, + ], + }, + { + code: ` +const foo: Error | { bar: string } = bar(); +function bar() { + throw foo; +} + `, + errors: [ + { + messageId: 'object', + }, + ], + }, ], }); From fd7d02b31ebd995b7fdd857d7c054042aa4f2001 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Mon, 25 May 2020 08:59:18 -0700 Subject: [PATCH 17/18] fix(eslint-plugin): [naming-convention] handle no options correctly (#2095) --- .../src/rules/naming-convention.ts | 22 ++++++++++--------- .../tests/rules/naming-convention.test.ts | 12 +++++++++- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/packages/eslint-plugin/src/rules/naming-convention.ts b/packages/eslint-plugin/src/rules/naming-convention.ts index 59b1bdfee803..d9f5b319c119 100644 --- a/packages/eslint-plugin/src/rules/naming-convention.ts +++ b/packages/eslint-plugin/src/rules/naming-convention.ts @@ -360,15 +360,17 @@ export default util.createRule({ }, defaultOptions: defaultCamelCaseAllTheThingsConfig, create(contextWithoutDefaults) { - const context: Context = contextWithoutDefaults.options - ? contextWithoutDefaults - : // only apply the defaults when the user provides no config - Object.setPrototypeOf( - { - options: defaultCamelCaseAllTheThingsConfig, - }, - contextWithoutDefaults, - ); + const context: Context = + contextWithoutDefaults.options && + contextWithoutDefaults.options.length > 0 + ? contextWithoutDefaults + : // only apply the defaults when the user provides no config + Object.setPrototypeOf( + { + options: defaultCamelCaseAllTheThingsConfig, + }, + contextWithoutDefaults, + ); const validators = parseOptions(context); @@ -748,7 +750,7 @@ type ValidatorFunction = ( modifiers?: Set, ) => void; type ParsedOptions = Record; -type Context = TSESLint.RuleContext; +type Context = Readonly>; function parseOptions(context: Context): ParsedOptions { const normalizedOptions = context.options.map(opt => normalizeOption(opt)); const parsedOptions = util.getEnumNames(Selectors).reduce((acc, k) => { diff --git a/packages/eslint-plugin/tests/rules/naming-convention.test.ts b/packages/eslint-plugin/tests/rules/naming-convention.test.ts index f6b0143c17fe..13f67f6c9887 100644 --- a/packages/eslint-plugin/tests/rules/naming-convention.test.ts +++ b/packages/eslint-plugin/tests/rules/naming-convention.test.ts @@ -607,7 +607,6 @@ const cases: Cases = [ ruleTester.run('naming-convention', rule, { valid: [ - 'const x = 1;', // no options shouldn't crash ...createValidTestCases(cases), { code: ` @@ -794,6 +793,17 @@ ruleTester.run('naming-convention', rule, { }, ], invalid: [ + { + // make sure we handle no options and apply defaults + code: 'const x_x = 1;', + errors: [{ messageId: 'doesNotMatchFormat' }], + }, + { + // make sure we handle empty options and apply defaults + code: 'const x_x = 1;', + options: [], + errors: [{ messageId: 'doesNotMatchFormat' }], + }, ...createInvalidTestCases(cases), { code: ` From a71b9c9aabe1c3f26a76e77c29b3d2b7205c35ef Mon Sep 17 00:00:00 2001 From: James Henry Date: Mon, 25 May 2020 17:01:56 +0000 Subject: [PATCH 18/18] chore: publish v3.0.1 --- CHANGELOG.md | 16 ++++++++++++++++ lerna.json | 2 +- packages/eslint-plugin-internal/CHANGELOG.md | 8 ++++++++ packages/eslint-plugin-internal/package.json | 4 ++-- packages/eslint-plugin-tslint/CHANGELOG.md | 8 ++++++++ packages/eslint-plugin-tslint/package.json | 6 +++--- packages/eslint-plugin/CHANGELOG.md | 13 +++++++++++++ packages/eslint-plugin/package.json | 4 ++-- packages/experimental-utils/CHANGELOG.md | 11 +++++++++++ packages/experimental-utils/package.json | 4 ++-- packages/parser/CHANGELOG.md | 11 +++++++++++ packages/parser/package.json | 8 ++++---- packages/shared-fixtures/CHANGELOG.md | 11 +++++++++++ packages/shared-fixtures/package.json | 2 +- packages/typescript-estree/CHANGELOG.md | 12 ++++++++++++ packages/typescript-estree/package.json | 4 ++-- 16 files changed, 107 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 33ba91679d6c..223d0fdc0824 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.0...v3.0.1) (2020-05-25) + + +### Bug Fixes + +* **eslint-plugin:** [naming-convention] handle no options correctly ([#2095](https://github.com/typescript-eslint/typescript-eslint/issues/2095)) ([fd7d02b](https://github.com/typescript-eslint/typescript-eslint/commit/fd7d02b31ebd995b7fdd857d7c054042aa4f2001)) +* **eslint-plugin:** [no-throw-literal] handle intersection and union types ([#2085](https://github.com/typescript-eslint/typescript-eslint/issues/2085)) ([cae037f](https://github.com/typescript-eslint/typescript-eslint/commit/cae037ff9b20363b970cc600a09505b98bf10a14)) +* **eslint-plugin:** [unbound-method] fix crash due to missing `Intl` ([#2090](https://github.com/typescript-eslint/typescript-eslint/issues/2090)) ([f2fa82c](https://github.com/typescript-eslint/typescript-eslint/commit/f2fa82c532ae858ccfb064268cfcc9df657a54be)) +* **experimental-utils:** export `CLIEngine` & `ESLint` ([#2083](https://github.com/typescript-eslint/typescript-eslint/issues/2083)) ([014341b](https://github.com/typescript-eslint/typescript-eslint/commit/014341bb23261f609fc2a6fe7fece191466a084a)) +* **typescript-estree:** handle `BigInt` with `_` numeric separator ([#2067](https://github.com/typescript-eslint/typescript-eslint/issues/2067)) ([66f1627](https://github.com/typescript-eslint/typescript-eslint/commit/66f1627b11a566d5b925a577e800f99d5c808be2)) +* **typescript-estree:** mark TS 3.8 and 3.9 as "supported" ([#2057](https://github.com/typescript-eslint/typescript-eslint/issues/2057)) ([5eedbff](https://github.com/typescript-eslint/typescript-eslint/commit/5eedbff01178ea33b98ab22e556df4c1a195f839)), closes [#1436](https://github.com/typescript-eslint/typescript-eslint/issues/1436) [#1436](https://github.com/typescript-eslint/typescript-eslint/issues/1436) + + + + + # [3.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.34.0...v3.0.0) (2020-05-21) ## [Please see the release notes for v3.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0) diff --git a/lerna.json b/lerna.json index e3c6d1f33229..171d21a8cd21 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "3.0.0", + "version": "3.0.1", "npmClient": "yarn", "useWorkspaces": true, "stream": true diff --git a/packages/eslint-plugin-internal/CHANGELOG.md b/packages/eslint-plugin-internal/CHANGELOG.md index c478ff5d54ea..6ac6ec4311fa 100644 --- a/packages/eslint-plugin-internal/CHANGELOG.md +++ b/packages/eslint-plugin-internal/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.0...v3.0.1) (2020-05-25) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal + + + + + # [3.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.34.0...v3.0.0) (2020-05-21) ## [Please see the release notes for v3.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0) diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json index 70893eabf717..82b4f9c0c323 100644 --- a/packages/eslint-plugin-internal/package.json +++ b/packages/eslint-plugin-internal/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin-internal", - "version": "3.0.0", + "version": "3.0.1", "private": true, "main": "dist/index.js", "scripts": { @@ -12,7 +12,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/experimental-utils": "3.0.0", + "@typescript-eslint/experimental-utils": "3.0.1", "prettier": "*" } } diff --git a/packages/eslint-plugin-tslint/CHANGELOG.md b/packages/eslint-plugin-tslint/CHANGELOG.md index 623480b9f513..401f4db123e7 100644 --- a/packages/eslint-plugin-tslint/CHANGELOG.md +++ b/packages/eslint-plugin-tslint/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.0...v3.0.1) (2020-05-25) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint + + + + + # [3.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.34.0...v3.0.0) (2020-05-21) ## [Please see the release notes for v3.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0) diff --git a/packages/eslint-plugin-tslint/package.json b/packages/eslint-plugin-tslint/package.json index a03d8dc77350..f03f38e8473b 100644 --- a/packages/eslint-plugin-tslint/package.json +++ b/packages/eslint-plugin-tslint/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin-tslint", - "version": "3.0.0", + "version": "3.0.1", "main": "dist/index.js", "typings": "src/index.ts", "description": "TSLint wrapper plugin for ESLint", @@ -31,7 +31,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/experimental-utils": "3.0.0", + "@typescript-eslint/experimental-utils": "3.0.1", "lodash": "^4.17.15" }, "peerDependencies": { @@ -41,6 +41,6 @@ }, "devDependencies": { "@types/lodash": "^4.14.149", - "@typescript-eslint/parser": "3.0.0" + "@typescript-eslint/parser": "3.0.1" } } diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 219ab07728b3..bbda91bf500b 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -3,6 +3,19 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.0...v3.0.1) (2020-05-25) + + +### Bug Fixes + +* **eslint-plugin:** [naming-convention] handle no options correctly ([#2095](https://github.com/typescript-eslint/typescript-eslint/issues/2095)) ([fd7d02b](https://github.com/typescript-eslint/typescript-eslint/commit/fd7d02b31ebd995b7fdd857d7c054042aa4f2001)) +* **eslint-plugin:** [no-throw-literal] handle intersection and union types ([#2085](https://github.com/typescript-eslint/typescript-eslint/issues/2085)) ([cae037f](https://github.com/typescript-eslint/typescript-eslint/commit/cae037ff9b20363b970cc600a09505b98bf10a14)) +* **eslint-plugin:** [unbound-method] fix crash due to missing `Intl` ([#2090](https://github.com/typescript-eslint/typescript-eslint/issues/2090)) ([f2fa82c](https://github.com/typescript-eslint/typescript-eslint/commit/f2fa82c532ae858ccfb064268cfcc9df657a54be)) + + + + + # [3.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.34.0...v3.0.0) (2020-05-21) ## [Please see the release notes for v3.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0) diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index c5e199b8d0e5..206a99c668fe 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "3.0.0", + "version": "3.0.1", "description": "TypeScript plugin for ESLint", "keywords": [ "eslint", @@ -41,7 +41,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/experimental-utils": "3.0.0", + "@typescript-eslint/experimental-utils": "3.0.1", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.0.0", "semver": "^7.3.2", diff --git a/packages/experimental-utils/CHANGELOG.md b/packages/experimental-utils/CHANGELOG.md index 145814e11cbb..92f48fceb9d3 100644 --- a/packages/experimental-utils/CHANGELOG.md +++ b/packages/experimental-utils/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.0...v3.0.1) (2020-05-25) + + +### Bug Fixes + +* **experimental-utils:** export `CLIEngine` & `ESLint` ([#2083](https://github.com/typescript-eslint/typescript-eslint/issues/2083)) ([014341b](https://github.com/typescript-eslint/typescript-eslint/commit/014341bb23261f609fc2a6fe7fece191466a084a)) + + + + + # [3.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.34.0...v3.0.0) (2020-05-21) ## [Please see the release notes for v3.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0) diff --git a/packages/experimental-utils/package.json b/packages/experimental-utils/package.json index 17a3255113a7..0a01d46b05da 100644 --- a/packages/experimental-utils/package.json +++ b/packages/experimental-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/experimental-utils", - "version": "3.0.0", + "version": "3.0.1", "description": "(Experimental) Utilities for working with TypeScript + ESLint together", "keywords": [ "eslint", @@ -37,7 +37,7 @@ }, "dependencies": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/typescript-estree": "3.0.0", + "@typescript-eslint/typescript-estree": "3.0.1", "eslint-scope": "^5.0.0", "eslint-utils": "^2.0.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index ac98e63c944b..66ea097ccca3 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.0...v3.0.1) (2020-05-25) + + +### Bug Fixes + +* **typescript-estree:** handle `BigInt` with `_` numeric separator ([#2067](https://github.com/typescript-eslint/typescript-eslint/issues/2067)) ([66f1627](https://github.com/typescript-eslint/typescript-eslint/commit/66f1627b11a566d5b925a577e800f99d5c808be2)) + + + + + # [3.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.34.0...v3.0.0) (2020-05-21) ## [Please see the release notes for v3.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0) diff --git a/packages/parser/package.json b/packages/parser/package.json index 030c9f291c52..cb6701ec4dbd 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "3.0.0", + "version": "3.0.1", "description": "An ESLint custom parser which leverages TypeScript ESTree", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -43,13 +43,13 @@ }, "dependencies": { "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "3.0.0", - "@typescript-eslint/typescript-estree": "3.0.0", + "@typescript-eslint/experimental-utils": "3.0.1", + "@typescript-eslint/typescript-estree": "3.0.1", "eslint-visitor-keys": "^1.1.0" }, "devDependencies": { "@types/glob": "^7.1.1", - "@typescript-eslint/shared-fixtures": "3.0.0", + "@typescript-eslint/shared-fixtures": "3.0.1", "glob": "*" }, "peerDependenciesMeta": { diff --git a/packages/shared-fixtures/CHANGELOG.md b/packages/shared-fixtures/CHANGELOG.md index 971eeae5e6fb..8e132bf097e3 100644 --- a/packages/shared-fixtures/CHANGELOG.md +++ b/packages/shared-fixtures/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.0...v3.0.1) (2020-05-25) + + +### Bug Fixes + +* **typescript-estree:** handle `BigInt` with `_` numeric separator ([#2067](https://github.com/typescript-eslint/typescript-eslint/issues/2067)) ([66f1627](https://github.com/typescript-eslint/typescript-eslint/commit/66f1627b11a566d5b925a577e800f99d5c808be2)) + + + + + # [3.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.34.0...v3.0.0) (2020-05-21) ## [Please see the release notes for v3.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0) diff --git a/packages/shared-fixtures/package.json b/packages/shared-fixtures/package.json index 09e9adfacc26..492bf472491a 100644 --- a/packages/shared-fixtures/package.json +++ b/packages/shared-fixtures/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/shared-fixtures", - "version": "3.0.0", + "version": "3.0.1", "private": true, "scripts": { "build": "tsc -b tsconfig.build.json", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index 53f5793ea372..3b52b56b076e 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.0...v3.0.1) (2020-05-25) + + +### Bug Fixes + +* **typescript-estree:** handle `BigInt` with `_` numeric separator ([#2067](https://github.com/typescript-eslint/typescript-eslint/issues/2067)) ([66f1627](https://github.com/typescript-eslint/typescript-eslint/commit/66f1627b11a566d5b925a577e800f99d5c808be2)) +* **typescript-estree:** mark TS 3.8 and 3.9 as "supported" ([#2057](https://github.com/typescript-eslint/typescript-eslint/issues/2057)) ([5eedbff](https://github.com/typescript-eslint/typescript-eslint/commit/5eedbff01178ea33b98ab22e556df4c1a195f839)), closes [#1436](https://github.com/typescript-eslint/typescript-eslint/issues/1436) [#1436](https://github.com/typescript-eslint/typescript-eslint/issues/1436) + + + + + # [3.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.34.0...v3.0.0) (2020-05-21) ## [Please see the release notes for v3.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0) diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index cfb89a302ccb..aa4a3620f561 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "3.0.0", + "version": "3.0.1", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -58,7 +58,7 @@ "@types/lodash": "^4.14.149", "@types/semver": "^7.1.0", "@types/tmp": "^0.2.0", - "@typescript-eslint/shared-fixtures": "3.0.0", + "@typescript-eslint/shared-fixtures": "3.0.1", "tmp": "^0.2.1", "typescript": "*" },