diff --git a/packages/eslint-plugin/tests/rules/class-methods-use-this/class-methods-use-this-core.test.ts b/packages/eslint-plugin/tests/rules/class-methods-use-this/class-methods-use-this-core.test.ts index d0193efdc99d..e07263df6e98 100644 --- a/packages/eslint-plugin/tests/rules/class-methods-use-this/class-methods-use-this-core.test.ts +++ b/packages/eslint-plugin/tests/rules/class-methods-use-this/class-methods-use-this-core.test.ts @@ -1,7 +1,6 @@ /* eslint-disable @typescript-eslint/internal/plugin-test-formatting -- keeping eslint core formatting on purpose to make upstream diffing easier and so we don't need to edit line/cols */ import { RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../../src/rules/class-methods-use-this'; @@ -17,7 +16,6 @@ ruleTester.run('class-methods-use-this', rule, { data: { name: "method 'foo'" }, line: 1, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -30,7 +28,6 @@ ruleTester.run('class-methods-use-this', rule, { data: { name: "method 'foo'" }, line: 1, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -43,7 +40,6 @@ ruleTester.run('class-methods-use-this', rule, { data: { name: "method 'foo'" }, line: 1, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -56,7 +52,6 @@ ruleTester.run('class-methods-use-this', rule, { data: { name: "method 'foo'" }, line: 1, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -69,7 +64,6 @@ ruleTester.run('class-methods-use-this', rule, { data: { name: "method 'foo'" }, line: 1, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -82,7 +76,6 @@ ruleTester.run('class-methods-use-this', rule, { data: { name: "method 'foo'" }, line: 1, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -95,7 +88,6 @@ ruleTester.run('class-methods-use-this', rule, { data: { name: "method 'foo'" }, line: 1, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -108,7 +100,6 @@ ruleTester.run('class-methods-use-this', rule, { data: { name: "method 'foo'" }, line: 1, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -122,7 +113,6 @@ ruleTester.run('class-methods-use-this', rule, { data: { name: "method 'hasOwnProperty'" }, line: 1, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -136,7 +126,6 @@ ruleTester.run('class-methods-use-this', rule, { data: { name: 'method' }, line: 1, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -150,14 +139,12 @@ ruleTester.run('class-methods-use-this', rule, { data: { name: "method 'foo'" }, line: 1, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, { column: 31, data: { name: 'private method #bar' }, line: 1, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 2022 } }, @@ -170,55 +157,46 @@ ruleTester.run('class-methods-use-this', rule, { column: 11, data: { name: "method 'foo'" }, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, { column: 19, data: { name: "method 'bar'" }, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, { column: 29, data: { name: "method '123'" }, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, { column: 37, data: { name: "method 'baz'" }, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, { column: 49, data: { name: 'method' }, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, { column: 57, data: { name: 'method' }, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, { column: 68, data: { name: "getter 'quux'" }, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, { column: 81, data: { name: 'setter' }, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, { column: 93, data: { name: "generator method 'quuux'" }, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, diff --git a/packages/eslint-plugin/tests/rules/consistent-return.test.ts b/packages/eslint-plugin/tests/rules/consistent-return.test.ts index e62345932396..89574197c9fd 100644 --- a/packages/eslint-plugin/tests/rules/consistent-return.test.ts +++ b/packages/eslint-plugin/tests/rules/consistent-return.test.ts @@ -1,5 +1,4 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/consistent-return'; import { getFixturesRootDir } from '../RuleTester'; @@ -226,7 +225,6 @@ ruleTester.run('consistent-return', rule, { endLine: 4, line: 4, messageId: 'missingReturnValue', - type: AST_NODE_TYPES.ReturnStatement, }, ], }, @@ -246,7 +244,6 @@ ruleTester.run('consistent-return', rule, { endLine: 5, line: 5, messageId: 'missingReturnValue', - type: AST_NODE_TYPES.ReturnStatement, }, ], }, @@ -270,7 +267,6 @@ ruleTester.run('consistent-return', rule, { endLine: 6, line: 6, messageId: 'unexpectedReturnValue', - type: AST_NODE_TYPES.ReturnStatement, }, { column: 11, @@ -279,7 +275,6 @@ ruleTester.run('consistent-return', rule, { endLine: 9, line: 9, messageId: 'missingReturnValue', - type: AST_NODE_TYPES.ReturnStatement, }, ], }, @@ -298,7 +293,6 @@ ruleTester.run('consistent-return', rule, { endLine: 4, line: 4, messageId: 'missingReturnValue', - type: AST_NODE_TYPES.ReturnStatement, }, ], }, @@ -317,7 +311,6 @@ ruleTester.run('consistent-return', rule, { endLine: 4, line: 4, messageId: 'unexpectedReturnValue', - type: AST_NODE_TYPES.ReturnStatement, }, ], }, @@ -336,7 +329,6 @@ ruleTester.run('consistent-return', rule, { endLine: 4, line: 4, messageId: 'missingReturnValue', - type: AST_NODE_TYPES.ReturnStatement, }, ], }, @@ -355,7 +347,6 @@ ruleTester.run('consistent-return', rule, { endLine: 4, line: 4, messageId: 'unexpectedReturnValue', - type: AST_NODE_TYPES.ReturnStatement, }, ], }, @@ -374,7 +365,6 @@ ruleTester.run('consistent-return', rule, { endLine: 4, line: 4, messageId: 'unexpectedReturnValue', - type: AST_NODE_TYPES.ReturnStatement, }, ], }, @@ -396,7 +386,6 @@ ruleTester.run('consistent-return', rule, { endLine: 7, line: 7, messageId: 'missingReturnValue', - type: AST_NODE_TYPES.ReturnStatement, }, ], }, @@ -417,7 +406,6 @@ ruleTester.run('consistent-return', rule, { endLine: 6, line: 6, messageId: 'unexpectedReturnValue', - type: AST_NODE_TYPES.ReturnStatement, }, ], options: [ @@ -444,7 +432,6 @@ ruleTester.run('consistent-return', rule, { endLine: 7, line: 7, messageId: 'unexpectedReturnValue', - type: AST_NODE_TYPES.ReturnStatement, }, ], options: [ diff --git a/packages/eslint-plugin/tests/rules/no-array-constructor.test.ts b/packages/eslint-plugin/tests/rules/no-array-constructor.test.ts index ce97e7e6a8a2..8ddff69ff3ab 100644 --- a/packages/eslint-plugin/tests/rules/no-array-constructor.test.ts +++ b/packages/eslint-plugin/tests/rules/no-array-constructor.test.ts @@ -1,5 +1,4 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/no-array-constructor'; @@ -39,7 +38,6 @@ ruleTester.run('no-array-constructor', rule, { errors: [ { messageId: 'useLiteral', - type: AST_NODE_TYPES.NewExpression, }, ], output: '[];', @@ -49,7 +47,6 @@ ruleTester.run('no-array-constructor', rule, { errors: [ { messageId: 'useLiteral', - type: AST_NODE_TYPES.CallExpression, }, ], output: '[];', @@ -59,7 +56,6 @@ ruleTester.run('no-array-constructor', rule, { errors: [ { messageId: 'useLiteral', - type: AST_NODE_TYPES.CallExpression, }, ], output: '[];', @@ -69,7 +65,6 @@ ruleTester.run('no-array-constructor', rule, { errors: [ { messageId: 'useLiteral', - type: AST_NODE_TYPES.CallExpression, }, ], output: '/* a */ /* b */ []; /* g */ /* h */', @@ -79,7 +74,6 @@ ruleTester.run('no-array-constructor', rule, { errors: [ { messageId: 'useLiteral', - type: AST_NODE_TYPES.NewExpression, }, ], output: '[x, y];', @@ -89,7 +83,6 @@ ruleTester.run('no-array-constructor', rule, { errors: [ { messageId: 'useLiteral', - type: AST_NODE_TYPES.CallExpression, }, ], output: '[x, y];', @@ -99,7 +92,6 @@ ruleTester.run('no-array-constructor', rule, { errors: [ { messageId: 'useLiteral', - type: AST_NODE_TYPES.CallExpression, }, ], output: '[x, y];', @@ -109,7 +101,6 @@ ruleTester.run('no-array-constructor', rule, { errors: [ { messageId: 'useLiteral', - type: AST_NODE_TYPES.CallExpression, }, ], output: '/* a */ /* b */ [x, y]; /* g */ /* h */', @@ -119,7 +110,6 @@ ruleTester.run('no-array-constructor', rule, { errors: [ { messageId: 'useLiteral', - type: AST_NODE_TYPES.NewExpression, }, ], output: '[0, 1, 2];', @@ -129,7 +119,6 @@ ruleTester.run('no-array-constructor', rule, { errors: [ { messageId: 'useLiteral', - type: AST_NODE_TYPES.CallExpression, }, ], output: '[0, 1, 2];', @@ -139,7 +128,6 @@ ruleTester.run('no-array-constructor', rule, { errors: [ { messageId: 'useLiteral', - type: AST_NODE_TYPES.CallExpression, }, ], output: '[0, 1, 2];', @@ -155,7 +143,6 @@ ruleTester.run('no-array-constructor', rule, { errors: [ { messageId: 'useLiteral', - type: AST_NODE_TYPES.CallExpression, }, ], output: ` @@ -173,7 +160,6 @@ new Array(0, 1, 2); errors: [ { messageId: 'useLiteral', - type: AST_NODE_TYPES.NewExpression, }, ], output: ` diff --git a/packages/eslint-plugin/tests/rules/no-extraneous-class.test.ts b/packages/eslint-plugin/tests/rules/no-extraneous-class.test.ts index 19d501a347b8..b04a60d2ad06 100644 --- a/packages/eslint-plugin/tests/rules/no-extraneous-class.test.ts +++ b/packages/eslint-plugin/tests/rules/no-extraneous-class.test.ts @@ -1,5 +1,4 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/no-extraneous-class'; @@ -176,12 +175,7 @@ export default class { static hello() {} } `, - errors: [ - { - ...onlyStatic, - type: AST_NODE_TYPES.ClassDeclaration, - }, - ], + errors: [onlyStatic], }, { code: ` diff --git a/packages/eslint-plugin/tests/rules/no-loop-func.test.ts b/packages/eslint-plugin/tests/rules/no-loop-func.test.ts index 8b22f6a4ce8a..6075aec1b4ad 100644 --- a/packages/eslint-plugin/tests/rules/no-loop-func.test.ts +++ b/packages/eslint-plugin/tests/rules/no-loop-func.test.ts @@ -1,5 +1,4 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/no-loop-func'; @@ -479,7 +478,6 @@ for (var i = 0; i < l; i++) { { data: { varNames: "'i'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], }, @@ -497,7 +495,6 @@ for (var i = 0; i < l; i++) { { data: { varNames: "'i', 'j'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], }, @@ -513,7 +510,6 @@ for (var i in {}) { { data: { varNames: "'i'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], }, @@ -529,7 +525,6 @@ for (var i of {}) { { data: { varNames: "'i'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -546,7 +541,6 @@ for (var i = 0; i < l; i++) { { data: { varNames: "'i'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.ArrowFunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -563,7 +557,6 @@ for (var i = 0; i < l; i++) { { data: { varNames: "'i'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], }, @@ -580,7 +573,6 @@ for (var i = 0; i < l; i++) { { data: { varNames: "'i'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionDeclaration, }, ], }, @@ -600,7 +592,6 @@ for (let i = 0; i < l; i++) { { data: { varNames: "'a'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -619,7 +610,6 @@ for (let i in {}) { { data: { varNames: "'a'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -638,7 +628,6 @@ a = 1; { data: { varNames: "'a'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -659,7 +648,6 @@ for (let i = 0; i < l; i++) { { data: { varNames: "'a'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -680,7 +668,6 @@ for (let i in {}) { { data: { varNames: "'a'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionDeclaration, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -701,7 +688,6 @@ a = 1; { data: { varNames: "'a'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.ArrowFunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -717,7 +703,6 @@ for (var i = 0; i < 10; ++i) { { data: { varNames: "'i'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.ArrowFunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -738,7 +723,6 @@ for (let x of xs) { { data: { varNames: "'a'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -757,7 +741,6 @@ for (var x of xs) { { data: { varNames: "'x'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -774,7 +757,6 @@ for (var x of xs) { { data: { varNames: "'x'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -793,7 +775,6 @@ for (let x of xs) { { data: { varNames: "'a'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -812,7 +793,6 @@ for (let x of xs) { { data: { varNames: "'a'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -834,7 +814,6 @@ foo(); { data: { varNames: "'a'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -856,7 +835,6 @@ foo(); { data: { varNames: "'a'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, diff --git a/packages/eslint-plugin/tests/rules/no-redeclare.test.ts b/packages/eslint-plugin/tests/rules/no-redeclare.test.ts index 3d2f55e1d4e1..2b99a6168246 100644 --- a/packages/eslint-plugin/tests/rules/no-redeclare.test.ts +++ b/packages/eslint-plugin/tests/rules/no-redeclare.test.ts @@ -1,5 +1,4 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/no-redeclare'; @@ -155,7 +154,6 @@ var a = 10; id: 'a', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -175,7 +173,6 @@ switch (foo) { id: 'b', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -190,7 +187,6 @@ var a = 10; id: 'a', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -205,7 +201,6 @@ var a = []; id: 'a', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -220,7 +215,6 @@ function a() {} id: 'a', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -235,7 +229,6 @@ function a() {} id: 'a', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -250,7 +243,6 @@ var a = function () {}; id: 'a', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -265,7 +257,6 @@ var a = new Date(); id: 'a', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -281,14 +272,12 @@ var a = 15; id: 'a', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, { data: { id: 'a', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -303,7 +292,6 @@ var a; id: 'a', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { sourceType: 'module' } }, @@ -319,7 +307,6 @@ var a; id: 'a', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { sourceType: 'module' } }, @@ -332,7 +319,6 @@ var a; id: 'Object', }, messageId: 'redeclaredAsBuiltin', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ builtinGlobals: true }], @@ -345,7 +331,6 @@ var a; id: 'top', }, messageId: 'redeclaredAsBuiltin', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { @@ -364,14 +349,12 @@ var { a = 0, b: Object = 0 } = {}; id: 'a', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, { data: { id: 'Object', }, messageId: 'redeclaredAsBuiltin', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -388,7 +371,6 @@ var { a = 0, b: Object = 0 } = {}; id: 'a', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { @@ -407,7 +389,6 @@ var { a = 0, b: Object = 0 } = {}; id: 'a', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { @@ -426,7 +407,6 @@ var { a = 0, b: Object = 0 } = {}; id: 'a', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -442,7 +422,6 @@ var { a = 0, b: Object = 0 } = {}; id: 'b', }, messageId: 'redeclaredBySyntax', - type: AST_TOKEN_TYPES.Identifier, }, ], options: [{ builtinGlobals: true }], diff --git a/packages/eslint-plugin/tests/rules/no-restricted-imports.test.ts b/packages/eslint-plugin/tests/rules/no-restricted-imports.test.ts index b43a52ef8d71..c7f04a16db35 100644 --- a/packages/eslint-plugin/tests/rules/no-restricted-imports.test.ts +++ b/packages/eslint-plugin/tests/rules/no-restricted-imports.test.ts @@ -1,5 +1,4 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/no-restricted-imports'; @@ -393,7 +392,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'path', - type: AST_NODE_TYPES.ImportDeclaration, }, ], options: ['import1', 'import2'], @@ -412,7 +410,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'path', - type: AST_NODE_TYPES.ExportNamedDeclaration, }, ], options: ['import1', 'import2'], @@ -422,7 +419,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'path', - type: AST_NODE_TYPES.ImportDeclaration, }, ], options: [{ paths: ['import1', 'import2'] }], @@ -432,7 +428,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'path', - type: AST_NODE_TYPES.ExportNamedDeclaration, }, ], options: [{ paths: ['import1', 'import2'] }], @@ -442,7 +437,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'patterns', - type: AST_NODE_TYPES.ImportDeclaration, }, ], options: [ @@ -457,7 +451,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'patterns', - type: AST_NODE_TYPES.ExportNamedDeclaration, }, ], options: [ @@ -472,7 +465,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'pathWithCustomMessage', - type: AST_NODE_TYPES.ImportDeclaration, }, ], options: [ @@ -495,7 +487,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'pathWithCustomMessage', - type: AST_NODE_TYPES.ExportNamedDeclaration, }, ], options: [ @@ -518,7 +509,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'importNameWithCustomMessage', - type: AST_NODE_TYPES.ImportDeclaration, }, ], options: [ @@ -538,7 +528,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'importNameWithCustomMessage', - type: AST_NODE_TYPES.ExportNamedDeclaration, }, ], options: [ @@ -558,7 +547,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'patternWithCustomMessage', - type: AST_NODE_TYPES.ImportDeclaration, }, ], options: [ @@ -582,7 +570,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'patternWithCustomMessage', - type: AST_NODE_TYPES.ExportNamedDeclaration, }, ], options: [ @@ -606,7 +593,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'path', - type: AST_NODE_TYPES.ImportDeclaration, }, ], options: [ @@ -624,7 +610,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'path', - type: AST_NODE_TYPES.ImportDeclaration, }, ], options: [ @@ -643,7 +628,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'pathWithCustomMessage', - type: AST_NODE_TYPES.ImportDeclaration, }, ], options: [ @@ -682,7 +666,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'importNameWithCustomMessage', - type: AST_NODE_TYPES.ImportDeclaration, }, ], options: [ @@ -703,7 +686,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'importNameWithCustomMessage', - type: AST_NODE_TYPES.ExportNamedDeclaration, }, ], options: [ @@ -724,7 +706,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'patternWithCustomMessage', - type: AST_NODE_TYPES.ImportDeclaration, }, ], options: [ @@ -744,7 +725,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'patternWithCustomMessage', - type: AST_NODE_TYPES.ExportNamedDeclaration, }, ], options: [ @@ -764,7 +744,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'patternWithCustomMessage', - type: AST_NODE_TYPES.ExportNamedDeclaration, }, ], options: [ @@ -784,7 +763,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'patternWithCustomMessage', - type: AST_NODE_TYPES.ImportDeclaration, }, ], options: [ @@ -805,7 +783,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'path', - type: AST_NODE_TYPES.ExportAllDeclaration, }, ], options: ['import1'], @@ -815,7 +792,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'patterns', - type: AST_NODE_TYPES.ImportDeclaration, }, ], options: [ @@ -829,11 +805,9 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'importNameWithCustomMessage', - type: AST_NODE_TYPES.ImportDeclaration, }, { messageId: 'importNameWithCustomMessage', - type: AST_NODE_TYPES.ImportDeclaration, }, ], options: [ @@ -854,11 +828,9 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'importNameWithCustomMessage', - type: AST_NODE_TYPES.ExportNamedDeclaration, }, { messageId: 'importNameWithCustomMessage', - type: AST_NODE_TYPES.ExportNamedDeclaration, }, ], options: [ diff --git a/packages/eslint-plugin/tests/rules/no-shadow/no-shadow-eslint.test.ts b/packages/eslint-plugin/tests/rules/no-shadow/no-shadow-eslint.test.ts index c7c8fcbab3c5..1b009461ac9f 100644 --- a/packages/eslint-plugin/tests/rules/no-shadow/no-shadow-eslint.test.ts +++ b/packages/eslint-plugin/tests/rules/no-shadow/no-shadow-eslint.test.ts @@ -3,7 +3,6 @@ // License : https://github.com/eslint/eslint/blob/c4a70499720f48e27734068074fbeee4f48fb460/LICENSE import { RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../../src/rules/no-shadow'; @@ -27,7 +26,6 @@ function a(x) { shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -47,7 +45,6 @@ var a = x => { shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -68,7 +65,6 @@ function a(x) { shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -87,7 +83,6 @@ function a(x) { shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -106,7 +101,6 @@ function b() { shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -128,7 +122,6 @@ setTimeout(function () { shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -151,7 +144,6 @@ setTimeout(function () { shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, { data: { @@ -160,7 +152,6 @@ setTimeout(function () { shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -179,7 +170,6 @@ var x = 1; shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -199,7 +189,6 @@ let x = 1; shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -219,7 +208,6 @@ function a() {} shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -239,7 +227,6 @@ function a() {} shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -259,7 +246,6 @@ function a() {} shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -279,7 +265,6 @@ function a() {} shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -297,7 +282,6 @@ function a() {} shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -317,7 +301,6 @@ let a; shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -338,7 +321,6 @@ var a; shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -359,7 +341,6 @@ function a() {} shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -380,7 +361,6 @@ const a = 1; shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -401,7 +381,6 @@ var a; shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -422,7 +401,6 @@ function a() {} shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -443,7 +421,6 @@ let a; shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -464,7 +441,6 @@ var a; shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -485,7 +461,6 @@ function a() {} shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -506,7 +481,6 @@ let a; shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -527,7 +501,6 @@ var a; shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -548,7 +521,6 @@ function a() {} shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -567,7 +539,6 @@ let a; shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -586,7 +557,6 @@ var a; shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -605,7 +575,6 @@ function a() {} shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -625,7 +594,6 @@ function a() {} shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -643,7 +611,6 @@ function a() {} shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -662,7 +629,6 @@ function a() {} shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -680,7 +646,6 @@ function a() {} shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -699,7 +664,6 @@ function a() {} shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -719,7 +683,6 @@ function a() {} shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -739,7 +702,6 @@ function a() {} shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -760,7 +722,6 @@ function a() {} shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -780,7 +741,6 @@ function a() {} shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -803,7 +763,6 @@ function a() {} shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -824,7 +783,6 @@ class A { shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -845,7 +803,6 @@ class A { shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, { data: { @@ -854,7 +811,6 @@ class A { shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -870,7 +826,6 @@ function foo() { name: 'Object', }, messageId: 'noShadowGlobal', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ builtinGlobals: true }], @@ -887,7 +842,6 @@ function foo() { name: 'top', }, messageId: 'noShadowGlobal', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { globals: { top: 'readonly' } }, @@ -901,12 +855,9 @@ function foo() { name: 'Object', }, messageId: 'noShadowGlobal', - type: AST_NODE_TYPES.Identifier, }, ], - languageOptions: { - parserOptions: { ecmaVersion: 6, sourceType: 'module' }, - }, + languageOptions: {}, options: [{ builtinGlobals: true }], }, { @@ -917,12 +868,10 @@ function foo() { name: 'top', }, messageId: 'noShadowGlobal', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { globals: { top: 'readonly' }, - parserOptions: { ecmaVersion: 6, sourceType: 'module' }, }, options: [{ builtinGlobals: true }], }, @@ -934,7 +883,6 @@ function foo() { name: 'Object', }, messageId: 'noShadowGlobal', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { @@ -950,7 +898,6 @@ function foo() { name: 'top', }, messageId: 'noShadowGlobal', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { @@ -975,7 +922,6 @@ function foo(cb) { shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, diff --git a/packages/eslint-plugin/tests/rules/no-shadow/no-shadow.test.ts b/packages/eslint-plugin/tests/rules/no-shadow/no-shadow.test.ts index 1378a1785ae2..4d5b84ad3d81 100644 --- a/packages/eslint-plugin/tests/rules/no-shadow/no-shadow.test.ts +++ b/packages/eslint-plugin/tests/rules/no-shadow/no-shadow.test.ts @@ -1,5 +1,4 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../../src/rules/no-shadow'; @@ -328,7 +327,6 @@ function doThing(foo: number) {} shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ ignoreTypeValueShadow: false }], @@ -346,7 +344,6 @@ function doThing(foo: number) {} shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ ignoreTypeValueShadow: false }], @@ -364,7 +361,6 @@ function doThing(foo: number, bar: number) {} shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ ignoreTypeValueShadow: true }], @@ -387,7 +383,6 @@ declare module 'bar' { shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -409,7 +404,6 @@ declare module 'baz' { shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -431,7 +425,6 @@ declare module 'baz' { shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -448,7 +441,6 @@ let y; shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, { data: { @@ -457,7 +449,6 @@ let y; shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -476,7 +467,6 @@ let y; shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -495,7 +485,6 @@ type A = 1; shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'types' }], @@ -513,7 +502,6 @@ type A = 1; shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'types' }], @@ -531,7 +519,6 @@ interface A {} shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'types' }], @@ -549,7 +536,6 @@ interface A {} shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'types' }], @@ -569,7 +555,6 @@ type A = 1; shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'types' }], @@ -589,7 +574,6 @@ type A = 1; shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'types' }], @@ -608,7 +592,6 @@ type A = 1; shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'all' }], @@ -626,7 +609,6 @@ type A = 1; shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'all' }], @@ -644,7 +626,6 @@ interface A {} shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'all' }], @@ -662,7 +643,6 @@ interface A {} shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'all' }], @@ -682,7 +662,6 @@ type A = 1; shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'all' }], @@ -702,7 +681,6 @@ type A = 1; shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'all' }], @@ -721,7 +699,6 @@ type A = 1; shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'functions-and-types' }], @@ -739,7 +716,6 @@ type A = 1; shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'functions-and-types' }], @@ -757,7 +733,6 @@ interface A {} shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'functions-and-types' }], @@ -775,7 +750,6 @@ interface A {} shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'functions-and-types' }], @@ -795,7 +769,6 @@ type A = 1; shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'functions-and-types' }], @@ -815,7 +788,6 @@ type A = 1; shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'functions-and-types' }], diff --git a/packages/eslint-plugin/tests/rules/no-this-alias.test.ts b/packages/eslint-plugin/tests/rules/no-this-alias.test.ts index 810092f744b2..0ad0667512c6 100644 --- a/packages/eslint-plugin/tests/rules/no-this-alias.test.ts +++ b/packages/eslint-plugin/tests/rules/no-this-alias.test.ts @@ -1,19 +1,15 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/no-this-alias'; const idError = { messageId: 'thisAssignment' as const, - type: AST_NODE_TYPES.Identifier, }; const destructureError = { messageId: 'thisDestructure' as const, - type: AST_NODE_TYPES.ObjectPattern, }; const arrayDestructureError = { messageId: 'thisDestructure' as const, - type: AST_NODE_TYPES.ArrayPattern, }; const ruleTester = new RuleTester(); diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts index 91a153d7dd33..8bbc814fd314 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts @@ -1,5 +1,4 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/no-unnecessary-qualifier'; import { getFixturesRootDir } from '../RuleTester'; @@ -94,7 +93,6 @@ namespace A { errors: [ { messageId: 'unnecessaryQualifier', - type: AST_NODE_TYPES.Identifier, }, ], output: ` @@ -114,7 +112,6 @@ namespace A { errors: [ { messageId: 'unnecessaryQualifier', - type: AST_NODE_TYPES.Identifier, }, ], output: ` @@ -136,7 +133,6 @@ namespace A { errors: [ { messageId: 'unnecessaryQualifier', - type: AST_NODE_TYPES.Identifier, }, ], output: ` @@ -160,7 +156,6 @@ namespace A { errors: [ { messageId: 'unnecessaryQualifier', - type: AST_NODE_TYPES.TSQualifiedName, }, ], output: ` @@ -184,7 +179,6 @@ namespace A { errors: [ { messageId: 'unnecessaryQualifier', - type: AST_NODE_TYPES.TSQualifiedName, }, ], output: ` @@ -208,7 +202,6 @@ namespace A { errors: [ { messageId: 'unnecessaryQualifier', - type: AST_NODE_TYPES.MemberExpression, }, ], output: ` @@ -230,7 +223,6 @@ enum A { errors: [ { messageId: 'unnecessaryQualifier', - type: AST_NODE_TYPES.Identifier, }, ], output: ` @@ -252,7 +244,6 @@ namespace Foo { errors: [ { messageId: 'unnecessaryQualifier', - type: AST_NODE_TYPES.MemberExpression, }, ], output: ` @@ -274,7 +265,6 @@ declare module './foo' { errors: [ { messageId: 'unnecessaryQualifier', - type: AST_NODE_TYPES.Identifier, }, ], output: ` diff --git a/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts b/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts index a08b8de812a9..8494eb33e658 100644 --- a/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts +++ b/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts @@ -1,5 +1,4 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/no-use-before-define'; @@ -601,7 +600,6 @@ var a = 19; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { @@ -617,7 +615,6 @@ var a = 19; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -631,7 +628,6 @@ var a = 19; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -644,7 +640,6 @@ var a = function () {}; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -657,7 +652,6 @@ var a = [1, 3]; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -674,12 +668,10 @@ function a() { { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, { data: { name: 'b' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -692,7 +684,6 @@ var a = function () {}; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], options: ['nofunc'], @@ -708,7 +699,6 @@ var a = function () {}; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -722,7 +712,6 @@ function a() {} { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -740,7 +729,6 @@ try { { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -753,7 +741,6 @@ var a; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -767,7 +754,6 @@ class A {} { data: { name: 'A' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -783,7 +769,6 @@ class A {} { data: { name: 'A' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -797,7 +782,6 @@ var A = class {}; { data: { name: 'A' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -813,7 +797,6 @@ var A = class {}; { data: { name: 'A' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -831,7 +814,6 @@ a++; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -848,7 +830,6 @@ a++; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -864,7 +845,6 @@ a++; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -882,7 +862,6 @@ switch (foo) { { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -900,7 +879,6 @@ if (true) { { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -916,7 +894,6 @@ var a = function () {}; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ classes: false, functions: false }], @@ -930,7 +907,6 @@ var A = class {}; { data: { name: 'A' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -947,7 +923,6 @@ var A = class {}; { data: { name: 'A' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -961,7 +936,6 @@ var A = class {}; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -971,7 +945,6 @@ var A = class {}; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -982,7 +955,6 @@ var A = class {}; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -993,7 +965,6 @@ var A = class {}; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -1004,7 +975,6 @@ var A = class {}; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -1015,7 +985,6 @@ var A = class {}; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -1026,7 +995,6 @@ var A = class {}; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -1037,7 +1005,6 @@ var A = class {}; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -1048,7 +1015,6 @@ var A = class {}; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -1059,7 +1025,6 @@ var A = class {}; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -1073,7 +1038,6 @@ for (var a in a) { { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -1086,7 +1050,6 @@ for (var a of a) { { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -1105,7 +1068,6 @@ const Foo = 2; { data: { name: 'Foo' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ ignoreTypeReferences: false }], @@ -1124,7 +1086,6 @@ class Foo { { data: { name: 'Foo' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ ignoreTypeReferences: false }], @@ -1145,7 +1106,6 @@ const Foo = { { data: { name: 'Foo' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ ignoreTypeReferences: false }], @@ -1164,7 +1124,6 @@ const baz = ''; { data: { name: 'baz' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ ignoreTypeReferences: false }], @@ -1183,7 +1142,6 @@ var bar; { data: { name: 'bar' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, diff --git a/packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts b/packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts index 3d792dca4c7e..7eb57f812d2b 100644 --- a/packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts +++ b/packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts @@ -1,5 +1,4 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/no-useless-constructor'; @@ -228,7 +227,6 @@ ${' '} `, }, ], - type: AST_NODE_TYPES.MethodDefinition, }, ], }, @@ -253,7 +251,6 @@ ${' '} `, }, ], - type: AST_NODE_TYPES.MethodDefinition, }, ], }, @@ -278,7 +275,6 @@ ${' '} `, }, ], - type: AST_NODE_TYPES.MethodDefinition, }, ], }, @@ -303,7 +299,6 @@ ${' '} `, }, ], - type: AST_NODE_TYPES.MethodDefinition, }, ], }, @@ -328,7 +323,6 @@ ${' '} `, }, ], - type: AST_NODE_TYPES.MethodDefinition, }, ], }, @@ -353,7 +347,6 @@ ${' '} `, }, ], - type: AST_NODE_TYPES.MethodDefinition, }, ], }, @@ -378,7 +371,6 @@ ${' '} `, }, ], - type: AST_NODE_TYPES.MethodDefinition, }, ], }, @@ -403,7 +395,6 @@ ${' '} `, }, ], - type: AST_NODE_TYPES.MethodDefinition, }, ], }, @@ -426,7 +417,6 @@ ${' '} `, }, ], - type: AST_NODE_TYPES.MethodDefinition, }, ], }, diff --git a/packages/eslint-plugin/tests/rules/prefer-destructuring.test.ts b/packages/eslint-plugin/tests/rules/prefer-destructuring.test.ts index 452990eadbcd..3c4b0fa576aa 100644 --- a/packages/eslint-plugin/tests/rules/prefer-destructuring.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-destructuring.test.ts @@ -1,5 +1,4 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/prefer-destructuring'; import { getFixturesRootDir } from '../RuleTester'; @@ -482,7 +481,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], options: [ @@ -497,7 +495,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'array' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], options: [ @@ -512,7 +509,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], options: [ @@ -535,7 +531,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'array' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], output: null, @@ -549,7 +544,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'array' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], output: null, @@ -563,7 +557,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'array' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], output: null, @@ -577,7 +570,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'array' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], output: null, @@ -593,7 +585,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'array' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], output: null, @@ -609,7 +600,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'array' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], output: null, @@ -623,7 +613,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'array' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], output: null, @@ -637,7 +626,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'array' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], output: null, @@ -651,7 +639,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'array' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], output: null, @@ -665,7 +652,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'array' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], output: null, @@ -679,7 +665,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'array' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], output: null, @@ -693,7 +678,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'array' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], output: null, @@ -707,7 +691,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], options: [{ object: true }, { enforceForRenamedProperties: true }], @@ -722,7 +705,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], options: [{ object: true }, { enforceForRenamedProperties: true }], @@ -737,7 +719,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], options: [ @@ -758,7 +739,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], options: [ @@ -780,7 +760,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], options: [ @@ -799,7 +778,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], options: [ @@ -818,7 +796,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], options: [ @@ -837,7 +814,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], options: [ @@ -856,7 +832,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], options: [ @@ -875,7 +850,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], options: [ @@ -893,7 +867,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], options: [{ object: true }, { enforceForRenamedProperties: true }], @@ -908,7 +881,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], options: [{ object: true }, { enforceForRenamedProperties: true }], @@ -925,7 +897,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], output: ` @@ -943,7 +914,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], output: ` @@ -958,7 +928,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], output: 'const {call} = () => null;', @@ -973,7 +942,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], output: ` @@ -991,7 +959,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], output: ` @@ -1008,7 +975,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], output: ` @@ -1027,7 +993,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], options: [{ object: true }, { enforceForRenamedProperties: true }], @@ -1043,7 +1008,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], options: [{ object: true }, { enforceForRenamedProperties: true }], @@ -1059,7 +1023,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], options: [{ object: true }, { enforceForRenamedProperties: true }], @@ -1076,7 +1039,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], options: [{ object: true }, { enforceForRenamedProperties: true }], diff --git a/packages/eslint-plugin/tests/rules/prefer-function-type.test.ts b/packages/eslint-plugin/tests/rules/prefer-function-type.test.ts index 12f1bb333689..64109ab7e180 100644 --- a/packages/eslint-plugin/tests/rules/prefer-function-type.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-function-type.test.ts @@ -55,7 +55,6 @@ interface Foo { literalOrInterface: phrases[AST_NODE_TYPES.TSInterfaceDeclaration], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: ` @@ -76,7 +75,6 @@ export default interface Foo { literalOrInterface: phrases[AST_NODE_TYPES.TSInterfaceDeclaration], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: null, @@ -94,7 +92,6 @@ interface Foo { literalOrInterface: phrases[AST_NODE_TYPES.TSInterfaceDeclaration], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: ` @@ -115,7 +112,6 @@ export interface Foo { literalOrInterface: phrases[AST_NODE_TYPES.TSInterfaceDeclaration], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: ` @@ -136,7 +132,6 @@ export interface Foo { literalOrInterface: phrases[AST_NODE_TYPES.TSInterfaceDeclaration], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: ` @@ -156,7 +151,6 @@ function foo(bar: { /* comment */ (s: string): number } | undefined): number { literalOrInterface: phrases[AST_NODE_TYPES.TSTypeLiteral], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: ` @@ -177,7 +171,6 @@ type Foo = { literalOrInterface: phrases[AST_NODE_TYPES.TSTypeLiteral], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: ` @@ -196,7 +189,6 @@ function foo(bar: { (s: string): number }): number { literalOrInterface: phrases[AST_NODE_TYPES.TSTypeLiteral], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: ` @@ -217,7 +209,6 @@ function foo(bar: { (s: string): number } | undefined): number { literalOrInterface: phrases[AST_NODE_TYPES.TSTypeLiteral], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: ` @@ -238,7 +229,6 @@ interface Foo extends Function { literalOrInterface: phrases[AST_NODE_TYPES.TSInterfaceDeclaration], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: ` @@ -257,7 +247,6 @@ interface Foo { literalOrInterface: phrases[AST_NODE_TYPES.TSInterfaceDeclaration], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: ` @@ -276,7 +265,6 @@ interface Foo { literalOrInterface: phrases[AST_NODE_TYPES.TSInterfaceDeclaration], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: ` @@ -293,7 +281,6 @@ type Foo = { (this: string): T }; literalOrInterface: phrases[AST_NODE_TYPES.TSTypeLiteral], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: ` @@ -312,7 +299,6 @@ interface Foo { interfaceName: 'Foo', }, messageId: 'unexpectedThisOnFunctionOnlyInterface', - type: AST_NODE_TYPES.TSThisType, }, ], output: null, @@ -329,7 +315,6 @@ interface Foo { interfaceName: 'Foo', }, messageId: 'unexpectedThisOnFunctionOnlyInterface', - type: AST_NODE_TYPES.TSThisType, }, ], output: null, @@ -355,7 +340,6 @@ interface Foo { literalOrInterface: phrases[AST_NODE_TYPES.TSInterfaceDeclaration], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: ` @@ -381,7 +365,6 @@ type X = {} | { (): void; } literalOrInterface: phrases[AST_NODE_TYPES.TSTypeLiteral], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: ` @@ -398,7 +381,6 @@ type X = {} & { (): void; }; literalOrInterface: phrases[AST_NODE_TYPES.TSTypeLiteral], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: ` diff --git a/packages/eslint-plugin/tests/rules/prefer-promise-reject-errors.test.ts b/packages/eslint-plugin/tests/rules/prefer-promise-reject-errors.test.ts index 09aa8d7e460e..d8edf4fb9c48 100644 --- a/packages/eslint-plugin/tests/rules/prefer-promise-reject-errors.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-promise-reject-errors.test.ts @@ -1,5 +1,4 @@ import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/prefer-promise-reject-errors'; import { getFixturesRootDir } from '../RuleTester'; @@ -320,7 +319,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -333,7 +331,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -346,7 +343,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -359,7 +355,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -372,7 +367,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -385,7 +379,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -398,7 +391,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -411,7 +403,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -424,7 +415,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], options: [{ allowEmptyReject: true }], @@ -438,7 +428,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -451,7 +440,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -464,7 +452,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -480,7 +467,6 @@ Promise.reject(foo); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -496,7 +482,6 @@ Promise.reject(await foo()); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -512,7 +497,6 @@ Promise.reject(foo && new Error()); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -528,7 +512,6 @@ foo.reject(); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -542,7 +525,6 @@ foo.reject(); endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -555,7 +537,6 @@ foo.reject(); endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -568,7 +549,6 @@ foo.reject(); endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -581,7 +561,6 @@ foo.reject(); endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -594,7 +573,6 @@ foo.reject(); endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -607,7 +585,6 @@ foo.reject(); endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -622,7 +599,6 @@ foo.reject(); endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -635,7 +611,6 @@ foo.reject(); endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -648,7 +623,6 @@ foo.reject(); endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -661,7 +635,6 @@ foo.reject(); endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -674,7 +647,6 @@ foo.reject(); endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -687,7 +659,6 @@ foo.reject(); endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -703,7 +674,6 @@ Promise.reject(foo); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -719,7 +689,6 @@ Promise.reject(foo); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -736,7 +705,6 @@ Promise.reject(foo); endLine: 4, line: 4, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -752,7 +720,6 @@ Promise.reject(foo); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -768,7 +735,6 @@ Promise.reject(foo); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -784,7 +750,6 @@ Promise.reject(foo); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -800,7 +765,6 @@ Promise.reject(foo); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -816,7 +780,6 @@ Promise.reject(foo); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -832,7 +795,6 @@ Promise.reject(foo); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -848,7 +810,6 @@ Promise.reject(foo); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -864,7 +825,6 @@ Promise.reject(foo); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -881,7 +841,6 @@ Promise.reject(foo); endLine: 4, line: 4, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -897,7 +856,6 @@ Promise.reject(foo); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -913,7 +871,6 @@ Promise.reject(foo); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -929,7 +886,6 @@ Promise.reject(foo); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -947,7 +903,6 @@ new Promise(function (resolve, reject) { endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -964,7 +919,6 @@ new Promise(function (resolve, reject) { endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -981,7 +935,6 @@ new Promise((resolve, reject) => { endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -994,7 +947,6 @@ new Promise((resolve, reject) => { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1014,7 +966,6 @@ new Promise((resolve, reject) => { endLine: 4, line: 4, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1027,7 +978,6 @@ new Promise((resolve, reject) => { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1040,7 +990,6 @@ new Promise((resolve, reject) => { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1057,7 +1006,6 @@ new Promise(function (reject, reject) { endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1074,7 +1022,6 @@ new Promise(function (foo, arguments) { endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1087,7 +1034,6 @@ new Promise(function (foo, arguments) { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1104,7 +1050,6 @@ new Promise(function ({}, reject) { endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1117,7 +1062,6 @@ new Promise(function ({}, reject) { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1130,7 +1074,6 @@ new Promise(function ({}, reject) { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1148,7 +1091,6 @@ new foo.bar((resolve, reject) => reject(5)); endLine: 5, line: 5, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1166,7 +1108,6 @@ new (foo?.bar)((resolve, reject) => reject(5)); endLine: 5, line: 5, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1182,7 +1123,6 @@ new foo((resolve, reject) => reject(5)); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1198,7 +1138,6 @@ new Promise((resolve, reject) => reject(foo)); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1214,7 +1153,6 @@ new Promise((resolve, reject) => reject(foo)); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1231,7 +1169,6 @@ new Promise((resolve, reject) => reject(foo)); endLine: 4, line: 4, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1247,7 +1184,6 @@ new Promise((resolve, reject) => reject(foo)); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1263,7 +1199,6 @@ new Promise((resolve, reject) => reject(foo)); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1279,7 +1214,6 @@ new Promise((resolve, reject) => reject(foo)); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1295,7 +1229,6 @@ new Promise((resolve, reject) => reject(foo)); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1311,7 +1244,6 @@ new Promise((resolve, reject) => reject(foo)); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1327,7 +1259,6 @@ new Promise((resolve, reject) => reject(foo)); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1343,7 +1274,6 @@ new Promise((resolve, reject) => reject(foo)); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1359,7 +1289,6 @@ new Promise((resolve, reject) => reject(foo)); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1376,7 +1305,6 @@ new Promise((resolve, reject) => reject(foo)); endLine: 4, line: 4, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1392,7 +1320,6 @@ new Promise((resolve, reject) => reject(foo)); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1408,7 +1335,6 @@ new Promise((resolve, reject) => reject(foo)); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1424,7 +1350,6 @@ new Promise((resolve, reject) => reject(foo)); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1440,7 +1365,6 @@ Foo.reject(5); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1456,7 +1380,6 @@ foo.reject(5); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1473,7 +1396,6 @@ Bar.reject(5); endLine: 4, line: 4, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1491,7 +1413,6 @@ function fun(t: T): void { endLine: 4, line: 4, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1503,7 +1424,6 @@ function fun(t: T): void { errors: [ { messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], options: [{ allowThrowingAny: false, allowThrowingUnknown: true }], @@ -1516,7 +1436,6 @@ function fun(t: T): void { errors: [ { messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], options: [{ allowThrowingAny: true, allowThrowingUnknown: false }], @@ -1529,7 +1448,6 @@ function fun(t: T): void { errors: [ { messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1541,7 +1459,6 @@ function fun(t: T): void { errors: [ { messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], },