From 64fdf3110f4f62c019da88f4970df27f9f2ddcc7 Mon Sep 17 00:00:00 2001 From: "Shahar Or (mightyiam)" Date: Tue, 4 Feb 2020 22:58:51 +0700 Subject: [PATCH] feat: upgrade parser & plugin to v2.19.0 BREAKING CHANGE: new rule @typescript-eslint/no-unnecessary-boolean-literal-compare https://github.com/typescript-eslint/typescript-eslint/pull/242 BREAKING CHANGE: new rule @typescript-eslint/no-dupe-class-members https://github.com/typescript-eslint/typescript-eslint/blob/v2.19.0/packages/eslint-plugin/docs/rules/no-dupe-class-members.md BREAKING CHANGE: new rule @typescript-eslint/switch-exhaustiveness-check https://github.com/typescript-eslint/typescript-eslint/blob/v2.19.0/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md Closes #223. --- package.json | 6 +++--- src/index.test.ts | 4 +++- src/index.ts | 5 ++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index db5e3199..6336d79d 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "TypeScript" ], "dependencies": { - "@typescript-eslint/parser": "^2.18.0", + "@typescript-eslint/parser": "^2.19.0", "eslint-config-standard": "^14.1.0" }, "peerDependencies": { @@ -64,14 +64,14 @@ "eslint-plugin-node": ">=9.1.0", "eslint-plugin-promise": ">=4.2.1", "eslint-plugin-standard": ">=4.0.0", - "@typescript-eslint/eslint-plugin": ">=2.18.0" + "@typescript-eslint/eslint-plugin": ">=2.19.0" }, "devDependencies": { "@commitlint/cli": "^8.2.0", "@commitlint/config-conventional": "^8.2.0", "@commitlint/travis-cli": "^8.2.0", "@types/node": "^13.1.0", - "@typescript-eslint/eslint-plugin": "^2.18.0", + "@typescript-eslint/eslint-plugin": "^2.19.0", "ava": "^3.1.0", "editorconfig-checker": "^3.0.3", "eslint": "^6.7.2", diff --git a/src/index.test.ts b/src/index.test.ts index 6a2f7aaa..99b49cf8 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -37,7 +37,7 @@ test('export', (t): void => { 'default-param-last': 'off', indent: 'off', 'no-array-constructor': 'off', - 'no-duplicate-class-members': 'off', + 'no-dupe-class-members': 'off', 'no-throw-literal': 'off', 'no-undef': 'off', 'no-unused-vars': 'off', @@ -89,6 +89,7 @@ test('export', (t): void => { } ], '@typescript-eslint/no-array-constructor': 'error', + '@typescript-eslint/no-dupe-class-members': 'error', '@typescript-eslint/no-dynamic-delete': 'error', '@typescript-eslint/no-empty-function': ['error', { allow: [ @@ -110,6 +111,7 @@ test('export', (t): void => { '@typescript-eslint/no-this-alias': ['error', { allowDestructuring: true }], '@typescript-eslint/no-throw-literal': 'error', '@typescript-eslint/no-unnecessary-type-assertion': 'error', + '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error', '@typescript-eslint/no-unused-vars': ['error', { vars: 'all', args: 'none', ignoreRestSiblings: true }], '@typescript-eslint/no-use-before-define': ['error', { functions: false, classes: false, enums: false, variables: false, typedefs: false }], '@typescript-eslint/no-unused-expressions': ['error', { allowShortCircuit: true, allowTaggedTemplates: true, allowTernary: true }], diff --git a/src/index.ts b/src/index.ts index 45ac54fd..22f70ca5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,6 +5,7 @@ const equivalents = [ 'brace-style', 'indent', 'no-array-constructor', + 'no-dupe-class-members', 'no-throw-literal', 'no-unused-vars', 'no-unused-expressions', @@ -31,9 +32,6 @@ export = { // TypeScript has this functionality by default: 'no-undef': 'off', - // Incompatible with TypeScript function overloads: - 'no-duplicate-class-members': 'off', - // Rules replaced by @typescript-eslint versions: ...fromEntries(equivalents.map((name) => [name, 'off'])), camelcase: 'off', @@ -95,6 +93,7 @@ export = { '@typescript-eslint/no-non-null-asserted-optional-chain': 'error', '@typescript-eslint/no-non-null-assertion': 'error', '@typescript-eslint/no-this-alias': ['error', { allowDestructuring: true }], + '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error', '@typescript-eslint/no-unnecessary-type-assertion': 'error', '@typescript-eslint/no-var-requires': 'error', '@typescript-eslint/prefer-function-type': 'error',