From e6a09ab76f9b4d4822d960539a3133b7609240cc Mon Sep 17 00:00:00 2001 From: Toru Kobayashi Date: Mon, 25 May 2020 11:52:59 +0900 Subject: [PATCH] deps: update typescript-eslint version to v3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BREAKING CHANGE: Enable new rules in @typescript-eslint/recommended - @typescript-eslint/no-extra-non-null-assertion - @typescript-eslint/no-extra-semi - @typescript-eslint/no-non-null-asserted-optional-chain - ⚠️ @typescript-eslint/prefer-as-const --- configs/typescript.js | 16 ++++------------ package.json | 4 ++-- test/fixtures/mod.ts | 2 +- test/fixtures/sum.ts | 6 +++--- yarn.lock | 41 +++++++++++++++++++++-------------------- 5 files changed, 31 insertions(+), 38 deletions(-) diff --git a/configs/typescript.js b/configs/typescript.js index ce6647f8..cf418b72 100644 --- a/configs/typescript.js +++ b/configs/typescript.js @@ -1,21 +1,14 @@ module.exports = { parser: '@typescript-eslint/parser', plugins: ['@typescript-eslint'], - extends: [ - 'plugin:@typescript-eslint/eslint-recommended', - 'plugin:@typescript-eslint/recommended', - 'prettier/@typescript-eslint' - ], + extends: ['plugin:@typescript-eslint/recommended', 'prettier/@typescript-eslint'], rules: { - '@typescript-eslint/array-type': ['error', {default: 'array-simple'}], + '@typescript-eslint/array-type': ['error', { default: 'array-simple' }], 'no-useless-constructor': 'off', - '@typescript-eslint/type-annotation-spacing': 'warn', '@typescript-eslint/unified-signatures': 'warn', - '@typescript-eslint/ban-ts-ignore': 'off', - '@typescript-eslint/camelcase': 'off', - '@typescript-eslint/explicit-function-return-type': 'off', + '@typescript-eslint/ban-ts-comment': 'off', '@typescript-eslint/explicit-member-accessibility': 'off', - '@typescript-eslint/interface-name-prefix': 'off', + '@typescript-eslint/explicit-module-boundary-types': 'off', '@typescript-eslint/no-empty-interface': 'off', '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-inferrable-types': 'off', @@ -23,7 +16,6 @@ module.exports = { '@typescript-eslint/no-object-literal-type-assertion': 'off', '@typescript-eslint/no-triple-slash-reference': 'off', '@typescript-eslint/no-unused-vars': 'off', - '@typescript-eslint/no-use-before-define': 'off', '@typescript-eslint/no-var-requires': 'off', '@typescript-eslint/prefer-interface': 'off', '@typescript-eslint/prefer-namespace-keyword': 'off', diff --git a/package.json b/package.json index 05dc27d5..da42f9e4 100644 --- a/package.json +++ b/package.json @@ -41,8 +41,8 @@ "typescript": "^3.4.5" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "^2.34.0", - "@typescript-eslint/parser": "^2.34.0", + "@typescript-eslint/eslint-plugin": "^3.0.0", + "@typescript-eslint/parser": "^3.0.0", "eslint-config-prettier": "^6.11.0", "eslint-plugin-jsx-a11y": "^6.2.3", "eslint-plugin-prettier": "^3.1.3", diff --git a/test/fixtures/mod.ts b/test/fixtures/mod.ts index e29e02a1..07e65ec3 100644 --- a/test/fixtures/mod.ts +++ b/test/fixtures/mod.ts @@ -1 +1 @@ -export const mod = '' +export const str = '' diff --git a/test/fixtures/sum.ts b/test/fixtures/sum.ts index 7c3f7ec5..6fc6756a 100644 --- a/test/fixtures/sum.ts +++ b/test/fixtures/sum.ts @@ -1,7 +1,7 @@ -import { mod } from './mod' +import { str } from './mod' -mod = 'mod' -console.log(mod) +str = 'str' +console.log(str) function fn(a: any, b = 'b', c: any) { // noop diff --git a/yarn.lock b/yarn.lock index b5143cab..d4efafc8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -692,40 +692,41 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^2.34.0": - version "2.34.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.34.0.tgz#6f8ce8a46c7dea4a6f1d171d2bb8fbae6dac2be9" - integrity sha512-4zY3Z88rEE99+CNvTbXSyovv2z9PNOVffTWD2W8QF5s2prBQtwN2zadqERcrHpcR7O/+KMI3fcTAmUUhK/iQcQ== +"@typescript-eslint/eslint-plugin@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.0.0.tgz#02f8ec6b5ce814bda80dfc22463f108bed1f699b" + integrity sha512-lcZ0M6jD4cqGccYOERKdMtg+VWpoq3NSnWVxpc/AwAy0zhkUYVioOUZmfNqiNH8/eBNGhCn6HXd6mKIGRgNc1Q== dependencies: - "@typescript-eslint/experimental-utils" "2.34.0" + "@typescript-eslint/experimental-utils" "3.0.0" functional-red-black-tree "^1.0.1" regexpp "^3.0.0" + semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/experimental-utils@2.34.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== +"@typescript-eslint/experimental-utils@3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-3.0.0.tgz#1ddf53eeb61ac8eaa9a77072722790ac4f641c03" + integrity sha512-BN0vmr9N79M9s2ctITtChRuP1+Dls0x/wlg0RXW1yQ7WJKPurg6X3Xirv61J2sjPif4F8SLsFMs5Nzte0WYoTQ== dependencies: "@types/json-schema" "^7.0.3" - "@typescript-eslint/typescript-estree" "2.34.0" + "@typescript-eslint/typescript-estree" "3.0.0" eslint-scope "^5.0.0" eslint-utils "^2.0.0" -"@typescript-eslint/parser@^2.34.0": - version "2.34.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.34.0.tgz#50252630ca319685420e9a39ca05fe185a256bc8" - integrity sha512-03ilO0ucSD0EPTw2X4PntSIRFtDPWjrVq7C3/Z3VQHRC7+13YB55rcJI3Jt+YgeHbjUdJPcPa7b23rXCBokuyA== +"@typescript-eslint/parser@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-3.0.0.tgz#fe9fdf18a1155c02c04220c14506a320cb6c6944" + integrity sha512-8RRCA9KLxoFNO0mQlrLZA0reGPd/MsobxZS/yPFj+0/XgMdS8+mO8mF3BDj2ZYQj03rkayhSJtF1HAohQ3iylw== dependencies: "@types/eslint-visitor-keys" "^1.0.0" - "@typescript-eslint/experimental-utils" "2.34.0" - "@typescript-eslint/typescript-estree" "2.34.0" + "@typescript-eslint/experimental-utils" "3.0.0" + "@typescript-eslint/typescript-estree" "3.0.0" eslint-visitor-keys "^1.1.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== +"@typescript-eslint/typescript-estree@3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-3.0.0.tgz#fa40e1b76ccff880130be054d9c398e96004bf42" + integrity sha512-nevQvHyNghsfLrrByzVIH4ZG3NROgJ8LZlfh3ddwPPH4CH7W4GAiSx5qu+xHuX5pWsq6q/eqMc1io840ZhAnUg== dependencies: debug "^4.1.1" eslint-visitor-keys "^1.1.0"