diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 67428be1e01..5794d8565cb 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -67,13 +67,13 @@ i.e. eslint --ext ".ts,.js" src --debug **Versions** -| package | version | -| --------------------------------------- | ------- | -| `@typescript-eslint/eslint-plugin` | `X.Y.Z` | -| `@typescript-eslint/parser` | `X.Y.Z` | -| `@typescript-eslint/typescript-estree` | `X.Y.Z` | -| `@typescript-eslint/experimental-utils` | `X.Y.Z` | -| `@typescript-eslint/type-utils` | `X.Y.Z` | -| `TypeScript` | `X.Y.Z` | -| `node` | `X.Y.Z` | -| `npm` | `X.Y.Z` | +| package | version | +| -------------------------------------- | ------- | +| `@typescript-eslint/eslint-plugin` | `X.Y.Z` | +| `@typescript-eslint/parser` | `X.Y.Z` | +| `@typescript-eslint/typescript-estree` | `X.Y.Z` | +| `@typescript-eslint/type-utils` | `X.Y.Z` | +| `@typescript-eslint/utils` | `X.Y.Z` | +| `TypeScript` | `X.Y.Z` | +| `node` | `X.Y.Z` | +| `npm` | `X.Y.Z` | diff --git a/.github/ISSUE_TEMPLATE/typescript-eslint-utils.md b/.github/ISSUE_TEMPLATE/typescript-eslint-utils.md index 0d2ca8ccf2d..f576997d56f 100644 --- a/.github/ISSUE_TEMPLATE/typescript-eslint-utils.md +++ b/.github/ISSUE_TEMPLATE/typescript-eslint-utils.md @@ -1,9 +1,8 @@ --- -name: '@typescript-eslint/experimental-utils' -about: Report an issue with the '@typescript-eslint/experimental-utils' package -title: '' -labels: 'package: utils, triage' -assignees: '' +name: '@typescript-eslint/utils' +about: Report an issue with the 'typescript-eslint/utils' package +title: '': 'package: utils, triage' +: '' --- - [ ] I have tried restarting my IDE and the issue persists. @@ -64,8 +63,8 @@ i.e. eslint --ext ".ts,.js" src --debug **Versions** -| package | version | -| --------------------------------------- | ------- | -| `@typescript-eslint/experimental-utils` | `X.Y.Z` | -| `TypeScript` | `X.Y.Z` | -| `node` | `X.Y.Z` | +| package | version | +| ---------------------------| ------- | +| `@typescript-eslint/utils` | `X.Y.Z` | +| `TypeScript` | `X.Y.Z` | +| `node` | `X.Y.Z` | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f05912ef76a..7e79299fdf0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -111,8 +111,8 @@ jobs: env: CI: true - - name: Run unit tests for experimental-utils - run: npx nx test @typescript-eslint/experimental-utils + - name: Run unit tests for utils + run: npx nx test @typescript-eslint/utils env: CI: true @@ -283,8 +283,8 @@ jobs: env: CI: true - - name: Run unit tests for experimental-utils - run: npx nx test @typescript-eslint/experimental-utils + - name: Run unit tests for utils + run: npx nx test @typescript-eslint/utils env: CI: true diff --git a/.vscode/launch.json b/.vscode/launch.json index 0162b9ae831..d61dbf50a74 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -20,10 +20,10 @@ "console": "integratedTerminal", "internalConsoleOptions": "neverOpen", "skipFiles": [ - "${workspaceFolder}/packages/experimental-utils/src/index.ts", - "${workspaceFolder}/packages/experimental-utils/dist/index.js", - "${workspaceFolder}/packages/experimental-utils/src/ts-estree.ts", - "${workspaceFolder}/packages/experimental-utils/dist/ts-estree.js", + "${workspaceFolder}/packages/utils/src/index.ts", + "${workspaceFolder}/packages/utils/dist/index.js", + "${workspaceFolder}/packages/utils/src/ts-estree.ts", + "${workspaceFolder}/packages/utils/dist/ts-estree.js", "${workspaceFolder}/packages/type-utils/src/index.ts", "${workspaceFolder}/packages/type-utils/dist/index.js", "${workspaceFolder}/packages/parser/src/index.ts", @@ -54,10 +54,10 @@ "console": "integratedTerminal", "internalConsoleOptions": "neverOpen", "skipFiles": [ - "${workspaceFolder}/packages/experimental-utils/src/index.ts", - "${workspaceFolder}/packages/experimental-utils/dist/index.js", - "${workspaceFolder}/packages/experimental-utils/src/ts-estree.ts", - "${workspaceFolder}/packages/experimental-utils/dist/ts-estree.js", + "${workspaceFolder}/packages/utils/src/index.ts", + "${workspaceFolder}/packages/utils/dist/index.js", + "${workspaceFolder}/packages/utils/src/ts-estree.ts", + "${workspaceFolder}/packages/utils/dist/ts-estree.js", "${workspaceFolder}/packages/type-utils/src/index.ts", "${workspaceFolder}/packages/type-utils/dist/index.js", "${workspaceFolder}/packages/parser/src/index.ts", @@ -88,10 +88,10 @@ "console": "integratedTerminal", "internalConsoleOptions": "neverOpen", "skipFiles": [ - "${workspaceFolder}/packages/experimental-utils/src/index.ts", - "${workspaceFolder}/packages/experimental-utils/dist/index.js", - "${workspaceFolder}/packages/experimental-utils/src/ts-estree.ts", - "${workspaceFolder}/packages/experimental-utils/dist/ts-estree.js", + "${workspaceFolder}/packages/utils/src/index.ts", + "${workspaceFolder}/packages/utils/dist/index.js", + "${workspaceFolder}/packages/utils/src/ts-estree.ts", + "${workspaceFolder}/packages/utils/dist/ts-estree.js", "${workspaceFolder}/packages/type-utils/src/ts-estree.ts", "${workspaceFolder}/packages/type-utils/dist/ts-estree.js", "${workspaceFolder}/packages/parser/src/index.ts", @@ -122,10 +122,10 @@ "console": "integratedTerminal", "internalConsoleOptions": "neverOpen", "skipFiles": [ - "${workspaceFolder}/packages/experimental-utils/src/index.ts", - "${workspaceFolder}/packages/experimental-utils/dist/index.js", - "${workspaceFolder}/packages/experimental-utils/src/ts-estree.ts", - "${workspaceFolder}/packages/experimental-utils/dist/ts-estree.js", + "${workspaceFolder}/packages/utils/src/index.ts", + "${workspaceFolder}/packages/utils/dist/index.js", + "${workspaceFolder}/packages/utils/src/ts-estree.ts", + "${workspaceFolder}/packages/utils/dist/ts-estree.js", "${workspaceFolder}/packages/type-utils/src/index.ts", "${workspaceFolder}/packages/type-utils/dist/index.js", "${workspaceFolder}/packages/parser/src/index.ts", @@ -143,8 +143,8 @@ { "type": "node", "request": "launch", - "name": "Run currently opened experimental-utils test", - "cwd": "${workspaceFolder}/packages/experimental-utils/", + "name": "Run currently opened utils test", + "cwd": "${workspaceFolder}/packages/utils/", "program": "${workspaceFolder}/node_modules/jest/bin/jest.js", "args": [ "--runInBand", @@ -156,10 +156,10 @@ "console": "integratedTerminal", "internalConsoleOptions": "neverOpen", "skipFiles": [ - "${workspaceFolder}/packages/experimental-utils/src/index.ts", - "${workspaceFolder}/packages/experimental-utils/dist/index.js", - "${workspaceFolder}/packages/experimental-utils/src/ts-estree.ts", - "${workspaceFolder}/packages/experimental-utils/dist/ts-estree.js", + "${workspaceFolder}/packages/utils/src/index.ts", + "${workspaceFolder}/packages/utils/dist/index.js", + "${workspaceFolder}/packages/utils/src/ts-estree.ts", + "${workspaceFolder}/packages/utils/dist/ts-estree.js", "${workspaceFolder}/packages/type-utils/src/index.ts", "${workspaceFolder}/packages/type-utils/dist/index.js", "${workspaceFolder}/packages/parser/src/index.ts", @@ -190,10 +190,10 @@ "console": "integratedTerminal", "internalConsoleOptions": "neverOpen", "skipFiles": [ - "${workspaceFolder}/packages/experimental-utils/src/index.ts", - "${workspaceFolder}/packages/experimental-utils/dist/index.js", - "${workspaceFolder}/packages/experimental-utils/src/ts-estree.ts", - "${workspaceFolder}/packages/experimental-utils/dist/ts-estree.js", + "${workspaceFolder}/packages/utils/src/index.ts", + "${workspaceFolder}/packages/utils/dist/index.js", + "${workspaceFolder}/packages/utils/src/ts-estree.ts", + "${workspaceFolder}/packages/utils/dist/ts-estree.js", "${workspaceFolder}/packages/type-utils/src/index.ts", "${workspaceFolder}/packages/type-utils/dist/index.js", "${workspaceFolder}/packages/parser/src/index.ts", @@ -224,10 +224,10 @@ "console": "integratedTerminal", "internalConsoleOptions": "neverOpen", "skipFiles": [ - "${workspaceFolder}/packages/experimental-utils/src/index.ts", - "${workspaceFolder}/packages/experimental-utils/dist/index.js", - "${workspaceFolder}/packages/experimental-utils/src/ts-estree.ts", - "${workspaceFolder}/packages/experimental-utils/dist/ts-estree.js", + "${workspaceFolder}/packages/utils/src/index.ts", + "${workspaceFolder}/packages/utils/dist/index.js", + "${workspaceFolder}/packages/utils/src/ts-estree.ts", + "${workspaceFolder}/packages/utils/dist/ts-estree.js", "${workspaceFolder}/packages/type-utils/src/index.ts", "${workspaceFolder}/packages/type-utils/dist/index.js", "${workspaceFolder}/packages/parser/src/index.ts", diff --git a/README.md b/README.md index bf858a9e646..a3535cd83c3 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ See https://typescript-eslint.io/docs/development/architecture/packages for more - [`@typescript-eslint/eslint-plugin`](./packages/eslint-plugin) - [`@typescript-eslint/parser`](./packages/parser) - [`@typescript-eslint/eslint-plugin-tslint`](./packages/eslint-plugin-tslint) -- [`@typescript-eslint/experimental-utils`](./packages/experimental-utils) +- [`@typescript-eslint/utils`](./packages/utils) - [`@typescript-eslint/typescript-estree`](./packages/typescript-estree) - [`@typescript-eslint/scope-manager`](./packages/scope-manager) diff --git a/docs/development/CUSTOM_RULES.md b/docs/development/CUSTOM_RULES.md index 692c08b4b1e..f41cd7b72ca 100644 --- a/docs/development/CUSTOM_RULES.md +++ b/docs/development/CUSTOM_RULES.md @@ -11,13 +11,13 @@ You should be familiar with [ESLint's developer guide](https://eslint.org/docs/d As long as you are using `@typescript-eslint/parser` as the `parser` in your ESLint configuration, custom ESLint rules generally work the same way for JavaScript and TypeScript code. The main three changes to custom rules writing are: -- [Utils Package](#utils-package): we recommend using `@typescript-eslint/experimental-utils` to create custom rules +- [Utils Package](#utils-package): we recommend using `@typescript-eslint/utils` to create custom rules - [AST Extensions](#ast-extensions): targeting TypeScript-specific syntax in your rule selectors - [Typed Rules](#typed-rules): using the TypeScript type checker to inform rule logic ## Utils Package -The `@typescript-eslint/experimental-utils` package acts as a replacement package for `eslint` that exports all the same objects and types, but with typescript-eslint support. +The `@typescript-eslint/utils` package acts as a replacement package for `eslint` that exports all the same objects and types, but with typescript-eslint support. It also exports common utility functions and constants most custom typescript-eslint rules tend to use. :::caution @@ -27,7 +27,7 @@ You should generally not need to import from `eslint` when writing custom typesc ### `RuleCreator` -The recommended way to create custom ESLint rules that make use of typescript-eslint features and/or syntax is with the `ESLintUtils.RuleCreator` function exported by `@typescript-eslint/experimental-utils`. +The recommended way to create custom ESLint rules that make use of typescript-eslint features and/or syntax is with the `ESLintUtils.RuleCreator` function exported by `@typescript-eslint/utils`. It takes in a function that transforms a rule name into its documentation URL, then returns a function that takes in a rule module object. `RuleCreator` will infer the allowed message IDs the rule is allowed to emit from the provided `meta.messages` object. @@ -35,7 +35,7 @@ It takes in a function that transforms a rule name into its documentation URL, t This rule bans function declarations that start with a lower-case letter: ```ts -import { ESLintUtils } from '@typescript-eslint/experimental-utils'; +import { ESLintUtils } from '@typescript-eslint/utils'; const createRule = ESLintUtils.RuleCreator( name => `https://example.com/rule/${name}`, @@ -70,7 +70,7 @@ export const rule = createRule({ }); ``` -`RuleCreator` rule creator functions return rules typed as the `RuleModule` interface exported by `@typescript-eslint/experimental-utils`. +`RuleCreator` rule creator functions return rules typed as the `RuleModule` interface exported by `@typescript-eslint/utils`. It allows specifying generics for: - `MessageIds`: a union of string literal message IDs that may be reported @@ -79,7 +79,7 @@ It allows specifying generics for: If the rule is able to take in rule options, declare them as a tuple type containing a single object of rule options: ```ts -import { ESLintUtils } from '@typescript-eslint/experimental-utils'; +import { ESLintUtils } from '@typescript-eslint/utils'; type MessageIds = 'lowercase' | 'uppercase'; @@ -101,7 +101,7 @@ Although it is generally not recommended to create custom rules without document It applies the same type inference as the `createRule`s above without enforcing a documentation URL. ```ts -import { ESLintUtils } from '@typescript-eslint/experimental-utils'; +import { ESLintUtils } from '@typescript-eslint/utils'; export const rule = ESLintUtils.RuleCreator.withoutDocs({ create(context) { @@ -126,7 +126,7 @@ You can query for them in your rule selectors. This version of the above rule instead bans interface declaration names that start with a lower-case letter: ```ts -import { ESLintUtils } from '@typescript-eslint/experimental-utils'; +import { ESLintUtils } from '@typescript-eslint/utils'; export const rule = createRule({ create(context) { @@ -144,7 +144,7 @@ export const rule = createRule({ ### Node Types -TypeScript types for nodes exist in a `TSESTree` namespace exported by `@typescript-eslint/experimental-utils`. +TypeScript types for nodes exist in a `TSESTree` namespace exported by `@typescript-eslint/utils`. The above rule body could be better written in TypeScript with a type annotation on the `node`: An `AST_NODE_TYPES` enum is exported as well to hold the values for AST node `type` properties. @@ -153,10 +153,7 @@ An `AST_NODE_TYPES` enum is exported as well to hold the values for AST node `ty For example, checking `node.type` can narrow down the type of the `node`: ```ts -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; export function describeNode(node: TSESTree.Node): string { switch (node.type) { @@ -180,10 +177,7 @@ In that case, it is best to add an explicit type declaration. This rule snippet targets name nodes of both function and interface declarations: ```ts -import { - AST_NODE_TYPES, - ESLintUtils, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, ESLintUtils } from '@typescript-eslint/utils'; export const rule = createRule({ create(context) { @@ -211,7 +205,7 @@ Read TypeScript's [Compiler APIs > Using the Type Checker](https://github.com/mi The biggest addition typescript-eslint brings to ESLint rules is the ability to use TypeScript's type checker APIs. -`@typescript-eslint/experimental-utils` exports an `ESLintUtils` namespace containing a `getParserServices` function that takes in an ESLint context and returns a `parserServices` object. +`@typescript-eslint/utils` exports an `ESLintUtils` namespace containing a `getParserServices` function that takes in an ESLint context and returns a `parserServices` object. That `parserServices` object contains: @@ -224,7 +218,7 @@ By mapping from ESTree nodes to TypeScript nodes and retrieving the TypeScript p This rule bans for-of looping over an enum by using the type-checker via typescript-eslint and TypeScript APIs: ```ts -import { ESLintUtils } from '@typescript-eslint/experimental-utils'; +import { ESLintUtils } from '@typescript-eslint/utils'; import * as ts from 'typescript'; import * as tsutils from 'tsutils'; @@ -268,7 +262,7 @@ export const rule: eslint.Rule.RuleModule = { ## Testing -`@typescript-eslint/experimental-utils` exports a `RuleTester` with a similar API to the built-in [ESLint `RuleTester`](https://eslint.org/docs/developer-guide/nodejs-api#ruletester). +`@typescript-eslint/utils` exports a `RuleTester` with a similar API to the built-in [ESLint `RuleTester`](https://eslint.org/docs/developer-guide/nodejs-api#ruletester). It should be provided with the same `parser` and `parserOptions` you would use in your ESLint configuration. ### Testing Untyped Rules @@ -276,7 +270,7 @@ It should be provided with the same `parser` and `parserOptions` you would use i For rules that don't need type information, passing just the `parser` will do: ```ts -import { ESLintUtils } from '@typescript-eslint/experimental-utils'; +import { ESLintUtils } from '@typescript-eslint/utils'; import rule from './my-rule'; const ruleTester = new ESLintUtils.RuleTester({ @@ -295,7 +289,7 @@ For rules that do need type information, `parserOptions` must be passed in as we Tests must have at least an absolute `tsconfigRootDir` path provided as well as a relative `project` path from that directory: ```ts -import { ESLintUtils } from '@typescript-eslint/experimental-utils'; +import { ESLintUtils } from '@typescript-eslint/utils'; import rule from './my-typed-rule'; const ruleTester = new ESLintUtils.RuleTester({ diff --git a/docs/development/architecture/PACKAGES.md b/docs/development/architecture/PACKAGES.md index 1dcff05a257..461cc021812 100644 --- a/docs/development/architecture/PACKAGES.md +++ b/docs/development/architecture/PACKAGES.md @@ -55,9 +55,9 @@ It works by: A "scope analyser" traverses an AST and builds a model of how variables (and in our case, types) are defined and consumed by the source code. This form of static analysis allows you to understand and trace variables throughout the program, allowing you to access powerful information about a program without needing to drop into the much, much heavier type information. -## `@typescript-eslint/experimental-utils` +## `@typescript-eslint/utils` -[`@typescript-eslint/experimental-utils`] contains public utilities for writing custom rules and plugins in TypeScript. +[`@typescript-eslint/utils`] contains public utilities for writing custom rules and plugins in TypeScript. Rules declared in `@typescript-eslint/eslint-plugin` are created using its utility functions. Any custom rules you write generally will be as well. @@ -71,7 +71,7 @@ Any custom rules you write generally will be as well. [`@typescript-eslint/eslint-plugin-tslint`]: https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin-tslint [`@typescript-eslint/eslint-plugin`]: https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin -[`@typescript-eslint/experimental-utils`]: https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/experimental-utils +[`@typescript-eslint/utils`]: https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/utils [`@typescript-eslint/parser`]: https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/parser [`@typescript-eslint/scope-manager`]: https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/scope-manager [`@typescript-eslint/typescript-estree`]: https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/typescript-estree diff --git a/packages/ast-spec/README.md b/packages/ast-spec/README.md index 6d29fecd24e..388241c0061 100644 --- a/packages/ast-spec/README.md +++ b/packages/ast-spec/README.md @@ -16,7 +16,7 @@ It includes: **You probably don't want to use it directly.** -If you're building an ESLint plugin, consider using [`@typescript-eslint/experimental-utils`](../experimental-utils) and [`@typescript-eslint/type-utils`](../type-utils). +If you're building an ESLint plugin, consider using [`@typescript-eslint/utils`](../utils) and [`@typescript-eslint/type-utils`](../type-utils). If you're parsing TypeScript code, consider using [`@typescript-eslint/typescript-estree`](../typescript-estree). ## Contributing diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json index 95b3dd94bef..3b9d0e8d47f 100644 --- a/packages/eslint-plugin-internal/package.json +++ b/packages/eslint-plugin-internal/package.json @@ -14,8 +14,8 @@ }, "dependencies": { "@types/prettier": "*", - "@typescript-eslint/experimental-utils": "5.9.1", "@typescript-eslint/scope-manager": "5.9.1", + "@typescript-eslint/utils": "5.9.1", "prettier": "*" } } diff --git a/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts b/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts index f91068d9ffe..456a17f7da1 100644 --- a/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts +++ b/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts @@ -1,8 +1,4 @@ -import { - ESLintUtils, - TSESLint, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { ESLintUtils, TSESLint, TSESTree } from '@typescript-eslint/utils'; import { createRule } from '../util'; /* diff --git a/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts b/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts index c8256131249..437e244b9db 100644 --- a/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts +++ b/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts @@ -1,7 +1,4 @@ -import { - TSESTree, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; import { createRule } from '../util'; /* diff --git a/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts b/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts index 3cc96a0f600..022fd98b7ca 100644 --- a/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts +++ b/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts @@ -2,7 +2,7 @@ import { createRule } from '../util'; const TSESTREE_NAME = '@typescript-eslint/typescript-estree'; const TYPES_NAME = '@typescript-eslint/types'; -const UTILS_NAME = '@typescript-eslint/experimental-utils'; +const UTILS_NAME = '@typescript-eslint/utils'; /* Typescript will not error if people use typescript-estree within eslint-plugin. diff --git a/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts b/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts index 81fcb8c41cf..8b3ec8ffdb8 100644 --- a/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts +++ b/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import { format, resolveConfig } from 'prettier'; import { createRule } from '../util'; diff --git a/packages/eslint-plugin-internal/src/rules/prefer-ast-types-enum.ts b/packages/eslint-plugin-internal/src/rules/prefer-ast-types-enum.ts index e98d0904af5..d74104e5fcf 100755 --- a/packages/eslint-plugin-internal/src/rules/prefer-ast-types-enum.ts +++ b/packages/eslint-plugin-internal/src/rules/prefer-ast-types-enum.ts @@ -2,7 +2,7 @@ import { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESTree, -} from '@typescript-eslint/experimental-utils'; +} from '@typescript-eslint/utils'; import { DefinitionType } from '@typescript-eslint/scope-manager'; import { createRule } from '../util'; diff --git a/packages/eslint-plugin-internal/src/util/createRule.ts b/packages/eslint-plugin-internal/src/util/createRule.ts index 2ac52d199fc..62f4e54b022 100644 --- a/packages/eslint-plugin-internal/src/util/createRule.ts +++ b/packages/eslint-plugin-internal/src/util/createRule.ts @@ -1,4 +1,4 @@ -import { ESLintUtils } from '@typescript-eslint/experimental-utils'; +import { ESLintUtils } from '@typescript-eslint/utils'; // note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment diff --git a/packages/eslint-plugin-internal/tests/RuleTester.ts b/packages/eslint-plugin-internal/tests/RuleTester.ts index 3b7d3afc554..260e222194b 100644 --- a/packages/eslint-plugin-internal/tests/RuleTester.ts +++ b/packages/eslint-plugin-internal/tests/RuleTester.ts @@ -1,4 +1,4 @@ -import { ESLintUtils } from '@typescript-eslint/experimental-utils'; +import { ESLintUtils } from '@typescript-eslint/utils'; import path from 'path'; function getFixturesRootDir(): string { diff --git a/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts b/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts index fe31f051a09..120c72def8c 100644 --- a/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts +++ b/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts @@ -10,9 +10,9 @@ const ruleTester = new RuleTester({ ruleTester.run('no-typescript-estree-import', rule, { valid: [ - "import { foo } from '@typescript-eslint/experimental-utils';", - "import foo from '@typescript-eslint/experimental-utils';", - "import * as foo from '@typescript-eslint/experimental-utils';", + "import { foo } from '@typescript-eslint/utils';", + "import foo from '@typescript-eslint/utils';", + "import * as foo from '@typescript-eslint/utils';", ], invalid: batchedSingleLineTests({ code: ` @@ -24,12 +24,12 @@ import foo from '@typescript-eslint/types'; import * as foo from '@typescript-eslint/types'; `, output: ` -import { foo } from '@typescript-eslint/experimental-utils'; -import foo from '@typescript-eslint/experimental-utils'; -import * as foo from '@typescript-eslint/experimental-utils'; -import { foo } from '@typescript-eslint/experimental-utils'; -import foo from '@typescript-eslint/experimental-utils'; -import * as foo from '@typescript-eslint/experimental-utils'; +import { foo } from '@typescript-eslint/utils'; +import foo from '@typescript-eslint/utils'; +import * as foo from '@typescript-eslint/utils'; +import { foo } from '@typescript-eslint/utils'; +import foo from '@typescript-eslint/utils'; +import * as foo from '@typescript-eslint/utils'; `, errors: [ { diff --git a/packages/eslint-plugin-internal/tests/rules/prefer-ast-types-enum.test.ts b/packages/eslint-plugin-internal/tests/rules/prefer-ast-types-enum.test.ts index 94f8830a04e..d418526db5f 100644 --- a/packages/eslint-plugin-internal/tests/rules/prefer-ast-types-enum.test.ts +++ b/packages/eslint-plugin-internal/tests/rules/prefer-ast-types-enum.test.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - AST_TOKEN_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils'; import { DefinitionType } from '@typescript-eslint/scope-manager'; import rule from '../../src/rules/prefer-ast-types-enum'; import { batchedSingleLineTests, RuleTester } from '../RuleTester'; diff --git a/packages/eslint-plugin-internal/tsconfig.build.json b/packages/eslint-plugin-internal/tsconfig.build.json index b40961d2d9a..744454d20b2 100644 --- a/packages/eslint-plugin-internal/tsconfig.build.json +++ b/packages/eslint-plugin-internal/tsconfig.build.json @@ -9,5 +9,5 @@ "resolveJsonModule": true }, "include": ["src", "typings"], - "references": [{ "path": "../experimental-utils/tsconfig.build.json" }] + "references": [{ "path": "../utils/tsconfig.build.json" }] } diff --git a/packages/eslint-plugin-internal/tsconfig.json b/packages/eslint-plugin-internal/tsconfig.json index 597a5eaee95..12e8b67a5a3 100644 --- a/packages/eslint-plugin-internal/tsconfig.json +++ b/packages/eslint-plugin-internal/tsconfig.json @@ -5,5 +5,5 @@ "rootDir": "." }, "include": ["src", "typings", "tests"], - "references": [{ "path": "../experimental-utils/tsconfig.build.json" }] + "references": [{ "path": "../utils/tsconfig.build.json" }] } diff --git a/packages/eslint-plugin-tslint/package.json b/packages/eslint-plugin-tslint/package.json index 9f487c75926..3ef927ab65f 100644 --- a/packages/eslint-plugin-tslint/package.json +++ b/packages/eslint-plugin-tslint/package.json @@ -38,7 +38,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/experimental-utils": "5.9.1", + "@typescript-eslint/utils": "5.9.1", "lodash": "^4.17.21" }, "peerDependencies": { diff --git a/packages/eslint-plugin-tslint/src/rules/config.ts b/packages/eslint-plugin-tslint/src/rules/config.ts index 7bf51826541..0e4b29b50cc 100644 --- a/packages/eslint-plugin-tslint/src/rules/config.ts +++ b/packages/eslint-plugin-tslint/src/rules/config.ts @@ -1,4 +1,4 @@ -import { ESLintUtils } from '@typescript-eslint/experimental-utils'; +import { ESLintUtils } from '@typescript-eslint/utils'; import memoize from 'lodash/memoize'; import { Configuration, RuleSeverity } from 'tslint'; import { CustomLinter } from '../custom-linter'; diff --git a/packages/eslint-plugin-tslint/tests/index.spec.ts b/packages/eslint-plugin-tslint/tests/index.spec.ts index ab88970867e..6c0d8cdf994 100644 --- a/packages/eslint-plugin-tslint/tests/index.spec.ts +++ b/packages/eslint-plugin-tslint/tests/index.spec.ts @@ -1,4 +1,4 @@ -import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/utils'; import * as parser from '@typescript-eslint/parser'; import { readFileSync } from 'fs'; import rule, { Options } from '../src/rules/config'; diff --git a/packages/eslint-plugin-tslint/tsconfig.build.json b/packages/eslint-plugin-tslint/tsconfig.build.json index 60cfdc79ee7..ce8f56e7294 100644 --- a/packages/eslint-plugin-tslint/tsconfig.build.json +++ b/packages/eslint-plugin-tslint/tsconfig.build.json @@ -6,5 +6,5 @@ "resolveJsonModule": true }, "include": ["src"], - "references": [{ "path": "../experimental-utils/tsconfig.build.json" }] + "references": [{ "path": "../utils/tsconfig.build.json" }] } diff --git a/packages/eslint-plugin-tslint/tsconfig.json b/packages/eslint-plugin-tslint/tsconfig.json index d4bc6ebe57d..b2f22d5b95d 100644 --- a/packages/eslint-plugin-tslint/tsconfig.json +++ b/packages/eslint-plugin-tslint/tsconfig.json @@ -6,5 +6,5 @@ }, "include": ["src", "tests"], "exclude": ["tests/test-project", "tests/test-tslint-rules-directory"], - "references": [{ "path": "../experimental-utils/tsconfig.build.json" }] + "references": [{ "path": "../utils/tsconfig.build.json" }] } diff --git a/packages/eslint-plugin/index.d.ts b/packages/eslint-plugin/index.d.ts index 8092cabcc4b..0a45db55e32 100644 --- a/packages/eslint-plugin/index.d.ts +++ b/packages/eslint-plugin/index.d.ts @@ -1,4 +1,4 @@ -import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/utils'; export const rules: Record>; export const configs: Record; diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 0aa3d4fba70..7d62b026e81 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -44,9 +44,9 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/experimental-utils": "5.9.1", "@typescript-eslint/scope-manager": "5.9.1", "@typescript-eslint/type-utils": "5.9.1", + "@typescript-eslint/utils": "5.9.1", "debug": "^4.3.2", "functional-red-black-tree": "^1.0.1", "ignore": "^5.1.8", diff --git a/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts b/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts index c0eec499ab3..ab45274e165 100644 --- a/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts +++ b/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts @@ -1,7 +1,4 @@ -import { - TSESTree, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as util from '../util'; type RuleNode = diff --git a/packages/eslint-plugin/src/rules/array-type.ts b/packages/eslint-plugin/src/rules/array-type.ts index f6e601225ce..3c0cad93ed1 100644 --- a/packages/eslint-plugin/src/rules/array-type.ts +++ b/packages/eslint-plugin/src/rules/array-type.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import * as util from '../util'; /** diff --git a/packages/eslint-plugin/src/rules/ban-ts-comment.ts b/packages/eslint-plugin/src/rules/ban-ts-comment.ts index 020b0a33a3b..96b01d8efc2 100644 --- a/packages/eslint-plugin/src/rules/ban-ts-comment.ts +++ b/packages/eslint-plugin/src/rules/ban-ts-comment.ts @@ -1,4 +1,4 @@ -import { AST_TOKEN_TYPES } from '@typescript-eslint/experimental-utils'; +import { AST_TOKEN_TYPES } from '@typescript-eslint/utils'; import * as util from '../util'; interface Options { diff --git a/packages/eslint-plugin/src/rules/ban-tslint-comment.ts b/packages/eslint-plugin/src/rules/ban-tslint-comment.ts index 14d32e72d88..99a427eead0 100644 --- a/packages/eslint-plugin/src/rules/ban-tslint-comment.ts +++ b/packages/eslint-plugin/src/rules/ban-tslint-comment.ts @@ -1,4 +1,4 @@ -import { AST_TOKEN_TYPES } from '@typescript-eslint/experimental-utils'; +import { AST_TOKEN_TYPES } from '@typescript-eslint/utils'; import * as util from '../util'; // tslint regex diff --git a/packages/eslint-plugin/src/rules/ban-types.ts b/packages/eslint-plugin/src/rules/ban-types.ts index ad0620f2185..38224b15ce9 100644 --- a/packages/eslint-plugin/src/rules/ban-types.ts +++ b/packages/eslint-plugin/src/rules/ban-types.ts @@ -1,8 +1,4 @@ -import { - TSESLint, - TSESTree, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { TSESLint, TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as util from '../util'; type Types = Record< diff --git a/packages/eslint-plugin/src/rules/brace-style.ts b/packages/eslint-plugin/src/rules/brace-style.ts index 6635303b386..5d820b4c7e6 100644 --- a/packages/eslint-plugin/src/rules/brace-style.ts +++ b/packages/eslint-plugin/src/rules/brace-style.ts @@ -1,4 +1,4 @@ -import { TSESTree } from '@typescript-eslint/experimental-utils'; +import { TSESTree } from '@typescript-eslint/utils'; import { getESLintCoreRule } from '../util/getESLintCoreRule'; import { InferOptionsTypeFromRule, diff --git a/packages/eslint-plugin/src/rules/class-literal-property-style.ts b/packages/eslint-plugin/src/rules/class-literal-property-style.ts index b3f9fb401c2..705485e0050 100644 --- a/packages/eslint-plugin/src/rules/class-literal-property-style.ts +++ b/packages/eslint-plugin/src/rules/class-literal-property-style.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import * as util from '../util'; type Options = ['fields' | 'getters']; diff --git a/packages/eslint-plugin/src/rules/comma-dangle.ts b/packages/eslint-plugin/src/rules/comma-dangle.ts index 298a3e92639..241b3527284 100644 --- a/packages/eslint-plugin/src/rules/comma-dangle.ts +++ b/packages/eslint-plugin/src/rules/comma-dangle.ts @@ -1,9 +1,6 @@ import * as util from '../util'; import { getESLintCoreRule } from '../util/getESLintCoreRule'; -import { - TSESTree, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; const baseRule = getESLintCoreRule('comma-dangle'); diff --git a/packages/eslint-plugin/src/rules/comma-spacing.ts b/packages/eslint-plugin/src/rules/comma-spacing.ts index c78322be8ea..2774324d259 100644 --- a/packages/eslint-plugin/src/rules/comma-spacing.ts +++ b/packages/eslint-plugin/src/rules/comma-spacing.ts @@ -1,7 +1,4 @@ -import { - TSESTree, - AST_TOKEN_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { TSESTree, AST_TOKEN_TYPES } from '@typescript-eslint/utils'; import { isClosingParenToken, isCommaToken, diff --git a/packages/eslint-plugin/src/rules/consistent-indexed-object-style.ts b/packages/eslint-plugin/src/rules/consistent-indexed-object-style.ts index 2c00dfd43eb..bd511d0cd0e 100644 --- a/packages/eslint-plugin/src/rules/consistent-indexed-object-style.ts +++ b/packages/eslint-plugin/src/rules/consistent-indexed-object-style.ts @@ -1,8 +1,4 @@ -import { - AST_NODE_TYPES, - TSESLint, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; import { createRule } from '../util'; type MessageIds = 'preferRecord' | 'preferIndexSignature'; diff --git a/packages/eslint-plugin/src/rules/consistent-type-assertions.ts b/packages/eslint-plugin/src/rules/consistent-type-assertions.ts index 61738179066..4a75edd7bda 100644 --- a/packages/eslint-plugin/src/rules/consistent-type-assertions.ts +++ b/packages/eslint-plugin/src/rules/consistent-type-assertions.ts @@ -1,8 +1,5 @@ import * as util from '../util'; -import { - TSESTree, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; // intentionally mirroring the options type MessageIds = diff --git a/packages/eslint-plugin/src/rules/consistent-type-definitions.ts b/packages/eslint-plugin/src/rules/consistent-type-definitions.ts index c71d812efd9..56581ef21fc 100644 --- a/packages/eslint-plugin/src/rules/consistent-type-definitions.ts +++ b/packages/eslint-plugin/src/rules/consistent-type-definitions.ts @@ -3,7 +3,7 @@ import { AST_TOKEN_TYPES, TSESLint, TSESTree, -} from '@typescript-eslint/experimental-utils'; +} from '@typescript-eslint/utils'; import * as util from '../util'; export default util.createRule({ diff --git a/packages/eslint-plugin/src/rules/consistent-type-exports.ts b/packages/eslint-plugin/src/rules/consistent-type-exports.ts index 7ad52679226..36fa561bcb3 100644 --- a/packages/eslint-plugin/src/rules/consistent-type-exports.ts +++ b/packages/eslint-plugin/src/rules/consistent-type-exports.ts @@ -3,7 +3,7 @@ import { ParserServices, AST_NODE_TYPES, TSESLint, -} from '@typescript-eslint/experimental-utils'; +} from '@typescript-eslint/utils'; import { SymbolFlags } from 'typescript'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/consistent-type-imports.ts b/packages/eslint-plugin/src/rules/consistent-type-imports.ts index 538c89c3cf3..6badf04d4dd 100644 --- a/packages/eslint-plugin/src/rules/consistent-type-imports.ts +++ b/packages/eslint-plugin/src/rules/consistent-type-imports.ts @@ -3,7 +3,7 @@ import { TSESTree, AST_TOKEN_TYPES, AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +} from '@typescript-eslint/utils'; import * as util from '../util'; type Prefer = 'type-imports' | 'no-type-imports'; diff --git a/packages/eslint-plugin/src/rules/default-param-last.ts b/packages/eslint-plugin/src/rules/default-param-last.ts index 9673d852dd1..a701e3765dd 100644 --- a/packages/eslint-plugin/src/rules/default-param-last.ts +++ b/packages/eslint-plugin/src/rules/default-param-last.ts @@ -1,8 +1,5 @@ import { createRule } from '../util'; -import { - TSESTree, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; export default createRule({ name: 'default-param-last', diff --git a/packages/eslint-plugin/src/rules/dot-notation.ts b/packages/eslint-plugin/src/rules/dot-notation.ts index 01db4680cbe..29db2f3fe1e 100644 --- a/packages/eslint-plugin/src/rules/dot-notation.ts +++ b/packages/eslint-plugin/src/rules/dot-notation.ts @@ -1,4 +1,4 @@ -import { TSESTree } from '@typescript-eslint/experimental-utils'; +import { TSESTree } from '@typescript-eslint/utils'; import * as ts from 'typescript'; import * as tsutils from 'tsutils'; import { getESLintCoreRule } from '../util/getESLintCoreRule'; diff --git a/packages/eslint-plugin/src/rules/explicit-function-return-type.ts b/packages/eslint-plugin/src/rules/explicit-function-return-type.ts index e9a27b2b1fc..233b07bbc6a 100644 --- a/packages/eslint-plugin/src/rules/explicit-function-return-type.ts +++ b/packages/eslint-plugin/src/rules/explicit-function-return-type.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import * as util from '../util'; import { checkFunctionReturnType, diff --git a/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts b/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts index 8a8446ec0af..b67221aee54 100644 --- a/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts +++ b/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts @@ -3,7 +3,7 @@ import { AST_TOKEN_TYPES, TSESLint, TSESTree, -} from '@typescript-eslint/experimental-utils'; +} from '@typescript-eslint/utils'; import * as util from '../util'; type AccessibilityLevel = diff --git a/packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts b/packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts index adaacaf363f..5bbfa7ebbea 100644 --- a/packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts +++ b/packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import { DefinitionType } from '@typescript-eslint/scope-manager'; import * as util from '../util'; import { diff --git a/packages/eslint-plugin/src/rules/func-call-spacing.ts b/packages/eslint-plugin/src/rules/func-call-spacing.ts index 254f8939660..3817fe9af41 100644 --- a/packages/eslint-plugin/src/rules/func-call-spacing.ts +++ b/packages/eslint-plugin/src/rules/func-call-spacing.ts @@ -1,4 +1,4 @@ -import { TSESTree } from '@typescript-eslint/experimental-utils'; +import { TSESTree } from '@typescript-eslint/utils'; import * as util from '../util'; export type Options = [ diff --git a/packages/eslint-plugin/src/rules/indent-new-do-not-use/BinarySearchTree.ts b/packages/eslint-plugin/src/rules/indent-new-do-not-use/BinarySearchTree.ts index 7c4b78f5b7b..8c2db5cb18b 100644 --- a/packages/eslint-plugin/src/rules/indent-new-do-not-use/BinarySearchTree.ts +++ b/packages/eslint-plugin/src/rules/indent-new-do-not-use/BinarySearchTree.ts @@ -1,7 +1,7 @@ // The following code is adapted from the the code in eslint. // License: https://github.com/eslint/eslint/blob/48700fc8408f394887cdedd071b22b757700fdcb/LICENSE -import { TSESTree } from '@typescript-eslint/experimental-utils'; +import { TSESTree } from '@typescript-eslint/utils'; import createTree from 'functional-red-black-tree'; export interface TreeValue { diff --git a/packages/eslint-plugin/src/rules/indent-new-do-not-use/OffsetStorage.ts b/packages/eslint-plugin/src/rules/indent-new-do-not-use/OffsetStorage.ts index 6feea3d95ad..a5fb8d5a448 100644 --- a/packages/eslint-plugin/src/rules/indent-new-do-not-use/OffsetStorage.ts +++ b/packages/eslint-plugin/src/rules/indent-new-do-not-use/OffsetStorage.ts @@ -1,7 +1,7 @@ // The following code is adapted from the the code in eslint. // License: https://github.com/eslint/eslint/blob/48700fc8408f394887cdedd071b22b757700fdcb/LICENSE -import { TSESTree } from '@typescript-eslint/experimental-utils'; +import { TSESTree } from '@typescript-eslint/utils'; import { BinarySearchTree, TreeValue } from './BinarySearchTree'; import { TokenInfo } from './TokenInfo'; diff --git a/packages/eslint-plugin/src/rules/indent-new-do-not-use/TokenInfo.ts b/packages/eslint-plugin/src/rules/indent-new-do-not-use/TokenInfo.ts index 7dd27346560..831852d5e66 100644 --- a/packages/eslint-plugin/src/rules/indent-new-do-not-use/TokenInfo.ts +++ b/packages/eslint-plugin/src/rules/indent-new-do-not-use/TokenInfo.ts @@ -1,7 +1,7 @@ // The following code is adapted from the the code in eslint. // License: https://github.com/eslint/eslint/blob/48700fc8408f394887cdedd071b22b757700fdcb/LICENSE -import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; +import { TSESLint, TSESTree } from '@typescript-eslint/utils'; /** * A helper class to get token-based info related to indentation diff --git a/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts b/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts index 58da2c044e1..fa7013b9837 100644 --- a/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts +++ b/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts @@ -7,7 +7,7 @@ import { AST_TOKEN_TYPES, TSESLint, TSESTree, -} from '@typescript-eslint/experimental-utils'; +} from '@typescript-eslint/utils'; import { OffsetStorage } from './OffsetStorage'; import { TokenInfo } from './TokenInfo'; diff --git a/packages/eslint-plugin/src/rules/indent.ts b/packages/eslint-plugin/src/rules/indent.ts index e057ca9886b..748d720f451 100644 --- a/packages/eslint-plugin/src/rules/indent.ts +++ b/packages/eslint-plugin/src/rules/indent.ts @@ -5,10 +5,7 @@ */ /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment */ -import { - TSESTree, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; import { getESLintCoreRule } from '../util/getESLintCoreRule'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/init-declarations.ts b/packages/eslint-plugin/src/rules/init-declarations.ts index 6cd83e636f9..611687b0e9f 100644 --- a/packages/eslint-plugin/src/rules/init-declarations.ts +++ b/packages/eslint-plugin/src/rules/init-declarations.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import { getESLintCoreRule } from '../util/getESLintCoreRule'; import { createRule, diff --git a/packages/eslint-plugin/src/rules/keyword-spacing.ts b/packages/eslint-plugin/src/rules/keyword-spacing.ts index a5620fb7d53..e314ec9de0f 100644 --- a/packages/eslint-plugin/src/rules/keyword-spacing.ts +++ b/packages/eslint-plugin/src/rules/keyword-spacing.ts @@ -1,4 +1,4 @@ -import { AST_TOKEN_TYPES } from '@typescript-eslint/experimental-utils'; +import { AST_TOKEN_TYPES } from '@typescript-eslint/utils'; import { getESLintCoreRule } from '../util/getESLintCoreRule'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/lines-between-class-members.ts b/packages/eslint-plugin/src/rules/lines-between-class-members.ts index c78216b125f..4446568e874 100644 --- a/packages/eslint-plugin/src/rules/lines-between-class-members.ts +++ b/packages/eslint-plugin/src/rules/lines-between-class-members.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import { getESLintCoreRule } from '../util/getESLintCoreRule'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/member-delimiter-style.ts b/packages/eslint-plugin/src/rules/member-delimiter-style.ts index 5fa5a863a6f..e35b6459de8 100644 --- a/packages/eslint-plugin/src/rules/member-delimiter-style.ts +++ b/packages/eslint-plugin/src/rules/member-delimiter-style.ts @@ -1,8 +1,4 @@ -import { - TSESLint, - TSESTree, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { TSESLint, TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as util from '../util'; type Delimiter = 'comma' | 'none' | 'semi'; diff --git a/packages/eslint-plugin/src/rules/member-ordering.ts b/packages/eslint-plugin/src/rules/member-ordering.ts index baaf32aa355..ce2edabe058 100644 --- a/packages/eslint-plugin/src/rules/member-ordering.ts +++ b/packages/eslint-plugin/src/rules/member-ordering.ts @@ -3,7 +3,7 @@ import { TSESLint, TSESTree, JSONSchema, -} from '@typescript-eslint/experimental-utils'; +} from '@typescript-eslint/utils'; import * as util from '../util'; export type MessageIds = 'incorrectGroupOrder' | 'incorrectOrder'; diff --git a/packages/eslint-plugin/src/rules/method-signature-style.ts b/packages/eslint-plugin/src/rules/method-signature-style.ts index b05c4f9fbd1..d9dfbdac4bd 100644 --- a/packages/eslint-plugin/src/rules/method-signature-style.ts +++ b/packages/eslint-plugin/src/rules/method-signature-style.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import * as util from '../util'; export type Options = [('property' | 'method')?]; diff --git a/packages/eslint-plugin/src/rules/naming-convention-utils/schema.ts b/packages/eslint-plugin/src/rules/naming-convention-utils/schema.ts index 4d16617f122..4136f7186bf 100644 --- a/packages/eslint-plugin/src/rules/naming-convention-utils/schema.ts +++ b/packages/eslint-plugin/src/rules/naming-convention-utils/schema.ts @@ -1,4 +1,4 @@ -import { JSONSchema } from '@typescript-eslint/experimental-utils'; +import { JSONSchema } from '@typescript-eslint/utils'; import { IndividualAndMetaSelectorsString, MetaSelectors, diff --git a/packages/eslint-plugin/src/rules/naming-convention-utils/types.ts b/packages/eslint-plugin/src/rules/naming-convention-utils/types.ts index 9cff76129db..9a45bc0aeef 100644 --- a/packages/eslint-plugin/src/rules/naming-convention-utils/types.ts +++ b/packages/eslint-plugin/src/rules/naming-convention-utils/types.ts @@ -1,4 +1,4 @@ -import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; +import { TSESLint, TSESTree } from '@typescript-eslint/utils'; import { IndividualAndMetaSelectorsString, MetaSelectors, diff --git a/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts b/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts index 374302f7f12..8e8c8711a59 100644 --- a/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts +++ b/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts @@ -1,7 +1,4 @@ -import { - TSESTree, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as ts from 'typescript'; import { MetaSelectors, diff --git a/packages/eslint-plugin/src/rules/naming-convention.ts b/packages/eslint-plugin/src/rules/naming-convention.ts index db4463edd98..cc2fa807687 100644 --- a/packages/eslint-plugin/src/rules/naming-convention.ts +++ b/packages/eslint-plugin/src/rules/naming-convention.ts @@ -1,8 +1,4 @@ -import { - AST_NODE_TYPES, - TSESLint, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; import { PatternVisitor } from '@typescript-eslint/scope-manager'; import type { ScriptTarget } from 'typescript'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-array-constructor.ts b/packages/eslint-plugin/src/rules/no-array-constructor.ts index c0eac4a75af..dfa7656d19b 100644 --- a/packages/eslint-plugin/src/rules/no-array-constructor.ts +++ b/packages/eslint-plugin/src/rules/no-array-constructor.ts @@ -1,7 +1,4 @@ -import { - TSESTree, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as util from '../util'; export default util.createRule({ diff --git a/packages/eslint-plugin/src/rules/no-base-to-string.ts b/packages/eslint-plugin/src/rules/no-base-to-string.ts index 644bb88152a..09c4d8376f1 100644 --- a/packages/eslint-plugin/src/rules/no-base-to-string.ts +++ b/packages/eslint-plugin/src/rules/no-base-to-string.ts @@ -1,7 +1,4 @@ -import { - TSESTree, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as ts from 'typescript'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-confusing-non-null-assertion.ts b/packages/eslint-plugin/src/rules/no-confusing-non-null-assertion.ts index 1535a643397..5538781598a 100644 --- a/packages/eslint-plugin/src/rules/no-confusing-non-null-assertion.ts +++ b/packages/eslint-plugin/src/rules/no-confusing-non-null-assertion.ts @@ -3,7 +3,7 @@ import { AST_TOKEN_TYPES, TSESLint, TSESTree, -} from '@typescript-eslint/experimental-utils'; +} from '@typescript-eslint/utils'; import * as util from '../util'; export default util.createRule({ diff --git a/packages/eslint-plugin/src/rules/no-confusing-void-expression.ts b/packages/eslint-plugin/src/rules/no-confusing-void-expression.ts index 696c3d7af2d..0fed18413bd 100644 --- a/packages/eslint-plugin/src/rules/no-confusing-void-expression.ts +++ b/packages/eslint-plugin/src/rules/no-confusing-void-expression.ts @@ -1,8 +1,4 @@ -import { - AST_NODE_TYPES, - TSESLint, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; import * as ts from 'typescript'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-dupe-class-members.ts b/packages/eslint-plugin/src/rules/no-dupe-class-members.ts index e9cb151d6d6..843a7411895 100644 --- a/packages/eslint-plugin/src/rules/no-dupe-class-members.ts +++ b/packages/eslint-plugin/src/rules/no-dupe-class-members.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import { getESLintCoreRule } from '../util/getESLintCoreRule'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-duplicate-imports.ts b/packages/eslint-plugin/src/rules/no-duplicate-imports.ts index f270e7600d1..9a3ef4395e2 100644 --- a/packages/eslint-plugin/src/rules/no-duplicate-imports.ts +++ b/packages/eslint-plugin/src/rules/no-duplicate-imports.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import { getESLintCoreRule } from '../util/getESLintCoreRule'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-dynamic-delete.ts b/packages/eslint-plugin/src/rules/no-dynamic-delete.ts index 716590c66b6..8824095ab74 100644 --- a/packages/eslint-plugin/src/rules/no-dynamic-delete.ts +++ b/packages/eslint-plugin/src/rules/no-dynamic-delete.ts @@ -1,8 +1,4 @@ -import { - TSESTree, - AST_NODE_TYPES, - TSESLint, -} from '@typescript-eslint/experimental-utils'; +import { TSESTree, AST_NODE_TYPES, TSESLint } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-empty-function.ts b/packages/eslint-plugin/src/rules/no-empty-function.ts index 51ec13e3ff0..806312b2117 100644 --- a/packages/eslint-plugin/src/rules/no-empty-function.ts +++ b/packages/eslint-plugin/src/rules/no-empty-function.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import { getESLintCoreRule } from '../util/getESLintCoreRule'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-empty-interface.ts b/packages/eslint-plugin/src/rules/no-empty-interface.ts index ee472e70390..e8985919091 100644 --- a/packages/eslint-plugin/src/rules/no-empty-interface.ts +++ b/packages/eslint-plugin/src/rules/no-empty-interface.ts @@ -1,5 +1,5 @@ import * as util from '../util'; -import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/utils'; type Options = [ { diff --git a/packages/eslint-plugin/src/rules/no-explicit-any.ts b/packages/eslint-plugin/src/rules/no-explicit-any.ts index a41d443e924..8617ab0bdbe 100644 --- a/packages/eslint-plugin/src/rules/no-explicit-any.ts +++ b/packages/eslint-plugin/src/rules/no-explicit-any.ts @@ -1,8 +1,4 @@ -import { - AST_NODE_TYPES, - TSESLint, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; import * as util from '../util'; export type Options = [ diff --git a/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts b/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts index 1ea8970da2f..6ffe529700a 100644 --- a/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts +++ b/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts @@ -1,4 +1,4 @@ -import { TSESTree } from '@typescript-eslint/experimental-utils'; +import { TSESTree } from '@typescript-eslint/utils'; import * as util from '../util'; export default util.createRule({ diff --git a/packages/eslint-plugin/src/rules/no-extra-parens.ts b/packages/eslint-plugin/src/rules/no-extra-parens.ts index 743c22596c1..24659aedfe4 100644 --- a/packages/eslint-plugin/src/rules/no-extra-parens.ts +++ b/packages/eslint-plugin/src/rules/no-extra-parens.ts @@ -1,11 +1,7 @@ // any is required to work around manipulating the AST in weird ways /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment */ -import { - AST_NODE_TYPES, - TSESTree, - TSESLint, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree, TSESLint } from '@typescript-eslint/utils'; import { getESLintCoreRule } from '../util/getESLintCoreRule'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-extraneous-class.ts b/packages/eslint-plugin/src/rules/no-extraneous-class.ts index 2686ab0f478..aa2184c9b16 100644 --- a/packages/eslint-plugin/src/rules/no-extraneous-class.ts +++ b/packages/eslint-plugin/src/rules/no-extraneous-class.ts @@ -1,7 +1,4 @@ -import { - TSESTree, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as util from '../util'; type Options = [ diff --git a/packages/eslint-plugin/src/rules/no-floating-promises.ts b/packages/eslint-plugin/src/rules/no-floating-promises.ts index edd26225323..cdea51721e8 100644 --- a/packages/eslint-plugin/src/rules/no-floating-promises.ts +++ b/packages/eslint-plugin/src/rules/no-floating-promises.ts @@ -1,10 +1,6 @@ import * as tsutils from 'tsutils'; import * as ts from 'typescript'; -import { - TSESLint, - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { TSESLint, AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-implicit-any-catch.ts b/packages/eslint-plugin/src/rules/no-implicit-any-catch.ts index aa050794c4a..b48d68fde45 100644 --- a/packages/eslint-plugin/src/rules/no-implicit-any-catch.ts +++ b/packages/eslint-plugin/src/rules/no-implicit-any-catch.ts @@ -1,8 +1,5 @@ import * as util from '../util'; -import { - TSESLint, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { TSESLint, AST_NODE_TYPES } from '@typescript-eslint/utils'; export type Options = [ { diff --git a/packages/eslint-plugin/src/rules/no-implied-eval.ts b/packages/eslint-plugin/src/rules/no-implied-eval.ts index f11a7f8d7b3..54938b9fd49 100644 --- a/packages/eslint-plugin/src/rules/no-implied-eval.ts +++ b/packages/eslint-plugin/src/rules/no-implied-eval.ts @@ -1,8 +1,5 @@ import * as ts from 'typescript'; -import { - TSESTree, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-inferrable-types.ts b/packages/eslint-plugin/src/rules/no-inferrable-types.ts index 9c8a1a14c20..dc3216f4f60 100644 --- a/packages/eslint-plugin/src/rules/no-inferrable-types.ts +++ b/packages/eslint-plugin/src/rules/no-inferrable-types.ts @@ -1,8 +1,5 @@ /* eslint-disable @typescript-eslint/internal/prefer-ast-types-enum */ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import * as util from '../util'; type Options = [ diff --git a/packages/eslint-plugin/src/rules/no-invalid-this.ts b/packages/eslint-plugin/src/rules/no-invalid-this.ts index 1cd1be027b9..5884cc61dfa 100644 --- a/packages/eslint-plugin/src/rules/no-invalid-this.ts +++ b/packages/eslint-plugin/src/rules/no-invalid-this.ts @@ -1,7 +1,4 @@ -import { - TSESTree, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; import { getESLintCoreRule } from '../util/getESLintCoreRule'; import { InferOptionsTypeFromRule, diff --git a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts index dceffa6d893..cd28cfa16da 100644 --- a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts +++ b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import * as util from '../util'; interface Options { diff --git a/packages/eslint-plugin/src/rules/no-loop-func.ts b/packages/eslint-plugin/src/rules/no-loop-func.ts index 4496dea91fc..7d4a238f5f4 100644 --- a/packages/eslint-plugin/src/rules/no-loop-func.ts +++ b/packages/eslint-plugin/src/rules/no-loop-func.ts @@ -1,8 +1,4 @@ -import { - AST_NODE_TYPES, - TSESLint, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; import { getESLintCoreRule } from '../util/getESLintCoreRule'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-loss-of-precision.ts b/packages/eslint-plugin/src/rules/no-loss-of-precision.ts index d095def03cc..2e02b187836 100644 --- a/packages/eslint-plugin/src/rules/no-loss-of-precision.ts +++ b/packages/eslint-plugin/src/rules/no-loss-of-precision.ts @@ -1,4 +1,4 @@ -import { TSESTree } from '@typescript-eslint/experimental-utils'; +import { TSESTree } from '@typescript-eslint/utils'; import * as util from '../util'; import { maybeGetESLintCoreRule } from '../util/getESLintCoreRule'; diff --git a/packages/eslint-plugin/src/rules/no-magic-numbers.ts b/packages/eslint-plugin/src/rules/no-magic-numbers.ts index d989ac0eec1..772eaf49ea1 100644 --- a/packages/eslint-plugin/src/rules/no-magic-numbers.ts +++ b/packages/eslint-plugin/src/rules/no-magic-numbers.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import * as util from '../util'; import { getESLintCoreRule } from '../util/getESLintCoreRule'; diff --git a/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts b/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts index 28cc7b6b051..a1dd8768130 100644 --- a/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts +++ b/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts @@ -1,8 +1,4 @@ -import { - ESLintUtils, - TSESLint, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { ESLintUtils, TSESLint, TSESTree } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; import * as util from '../util'; import * as ts from 'typescript'; diff --git a/packages/eslint-plugin/src/rules/no-misused-new.ts b/packages/eslint-plugin/src/rules/no-misused-new.ts index ae79c28a6f2..da5f034c965 100644 --- a/packages/eslint-plugin/src/rules/no-misused-new.ts +++ b/packages/eslint-plugin/src/rules/no-misused-new.ts @@ -1,7 +1,4 @@ -import { - TSESTree, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as util from '../util'; export default util.createRule({ diff --git a/packages/eslint-plugin/src/rules/no-misused-promises.ts b/packages/eslint-plugin/src/rules/no-misused-promises.ts index 353b7d4a803..6e42e547436 100644 --- a/packages/eslint-plugin/src/rules/no-misused-promises.ts +++ b/packages/eslint-plugin/src/rules/no-misused-promises.ts @@ -1,8 +1,4 @@ -import { - AST_NODE_TYPES, - TSESLint, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; import * as ts from 'typescript'; diff --git a/packages/eslint-plugin/src/rules/no-namespace.ts b/packages/eslint-plugin/src/rules/no-namespace.ts index f7fb0ea1e32..c8c3ff21395 100644 --- a/packages/eslint-plugin/src/rules/no-namespace.ts +++ b/packages/eslint-plugin/src/rules/no-namespace.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import * as util from '../util'; type Options = [ diff --git a/packages/eslint-plugin/src/rules/no-non-null-asserted-nullish-coalescing.ts b/packages/eslint-plugin/src/rules/no-non-null-asserted-nullish-coalescing.ts index 93431950c35..db8b1cf860c 100644 --- a/packages/eslint-plugin/src/rules/no-non-null-asserted-nullish-coalescing.ts +++ b/packages/eslint-plugin/src/rules/no-non-null-asserted-nullish-coalescing.ts @@ -1,8 +1,4 @@ -import { - ASTUtils, - TSESTree, - TSESLint, -} from '@typescript-eslint/experimental-utils'; +import { ASTUtils, TSESTree, TSESLint } from '@typescript-eslint/utils'; import { Definition, DefinitionType } from '@typescript-eslint/scope-manager'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-non-null-asserted-optional-chain.ts b/packages/eslint-plugin/src/rules/no-non-null-asserted-optional-chain.ts index 9fdba130b97..979b0af394c 100644 --- a/packages/eslint-plugin/src/rules/no-non-null-asserted-optional-chain.ts +++ b/packages/eslint-plugin/src/rules/no-non-null-asserted-optional-chain.ts @@ -1,8 +1,4 @@ -import { - TSESTree, - TSESLint, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { TSESTree, TSESLint, AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as ts from 'typescript'; import * as semver from 'semver'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-non-null-assertion.ts b/packages/eslint-plugin/src/rules/no-non-null-assertion.ts index cd9f0dbb255..29697399931 100644 --- a/packages/eslint-plugin/src/rules/no-non-null-assertion.ts +++ b/packages/eslint-plugin/src/rules/no-non-null-assertion.ts @@ -1,7 +1,4 @@ -import { - TSESLint, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { TSESLint, AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as util from '../util'; type MessageIds = 'noNonNull' | 'suggestOptionalChain'; diff --git a/packages/eslint-plugin/src/rules/no-parameter-properties.ts b/packages/eslint-plugin/src/rules/no-parameter-properties.ts index 613b839bbdf..3ab01614e72 100644 --- a/packages/eslint-plugin/src/rules/no-parameter-properties.ts +++ b/packages/eslint-plugin/src/rules/no-parameter-properties.ts @@ -1,7 +1,4 @@ -import { - TSESTree, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as util from '../util'; type Modifier = diff --git a/packages/eslint-plugin/src/rules/no-redeclare.ts b/packages/eslint-plugin/src/rules/no-redeclare.ts index 914dd074d33..d81c5225d08 100644 --- a/packages/eslint-plugin/src/rules/no-redeclare.ts +++ b/packages/eslint-plugin/src/rules/no-redeclare.ts @@ -1,8 +1,4 @@ -import { - TSESTree, - TSESLint, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { TSESTree, TSESLint, AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as util from '../util'; type MessageIds = 'redeclared' | 'redeclaredAsBuiltin' | 'redeclaredBySyntax'; diff --git a/packages/eslint-plugin/src/rules/no-require-imports.ts b/packages/eslint-plugin/src/rules/no-require-imports.ts index 49bd5f237b0..3ef5ecc0df3 100644 --- a/packages/eslint-plugin/src/rules/no-require-imports.ts +++ b/packages/eslint-plugin/src/rules/no-require-imports.ts @@ -1,4 +1,4 @@ -import { ASTUtils, TSESTree } from '@typescript-eslint/experimental-utils'; +import { ASTUtils, TSESTree } from '@typescript-eslint/utils'; import * as util from '../util'; export default util.createRule({ diff --git a/packages/eslint-plugin/src/rules/no-restricted-imports.ts b/packages/eslint-plugin/src/rules/no-restricted-imports.ts index 2429795240e..ff2f8d77b4e 100644 --- a/packages/eslint-plugin/src/rules/no-restricted-imports.ts +++ b/packages/eslint-plugin/src/rules/no-restricted-imports.ts @@ -1,4 +1,4 @@ -import { TSESTree } from '@typescript-eslint/experimental-utils'; +import { TSESTree } from '@typescript-eslint/utils'; import type { ArrayOfStringOrObject, ArrayOfStringOrObjectPatterns, diff --git a/packages/eslint-plugin/src/rules/no-shadow.ts b/packages/eslint-plugin/src/rules/no-shadow.ts index 68214ddd338..3f13f587de1 100644 --- a/packages/eslint-plugin/src/rules/no-shadow.ts +++ b/packages/eslint-plugin/src/rules/no-shadow.ts @@ -3,7 +3,7 @@ import { AST_NODE_TYPES, TSESLint, TSESTree, -} from '@typescript-eslint/experimental-utils'; +} from '@typescript-eslint/utils'; import { Definition, DefinitionType, diff --git a/packages/eslint-plugin/src/rules/no-this-alias.ts b/packages/eslint-plugin/src/rules/no-this-alias.ts index 82ab9b22b0f..5c9c9f56881 100644 --- a/packages/eslint-plugin/src/rules/no-this-alias.ts +++ b/packages/eslint-plugin/src/rules/no-this-alias.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import * as util from '../util'; type Options = [ diff --git a/packages/eslint-plugin/src/rules/no-throw-literal.ts b/packages/eslint-plugin/src/rules/no-throw-literal.ts index 152e9348378..f248ef9cb8d 100644 --- a/packages/eslint-plugin/src/rules/no-throw-literal.ts +++ b/packages/eslint-plugin/src/rules/no-throw-literal.ts @@ -1,9 +1,6 @@ import * as ts from 'typescript'; import * as util from '../util'; -import { - TSESTree, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; type MessageIds = 'object' | 'undef'; diff --git a/packages/eslint-plugin/src/rules/no-type-alias.ts b/packages/eslint-plugin/src/rules/no-type-alias.ts index 347e36f0a42..2d9847eb309 100644 --- a/packages/eslint-plugin/src/rules/no-type-alias.ts +++ b/packages/eslint-plugin/src/rules/no-type-alias.ts @@ -2,7 +2,7 @@ import { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESTree, -} from '@typescript-eslint/experimental-utils'; +} from '@typescript-eslint/utils'; import * as util from '../util'; type Values = diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts b/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts index 4474713b3ff..e3768b28aa0 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; import * as ts from 'typescript'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts index 48a3a4d039d..4e18a9f631e 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts @@ -2,7 +2,7 @@ import { TSESTree, AST_NODE_TYPES, AST_TOKEN_TYPES, -} from '@typescript-eslint/experimental-utils'; +} from '@typescript-eslint/utils'; import * as ts from 'typescript'; import { unionTypeParts, diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts b/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts index 1f4652085bd..dae21746efc 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import * as ts from 'typescript'; import * as tsutils from 'tsutils'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts index 9f7d718c2d9..67244961bca 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts @@ -1,4 +1,4 @@ -import { TSESTree } from '@typescript-eslint/experimental-utils'; +import { TSESTree } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; import * as ts from 'typescript'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts index cd5bce1845d..38c9b267ac8 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts @@ -1,7 +1,4 @@ -import { - TSESTree, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; import { isObjectType, isObjectFlagSet, diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts index 68895c01e71..c3d8e6fbb39 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import * as semver from 'semver'; import * as ts from 'typescript'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-unsafe-argument.ts b/packages/eslint-plugin/src/rules/no-unsafe-argument.ts index 3df1e6a486c..ff823638a94 100644 --- a/packages/eslint-plugin/src/rules/no-unsafe-argument.ts +++ b/packages/eslint-plugin/src/rules/no-unsafe-argument.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import * as ts from 'typescript'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-unsafe-assignment.ts b/packages/eslint-plugin/src/rules/no-unsafe-assignment.ts index cb4b8e7c636..d40c06f624b 100644 --- a/packages/eslint-plugin/src/rules/no-unsafe-assignment.ts +++ b/packages/eslint-plugin/src/rules/no-unsafe-assignment.ts @@ -1,7 +1,4 @@ -import { - TSESTree, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; import * as ts from 'typescript'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-unsafe-call.ts b/packages/eslint-plugin/src/rules/no-unsafe-call.ts index 781908f9497..d062aa28cad 100644 --- a/packages/eslint-plugin/src/rules/no-unsafe-call.ts +++ b/packages/eslint-plugin/src/rules/no-unsafe-call.ts @@ -1,4 +1,4 @@ -import { TSESTree } from '@typescript-eslint/experimental-utils'; +import { TSESTree } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; import * as util from '../util'; import { getThisExpression } from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts b/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts index 6e9555a5a3e..4a930890d88 100644 --- a/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts +++ b/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts @@ -1,7 +1,4 @@ -import { - TSESTree, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; import * as util from '../util'; import { getThisExpression } from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-unsafe-return.ts b/packages/eslint-plugin/src/rules/no-unsafe-return.ts index e226d526bca..8e9e4099cad 100644 --- a/packages/eslint-plugin/src/rules/no-unsafe-return.ts +++ b/packages/eslint-plugin/src/rules/no-unsafe-return.ts @@ -1,7 +1,4 @@ -import { - TSESTree, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; import * as util from '../util'; import { getThisExpression } from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-unused-expressions.ts b/packages/eslint-plugin/src/rules/no-unused-expressions.ts index 91d9f4e4a38..56eb1521a0d 100644 --- a/packages/eslint-plugin/src/rules/no-unused-expressions.ts +++ b/packages/eslint-plugin/src/rules/no-unused-expressions.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import { getESLintCoreRule } from '../util/getESLintCoreRule'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-unused-vars.ts b/packages/eslint-plugin/src/rules/no-unused-vars.ts index 7cce473557c..139089a7448 100644 --- a/packages/eslint-plugin/src/rules/no-unused-vars.ts +++ b/packages/eslint-plugin/src/rules/no-unused-vars.ts @@ -1,8 +1,4 @@ -import { - AST_NODE_TYPES, - TSESLint, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; import { PatternVisitor } from '@typescript-eslint/scope-manager'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-use-before-define.ts b/packages/eslint-plugin/src/rules/no-use-before-define.ts index 83cf552fda5..3a5b51938b7 100644 --- a/packages/eslint-plugin/src/rules/no-use-before-define.ts +++ b/packages/eslint-plugin/src/rules/no-use-before-define.ts @@ -1,8 +1,4 @@ -import { - AST_NODE_TYPES, - TSESLint, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; import { DefinitionType } from '@typescript-eslint/scope-manager'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-useless-constructor.ts b/packages/eslint-plugin/src/rules/no-useless-constructor.ts index f656af26481..0bbe2f6f64c 100644 --- a/packages/eslint-plugin/src/rules/no-useless-constructor.ts +++ b/packages/eslint-plugin/src/rules/no-useless-constructor.ts @@ -1,7 +1,4 @@ -import { - TSESTree, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; import { getESLintCoreRule } from '../util/getESLintCoreRule'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-var-requires.ts b/packages/eslint-plugin/src/rules/no-var-requires.ts index 1bf51efe810..36f0e7515d1 100644 --- a/packages/eslint-plugin/src/rules/no-var-requires.ts +++ b/packages/eslint-plugin/src/rules/no-var-requires.ts @@ -1,8 +1,4 @@ -import { - ASTUtils, - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { ASTUtils, AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import * as util from '../util'; type Options = []; diff --git a/packages/eslint-plugin/src/rules/non-nullable-type-assertion-style.ts b/packages/eslint-plugin/src/rules/non-nullable-type-assertion-style.ts index 1577c3b9448..69fc21736de 100644 --- a/packages/eslint-plugin/src/rules/non-nullable-type-assertion-style.ts +++ b/packages/eslint-plugin/src/rules/non-nullable-type-assertion-style.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; import * as ts from 'typescript'; diff --git a/packages/eslint-plugin/src/rules/object-curly-spacing.ts b/packages/eslint-plugin/src/rules/object-curly-spacing.ts index fe74c8f7da4..c64ca54ba17 100644 --- a/packages/eslint-plugin/src/rules/object-curly-spacing.ts +++ b/packages/eslint-plugin/src/rules/object-curly-spacing.ts @@ -2,7 +2,7 @@ import { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESTree, -} from '@typescript-eslint/experimental-utils'; +} from '@typescript-eslint/utils'; import { getESLintCoreRule } from '../util/getESLintCoreRule'; import { createRule, diff --git a/packages/eslint-plugin/src/rules/padding-line-between-statements.ts b/packages/eslint-plugin/src/rules/padding-line-between-statements.ts index aab53cbba4a..bc5f30aa751 100644 --- a/packages/eslint-plugin/src/rules/padding-line-between-statements.ts +++ b/packages/eslint-plugin/src/rules/padding-line-between-statements.ts @@ -1,8 +1,4 @@ -import { - AST_NODE_TYPES, - TSESLint, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; import * as util from '../util'; /** diff --git a/packages/eslint-plugin/src/rules/prefer-as-const.ts b/packages/eslint-plugin/src/rules/prefer-as-const.ts index 93bcce50889..09bd8423c22 100644 --- a/packages/eslint-plugin/src/rules/prefer-as-const.ts +++ b/packages/eslint-plugin/src/rules/prefer-as-const.ts @@ -1,8 +1,4 @@ -import { - AST_NODE_TYPES, - TSESLint, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; import * as util from '../util'; export default util.createRule({ diff --git a/packages/eslint-plugin/src/rules/prefer-enum-initializers.ts b/packages/eslint-plugin/src/rules/prefer-enum-initializers.ts index 5ad6dccd7cc..c6247abd739 100644 --- a/packages/eslint-plugin/src/rules/prefer-enum-initializers.ts +++ b/packages/eslint-plugin/src/rules/prefer-enum-initializers.ts @@ -1,4 +1,4 @@ -import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; +import { TSESLint, TSESTree } from '@typescript-eslint/utils'; import * as util from '../util'; type MessageIds = 'defineInitializer' | 'defineInitializerSuggestion'; diff --git a/packages/eslint-plugin/src/rules/prefer-for-of.ts b/packages/eslint-plugin/src/rules/prefer-for-of.ts index 453d126c813..3355fda2ec6 100644 --- a/packages/eslint-plugin/src/rules/prefer-for-of.ts +++ b/packages/eslint-plugin/src/rules/prefer-for-of.ts @@ -1,8 +1,4 @@ -import { - AST_NODE_TYPES, - TSESLint, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; import * as util from '../util'; export default util.createRule({ diff --git a/packages/eslint-plugin/src/rules/prefer-function-type.ts b/packages/eslint-plugin/src/rules/prefer-function-type.ts index ceeafcd841c..d13d187276e 100644 --- a/packages/eslint-plugin/src/rules/prefer-function-type.ts +++ b/packages/eslint-plugin/src/rules/prefer-function-type.ts @@ -3,7 +3,7 @@ import { AST_TOKEN_TYPES, TSESLint, TSESTree, -} from '@typescript-eslint/experimental-utils'; +} from '@typescript-eslint/utils'; import * as util from '../util'; export const phrases = { diff --git a/packages/eslint-plugin/src/rules/prefer-includes.ts b/packages/eslint-plugin/src/rules/prefer-includes.ts index f15a756abc4..0e12b4ca259 100644 --- a/packages/eslint-plugin/src/rules/prefer-includes.ts +++ b/packages/eslint-plugin/src/rules/prefer-includes.ts @@ -1,8 +1,4 @@ -import { - AST_NODE_TYPES, - TSESLint, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; import { AST as RegExpAST, parseRegExpLiteral } from 'regexpp'; import * as ts from 'typescript'; import { diff --git a/packages/eslint-plugin/src/rules/prefer-literal-enum-member.ts b/packages/eslint-plugin/src/rules/prefer-literal-enum-member.ts index 8f10eb9be36..f64482a06f5 100644 --- a/packages/eslint-plugin/src/rules/prefer-literal-enum-member.ts +++ b/packages/eslint-plugin/src/rules/prefer-literal-enum-member.ts @@ -1,4 +1,4 @@ -import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import { createRule } from '../util'; export default createRule({ diff --git a/packages/eslint-plugin/src/rules/prefer-namespace-keyword.ts b/packages/eslint-plugin/src/rules/prefer-namespace-keyword.ts index 4af7c981253..769a0cd6e39 100644 --- a/packages/eslint-plugin/src/rules/prefer-namespace-keyword.ts +++ b/packages/eslint-plugin/src/rules/prefer-namespace-keyword.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - AST_TOKEN_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils'; import * as util from '../util'; export default util.createRule({ diff --git a/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts b/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts index 6975576edca..b492287d4bb 100644 --- a/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts +++ b/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts @@ -3,7 +3,7 @@ import { AST_TOKEN_TYPES, TSESLint, TSESTree, -} from '@typescript-eslint/experimental-utils'; +} from '@typescript-eslint/utils'; import * as util from '../util'; export type Options = [ diff --git a/packages/eslint-plugin/src/rules/prefer-optional-chain.ts b/packages/eslint-plugin/src/rules/prefer-optional-chain.ts index 84c2e15e397..109deaa6d60 100644 --- a/packages/eslint-plugin/src/rules/prefer-optional-chain.ts +++ b/packages/eslint-plugin/src/rules/prefer-optional-chain.ts @@ -1,8 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, - TSESLint, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree, TSESLint } from '@typescript-eslint/utils'; import * as util from '../util'; type ValidChainTarget = diff --git a/packages/eslint-plugin/src/rules/prefer-readonly-parameter-types.ts b/packages/eslint-plugin/src/rules/prefer-readonly-parameter-types.ts index ed3e4ba284b..23e2752a7af 100644 --- a/packages/eslint-plugin/src/rules/prefer-readonly-parameter-types.ts +++ b/packages/eslint-plugin/src/rules/prefer-readonly-parameter-types.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import * as util from '../util'; type Options = [ diff --git a/packages/eslint-plugin/src/rules/prefer-readonly.ts b/packages/eslint-plugin/src/rules/prefer-readonly.ts index 7b0fbfee3af..19597264bbc 100644 --- a/packages/eslint-plugin/src/rules/prefer-readonly.ts +++ b/packages/eslint-plugin/src/rules/prefer-readonly.ts @@ -2,11 +2,7 @@ import * as tsutils from 'tsutils'; import * as ts from 'typescript'; import * as util from '../util'; import { typeIsOrHasBaseType } from '../util'; -import { - ASTUtils, - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { ASTUtils, AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; type MessageIds = 'preferReadonly'; type Options = [ diff --git a/packages/eslint-plugin/src/rules/prefer-reduce-type-parameter.ts b/packages/eslint-plugin/src/rules/prefer-reduce-type-parameter.ts index a797bfdf48f..d9fe3a3071a 100644 --- a/packages/eslint-plugin/src/rules/prefer-reduce-type-parameter.ts +++ b/packages/eslint-plugin/src/rules/prefer-reduce-type-parameter.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import * as util from '../util'; type MemberExpressionWithCallExpressionParent = TSESTree.MemberExpression & { diff --git a/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts b/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts index bb91f340846..07c98a69240 100644 --- a/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts +++ b/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; import * as ts from 'typescript'; import { diff --git a/packages/eslint-plugin/src/rules/prefer-return-this-type.ts b/packages/eslint-plugin/src/rules/prefer-return-this-type.ts index 15faf74d1ed..0368300bbd6 100644 --- a/packages/eslint-plugin/src/rules/prefer-return-this-type.ts +++ b/packages/eslint-plugin/src/rules/prefer-return-this-type.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import * as ts from 'typescript'; import { createRule, forEachReturnStatement, getParserServices } from '../util'; diff --git a/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts b/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts index 9bf63c08431..501693efc50 100644 --- a/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts +++ b/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts @@ -1,8 +1,4 @@ -import { - AST_NODE_TYPES, - TSESLint, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; import { AST as RegExpAST, RegExpParser } from 'regexpp'; import { createRule, diff --git a/packages/eslint-plugin/src/rules/prefer-ts-expect-error.ts b/packages/eslint-plugin/src/rules/prefer-ts-expect-error.ts index 15c070298cb..17f1c465f1a 100644 --- a/packages/eslint-plugin/src/rules/prefer-ts-expect-error.ts +++ b/packages/eslint-plugin/src/rules/prefer-ts-expect-error.ts @@ -1,12 +1,6 @@ import * as util from '../util'; -import { - AST_TOKEN_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; -import { - RuleFixer, - RuleFix, -} from '@typescript-eslint/experimental-utils/dist/ts-eslint'; +import { AST_TOKEN_TYPES, TSESTree } from '@typescript-eslint/utils'; +import { RuleFixer, RuleFix } from '@typescript-eslint/utils/dist/ts-eslint'; type MessageIds = 'preferExpectErrorComment'; diff --git a/packages/eslint-plugin/src/rules/promise-function-async.ts b/packages/eslint-plugin/src/rules/promise-function-async.ts index 083afcebe71..bf49764a681 100644 --- a/packages/eslint-plugin/src/rules/promise-function-async.ts +++ b/packages/eslint-plugin/src/rules/promise-function-async.ts @@ -2,7 +2,7 @@ import { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESTree, -} from '@typescript-eslint/experimental-utils'; +} from '@typescript-eslint/utils'; import * as ts from 'typescript'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/quotes.ts b/packages/eslint-plugin/src/rules/quotes.ts index a22782cc08e..d24ac099533 100644 --- a/packages/eslint-plugin/src/rules/quotes.ts +++ b/packages/eslint-plugin/src/rules/quotes.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import { getESLintCoreRule } from '../util/getESLintCoreRule'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/require-array-sort-compare.ts b/packages/eslint-plugin/src/rules/require-array-sort-compare.ts index 25476314d73..ae9ea48a4fa 100644 --- a/packages/eslint-plugin/src/rules/require-array-sort-compare.ts +++ b/packages/eslint-plugin/src/rules/require-array-sort-compare.ts @@ -1,4 +1,4 @@ -import { TSESTree } from '@typescript-eslint/experimental-utils'; +import { TSESTree } from '@typescript-eslint/utils'; import * as util from '../util'; export type Options = [ diff --git a/packages/eslint-plugin/src/rules/require-await.ts b/packages/eslint-plugin/src/rules/require-await.ts index f0935b202ea..56067fe554a 100644 --- a/packages/eslint-plugin/src/rules/require-await.ts +++ b/packages/eslint-plugin/src/rules/require-await.ts @@ -1,8 +1,4 @@ -import { - AST_NODE_TYPES, - TSESLint, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; import * as ts from 'typescript'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/restrict-plus-operands.ts b/packages/eslint-plugin/src/rules/restrict-plus-operands.ts index afcbf9abf2f..5ccae1aca10 100644 --- a/packages/eslint-plugin/src/rules/restrict-plus-operands.ts +++ b/packages/eslint-plugin/src/rules/restrict-plus-operands.ts @@ -1,4 +1,4 @@ -import { TSESTree } from '@typescript-eslint/experimental-utils'; +import { TSESTree } from '@typescript-eslint/utils'; import * as ts from 'typescript'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/restrict-template-expressions.ts b/packages/eslint-plugin/src/rules/restrict-template-expressions.ts index f39bc88cfe5..b4d70ab5350 100644 --- a/packages/eslint-plugin/src/rules/restrict-template-expressions.ts +++ b/packages/eslint-plugin/src/rules/restrict-template-expressions.ts @@ -1,7 +1,4 @@ -import { - TSESTree, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as ts from 'typescript'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/return-await.ts b/packages/eslint-plugin/src/rules/return-await.ts index 93b863757a0..dfdb75fa30d 100644 --- a/packages/eslint-plugin/src/rules/return-await.ts +++ b/packages/eslint-plugin/src/rules/return-await.ts @@ -1,8 +1,4 @@ -import { - AST_NODE_TYPES, - TSESLint, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; import * as ts from 'typescript'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/semi.ts b/packages/eslint-plugin/src/rules/semi.ts index a923310915c..8df56137311 100644 --- a/packages/eslint-plugin/src/rules/semi.ts +++ b/packages/eslint-plugin/src/rules/semi.ts @@ -1,8 +1,4 @@ -import { - TSESTree, - TSESLint, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { TSESTree, TSESLint, AST_NODE_TYPES } from '@typescript-eslint/utils'; import { getESLintCoreRule } from '../util/getESLintCoreRule'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/sort-type-union-intersection-members.ts b/packages/eslint-plugin/src/rules/sort-type-union-intersection-members.ts index 942cae423df..fcdaa00152d 100644 --- a/packages/eslint-plugin/src/rules/sort-type-union-intersection-members.ts +++ b/packages/eslint-plugin/src/rules/sort-type-union-intersection-members.ts @@ -1,8 +1,4 @@ -import { - AST_NODE_TYPES, - TSESLint, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; import * as util from '../util'; import { getEnumNames } from '../util'; diff --git a/packages/eslint-plugin/src/rules/space-before-function-paren.ts b/packages/eslint-plugin/src/rules/space-before-function-paren.ts index 8f848f92742..6c6995db02f 100644 --- a/packages/eslint-plugin/src/rules/space-before-function-paren.ts +++ b/packages/eslint-plugin/src/rules/space-before-function-paren.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import * as util from '../util'; type Option = 'never' | 'always'; diff --git a/packages/eslint-plugin/src/rules/space-infix-ops.ts b/packages/eslint-plugin/src/rules/space-infix-ops.ts index fddeaac6fb6..a38b57825f2 100644 --- a/packages/eslint-plugin/src/rules/space-infix-ops.ts +++ b/packages/eslint-plugin/src/rules/space-infix-ops.ts @@ -1,7 +1,4 @@ -import { - AST_TOKEN_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_TOKEN_TYPES, TSESTree } from '@typescript-eslint/utils'; import { getESLintCoreRule } from '../util/getESLintCoreRule'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts b/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts index bf8d6709840..0a91b2fca95 100644 --- a/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts +++ b/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts @@ -2,7 +2,7 @@ import { AST_NODE_TYPES, ParserServices, TSESTree, -} from '@typescript-eslint/experimental-utils'; +} from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; import * as ts from 'typescript'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/switch-exhaustiveness-check.ts b/packages/eslint-plugin/src/rules/switch-exhaustiveness-check.ts index 08f21e3364c..49ed2d905b6 100644 --- a/packages/eslint-plugin/src/rules/switch-exhaustiveness-check.ts +++ b/packages/eslint-plugin/src/rules/switch-exhaustiveness-check.ts @@ -1,4 +1,4 @@ -import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; +import { TSESLint, TSESTree } from '@typescript-eslint/utils'; import * as ts from 'typescript'; import { createRule, diff --git a/packages/eslint-plugin/src/rules/triple-slash-reference.ts b/packages/eslint-plugin/src/rules/triple-slash-reference.ts index ba8bce5ae8a..cf769237fff 100644 --- a/packages/eslint-plugin/src/rules/triple-slash-reference.ts +++ b/packages/eslint-plugin/src/rules/triple-slash-reference.ts @@ -2,7 +2,7 @@ import { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESTree, -} from '@typescript-eslint/experimental-utils'; +} from '@typescript-eslint/utils'; import * as util from '../util'; type Options = [ diff --git a/packages/eslint-plugin/src/rules/type-annotation-spacing.ts b/packages/eslint-plugin/src/rules/type-annotation-spacing.ts index d02b8777d5f..d10040fdf8d 100644 --- a/packages/eslint-plugin/src/rules/type-annotation-spacing.ts +++ b/packages/eslint-plugin/src/rules/type-annotation-spacing.ts @@ -1,4 +1,4 @@ -import { TSESTree } from '@typescript-eslint/experimental-utils'; +import { TSESTree } from '@typescript-eslint/utils'; import * as util from '../util'; import { isClassOrTypeElement, diff --git a/packages/eslint-plugin/src/rules/typedef.ts b/packages/eslint-plugin/src/rules/typedef.ts index 700fd347c77..ed78693d48b 100644 --- a/packages/eslint-plugin/src/rules/typedef.ts +++ b/packages/eslint-plugin/src/rules/typedef.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import * as util from '../util'; const enum OptionKeys { diff --git a/packages/eslint-plugin/src/rules/unbound-method.ts b/packages/eslint-plugin/src/rules/unbound-method.ts index 15ddf8b8910..2dd6aafaebf 100644 --- a/packages/eslint-plugin/src/rules/unbound-method.ts +++ b/packages/eslint-plugin/src/rules/unbound-method.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; import * as ts from 'typescript'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/unified-signatures.ts b/packages/eslint-plugin/src/rules/unified-signatures.ts index 7481dcd7031..b5a1d8a97ba 100644 --- a/packages/eslint-plugin/src/rules/unified-signatures.ts +++ b/packages/eslint-plugin/src/rules/unified-signatures.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import * as util from '../util'; interface Failure { diff --git a/packages/eslint-plugin/src/util/astUtils.ts b/packages/eslint-plugin/src/util/astUtils.ts index 67bdfca5aa1..e9ac5c51f34 100644 --- a/packages/eslint-plugin/src/util/astUtils.ts +++ b/packages/eslint-plugin/src/util/astUtils.ts @@ -1,9 +1,9 @@ -import type { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; import { escapeRegExp } from './escapeRegExp'; import * as ts from 'typescript'; // deeply re-export, for convenience -export * from '@typescript-eslint/experimental-utils/dist/ast-utils'; +export * from '@typescript-eslint/utils/dist/ast-utils'; // The following is copied from `eslint`'s source code since it doesn't exist in eslint@5. // https://github.com/eslint/eslint/blob/145aec1ab9052fbca96a44d04927c595951b1536/lib/rules/utils/ast-utils.js#L1751-L1779 diff --git a/packages/eslint-plugin/src/util/collectUnusedVariables.ts b/packages/eslint-plugin/src/util/collectUnusedVariables.ts index fe44354fc30..6fe14b0d272 100644 --- a/packages/eslint-plugin/src/util/collectUnusedVariables.ts +++ b/packages/eslint-plugin/src/util/collectUnusedVariables.ts @@ -4,7 +4,7 @@ import { ASTUtils, TSESTree, ESLintUtils, -} from '@typescript-eslint/experimental-utils'; +} from '@typescript-eslint/utils'; import { ImplicitLibVariable } from '@typescript-eslint/scope-manager'; import { Visitor } from '@typescript-eslint/scope-manager/dist/referencer/Visitor'; diff --git a/packages/eslint-plugin/src/util/createRule.ts b/packages/eslint-plugin/src/util/createRule.ts index 3d2f75aeba9..1008ffcc11b 100644 --- a/packages/eslint-plugin/src/util/createRule.ts +++ b/packages/eslint-plugin/src/util/createRule.ts @@ -1,4 +1,4 @@ -import { ESLintUtils } from '@typescript-eslint/experimental-utils'; +import { ESLintUtils } from '@typescript-eslint/utils'; export const createRule = ESLintUtils.RuleCreator( name => `https://typescript-eslint.io/rules/${name}`, diff --git a/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts b/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts index c69f8591ae7..3b737ad4f41 100644 --- a/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts +++ b/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts @@ -3,7 +3,7 @@ import { AST_NODE_TYPES, ESLintUtils, TSESLint, -} from '@typescript-eslint/experimental-utils'; +} from '@typescript-eslint/utils'; import { isTypeAssertion, isConstructor, isSetter } from './astUtils'; import { getFunctionHeadLoc } from './getFunctionHeadLoc'; diff --git a/packages/eslint-plugin/src/util/getESLintCoreRule.ts b/packages/eslint-plugin/src/util/getESLintCoreRule.ts index 7c2427c8fcb..f61bdb0c309 100644 --- a/packages/eslint-plugin/src/util/getESLintCoreRule.ts +++ b/packages/eslint-plugin/src/util/getESLintCoreRule.ts @@ -1,4 +1,4 @@ -import { ESLintUtils } from '@typescript-eslint/experimental-utils'; +import { ESLintUtils } from '@typescript-eslint/utils'; import { version } from 'eslint/package.json'; import * as semver from 'semver'; diff --git a/packages/eslint-plugin/src/util/getFunctionHeadLoc.ts b/packages/eslint-plugin/src/util/getFunctionHeadLoc.ts index 7604a8d496f..a9d30838d2d 100644 --- a/packages/eslint-plugin/src/util/getFunctionHeadLoc.ts +++ b/packages/eslint-plugin/src/util/getFunctionHeadLoc.ts @@ -3,7 +3,7 @@ import { AST_TOKEN_TYPES, TSESLint, TSESTree, -} from '@typescript-eslint/experimental-utils'; +} from '@typescript-eslint/utils'; type FunctionNode = | TSESTree.ArrowFunctionExpression diff --git a/packages/eslint-plugin/src/util/getThisExpression.ts b/packages/eslint-plugin/src/util/getThisExpression.ts index 5e2772aebae..73405464b3f 100644 --- a/packages/eslint-plugin/src/util/getThisExpression.ts +++ b/packages/eslint-plugin/src/util/getThisExpression.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; export function getThisExpression( node: TSESTree.Node, diff --git a/packages/eslint-plugin/src/util/getWrappingFixer.ts b/packages/eslint-plugin/src/util/getWrappingFixer.ts index aa01520fdbd..af7885efc41 100644 --- a/packages/eslint-plugin/src/util/getWrappingFixer.ts +++ b/packages/eslint-plugin/src/util/getWrappingFixer.ts @@ -3,7 +3,7 @@ import { TSESLint, ASTUtils, TSESTree, -} from '@typescript-eslint/experimental-utils'; +} from '@typescript-eslint/utils'; interface WrappingFixerParams { /** Source code. */ diff --git a/packages/eslint-plugin/src/util/index.ts b/packages/eslint-plugin/src/util/index.ts index 48641babf28..a83198807a6 100644 --- a/packages/eslint-plugin/src/util/index.ts +++ b/packages/eslint-plugin/src/util/index.ts @@ -1,4 +1,4 @@ -import { ESLintUtils } from '@typescript-eslint/experimental-utils'; +import { ESLintUtils } from '@typescript-eslint/utils'; export * from './astUtils'; export * from './collectUnusedVariables'; diff --git a/packages/eslint-plugin/src/util/misc.ts b/packages/eslint-plugin/src/util/misc.ts index 4c6b71d2a4d..eb62a029b15 100644 --- a/packages/eslint-plugin/src/util/misc.ts +++ b/packages/eslint-plugin/src/util/misc.ts @@ -2,11 +2,7 @@ * @fileoverview Really small utility functions that didn't deserve their own files */ -import { - AST_NODE_TYPES, - TSESLint, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; import { requiresQuoting } from '@typescript-eslint/type-utils'; /** diff --git a/packages/eslint-plugin/tests/RuleTester.ts b/packages/eslint-plugin/tests/RuleTester.ts index dad454369c1..7479d99f29a 100644 --- a/packages/eslint-plugin/tests/RuleTester.ts +++ b/packages/eslint-plugin/tests/RuleTester.ts @@ -1,4 +1,4 @@ -import { ESLintUtils } from '@typescript-eslint/experimental-utils'; +import { ESLintUtils } from '@typescript-eslint/utils'; import * as path from 'path'; function getFixturesRootDir(): string { diff --git a/packages/eslint-plugin/tests/rules/array-type.test.ts b/packages/eslint-plugin/tests/rules/array-type.test.ts index cfdfb80ec1a..a00f72cdba1 100644 --- a/packages/eslint-plugin/tests/rules/array-type.test.ts +++ b/packages/eslint-plugin/tests/rules/array-type.test.ts @@ -1,4 +1,4 @@ -import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/utils'; import * as parser from '@typescript-eslint/parser'; import rule, { OptionString } from '../../src/rules/array-type'; import { RuleTester } from '../RuleTester'; diff --git a/packages/eslint-plugin/tests/rules/ban-types.test.ts b/packages/eslint-plugin/tests/rules/ban-types.test.ts index 64e6bcd3308..a200336e0aa 100644 --- a/packages/eslint-plugin/tests/rules/ban-types.test.ts +++ b/packages/eslint-plugin/tests/rules/ban-types.test.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/internal/prefer-ast-types-enum */ -import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/utils'; import rule, { MessageIds, Options, diff --git a/packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts b/packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts index 561660a7f45..da5068753ca 100644 --- a/packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts +++ b/packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts @@ -17,8 +17,8 @@ ruleTester.run('consistent-type-exports', rule, { valid: [ "export { Foo } from 'foo';", "export type { AnalyzeOptions } from '@typescript-eslint/scope-manager';", - "export { BlockScope } from '@typescript-eslint/experimental-utils';", - "export type { BlockScope } from '@typescript-eslint/experimental-utils';", + "export { BlockScope } from '@typescript-eslint/utils';", + "export type { BlockScope } from '@typescript-eslint/utils';", ` const variable = 1; class Class {} diff --git a/packages/eslint-plugin/tests/rules/func-call-spacing.test.ts b/packages/eslint-plugin/tests/rules/func-call-spacing.test.ts index 2c5d0e57776..11650e2b014 100644 --- a/packages/eslint-plugin/tests/rules/func-call-spacing.test.ts +++ b/packages/eslint-plugin/tests/rules/func-call-spacing.test.ts @@ -3,7 +3,7 @@ /* eslint "@typescript-eslint/internal/plugin-test-formatting": ["error", { formatWithPrettier: false }] */ /* eslint-enable eslint-comments/no-use */ -import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/utils'; import rule, { MessageIds, Options } from '../../src/rules/func-call-spacing'; import { RuleTester } from '../RuleTester'; diff --git a/packages/eslint-plugin/tests/rules/indent/indent-eslint.test.ts b/packages/eslint-plugin/tests/rules/indent/indent-eslint.test.ts index d03ee3ea9dc..e6483ce5dee 100644 --- a/packages/eslint-plugin/tests/rules/indent/indent-eslint.test.ts +++ b/packages/eslint-plugin/tests/rules/indent/indent-eslint.test.ts @@ -9,10 +9,7 @@ /* eslint "@typescript-eslint/internal/plugin-test-formatting": ["error", { formatWithPrettier: false }] */ /* eslint-enable eslint-comments/no-use */ -import { - AST_TOKEN_TYPES, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { AST_TOKEN_TYPES, AST_NODE_TYPES } from '@typescript-eslint/utils'; import fs from 'fs'; import path from 'path'; import rule from '../../../src/rules/indent-new-do-not-use'; diff --git a/packages/eslint-plugin/tests/rules/indent/indent.test.ts b/packages/eslint-plugin/tests/rules/indent/indent.test.ts index 3d6b58725f8..32b1f91fae0 100644 --- a/packages/eslint-plugin/tests/rules/indent/indent.test.ts +++ b/packages/eslint-plugin/tests/rules/indent/indent.test.ts @@ -3,10 +3,7 @@ /* eslint "@typescript-eslint/internal/plugin-test-formatting": ["error", { formatWithPrettier: false }] */ /* eslint-enable eslint-comments/no-use */ -import { - AST_NODE_TYPES, - TSESLint, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESLint } from '@typescript-eslint/utils'; import { RuleTester } from '../../RuleTester'; import rule from '../../../src/rules/indent'; import { diff --git a/packages/eslint-plugin/tests/rules/indent/utils.ts b/packages/eslint-plugin/tests/rules/indent/utils.ts index badfbc1c3c6..628389a451e 100644 --- a/packages/eslint-plugin/tests/rules/indent/utils.ts +++ b/packages/eslint-plugin/tests/rules/indent/utils.ts @@ -5,7 +5,7 @@ import { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESLint, -} from '@typescript-eslint/experimental-utils'; +} from '@typescript-eslint/utils'; import rule from '../../../src/rules/indent'; import { InferMessageIdsTypeFromRule } from '../../../src/util'; diff --git a/packages/eslint-plugin/tests/rules/init-declarations.test.ts b/packages/eslint-plugin/tests/rules/init-declarations.test.ts index 1d5dc73655f..95d9a08799a 100644 --- a/packages/eslint-plugin/tests/rules/init-declarations.test.ts +++ b/packages/eslint-plugin/tests/rules/init-declarations.test.ts @@ -1,4 +1,4 @@ -import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/init-declarations'; import { RuleTester } from '../RuleTester'; diff --git a/packages/eslint-plugin/tests/rules/keyword-spacing.test.ts b/packages/eslint-plugin/tests/rules/keyword-spacing.test.ts index ec94928c1c5..a2a92ad42ae 100644 --- a/packages/eslint-plugin/tests/rules/keyword-spacing.test.ts +++ b/packages/eslint-plugin/tests/rules/keyword-spacing.test.ts @@ -2,7 +2,7 @@ // this rule tests the spacing, which prettier will want to fix and break the tests /* eslint "@typescript-eslint/internal/plugin-test-formatting": ["error", { formatWithPrettier: false }] */ /* eslint-enable eslint-comments/no-use */ -import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/utils'; import rule, { MessageIds, Options } from '../../src/rules/keyword-spacing'; import { RuleTester } from '../RuleTester'; diff --git a/packages/eslint-plugin/tests/rules/member-ordering-alphabetically-case-insensitive-order.test.ts b/packages/eslint-plugin/tests/rules/member-ordering-alphabetically-case-insensitive-order.test.ts index db62c315101..24907a8d8f4 100644 --- a/packages/eslint-plugin/tests/rules/member-ordering-alphabetically-case-insensitive-order.test.ts +++ b/packages/eslint-plugin/tests/rules/member-ordering-alphabetically-case-insensitive-order.test.ts @@ -4,7 +4,7 @@ import rule, { Options, } from '../../src/rules/member-ordering'; import { RuleTester } from '../RuleTester'; -import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/utils'; const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', diff --git a/packages/eslint-plugin/tests/rules/member-ordering-alphabetically-order.test.ts b/packages/eslint-plugin/tests/rules/member-ordering-alphabetically-order.test.ts index 1386aee7909..dfd5f0de83c 100644 --- a/packages/eslint-plugin/tests/rules/member-ordering-alphabetically-order.test.ts +++ b/packages/eslint-plugin/tests/rules/member-ordering-alphabetically-order.test.ts @@ -4,7 +4,7 @@ import rule, { Options, } from '../../src/rules/member-ordering'; import { RuleTester } from '../RuleTester'; -import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/utils'; const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', diff --git a/packages/eslint-plugin/tests/rules/member-ordering.test.ts b/packages/eslint-plugin/tests/rules/member-ordering.test.ts index cbab8ced2a3..c9c1090c734 100644 --- a/packages/eslint-plugin/tests/rules/member-ordering.test.ts +++ b/packages/eslint-plugin/tests/rules/member-ordering.test.ts @@ -1,6 +1,6 @@ import rule, { MessageIds, Options } from '../../src/rules/member-ordering'; import { RuleTester } from '../RuleTester'; -import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/utils'; const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', diff --git a/packages/eslint-plugin/tests/rules/naming-convention.test.ts b/packages/eslint-plugin/tests/rules/naming-convention.test.ts index b8ad03a53a6..ef123500880 100644 --- a/packages/eslint-plugin/tests/rules/naming-convention.test.ts +++ b/packages/eslint-plugin/tests/rules/naming-convention.test.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/internal/prefer-ast-types-enum */ -import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/utils'; import rule, { MessageIds, Options } from '../../src/rules/naming-convention'; import { PredefinedFormatsString, 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 af760d29999..439cd85731c 100644 --- a/packages/eslint-plugin/tests/rules/no-array-constructor.test.ts +++ b/packages/eslint-plugin/tests/rules/no-array-constructor.test.ts @@ -1,4 +1,4 @@ -import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/no-array-constructor'; import { RuleTester } from '../RuleTester'; diff --git a/packages/eslint-plugin/tests/rules/no-explicit-any.test.ts b/packages/eslint-plugin/tests/rules/no-explicit-any.test.ts index cb99564c943..37d6b99b29f 100644 --- a/packages/eslint-plugin/tests/rules/no-explicit-any.test.ts +++ b/packages/eslint-plugin/tests/rules/no-explicit-any.test.ts @@ -1,6 +1,6 @@ import rule, { MessageIds, Options } from '../../src/rules/no-explicit-any'; import { RuleTester } from '../RuleTester'; -import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/utils'; type InvalidTestCase = TSESLint.InvalidTestCase; type SuggestionOutput = TSESLint.SuggestionOutput; 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 44d32490a10..799410971f2 100644 --- a/packages/eslint-plugin/tests/rules/no-extraneous-class.test.ts +++ b/packages/eslint-plugin/tests/rules/no-extraneous-class.test.ts @@ -1,4 +1,4 @@ -import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/no-extraneous-class'; import { RuleTester } from '../RuleTester'; diff --git a/packages/eslint-plugin/tests/rules/no-for-in-array.test.ts b/packages/eslint-plugin/tests/rules/no-for-in-array.test.ts index 7c3ec309185..0fd7679a650 100644 --- a/packages/eslint-plugin/tests/rules/no-for-in-array.test.ts +++ b/packages/eslint-plugin/tests/rules/no-for-in-array.test.ts @@ -1,4 +1,4 @@ -import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/no-for-in-array'; import { RuleTester, getFixturesRootDir } from '../RuleTester'; diff --git a/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts b/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts index fc216c6c476..d85806b69c4 100644 --- a/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts +++ b/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts @@ -1,4 +1,4 @@ -import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/utils'; import rule from '../../src/rules/no-inferrable-types'; import { RuleTester } from '../RuleTester'; import { 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 be22ae267c0..4ad0153cc20 100644 --- a/packages/eslint-plugin/tests/rules/no-loop-func.test.ts +++ b/packages/eslint-plugin/tests/rules/no-loop-func.test.ts @@ -1,4 +1,4 @@ -import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/no-loop-func'; import { RuleTester } from '../RuleTester'; diff --git a/packages/eslint-plugin/tests/rules/no-redeclare.test.ts b/packages/eslint-plugin/tests/rules/no-redeclare.test.ts index c371a738755..bd3384b3631 100644 --- a/packages/eslint-plugin/tests/rules/no-redeclare.test.ts +++ b/packages/eslint-plugin/tests/rules/no-redeclare.test.ts @@ -1,7 +1,4 @@ -import { - AST_NODE_TYPES, - AST_TOKEN_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils'; import { RuleTester } from '../RuleTester'; import rule from '../../src/rules/no-redeclare'; 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 059a7d1cad8..8e4ea58c55a 100644 --- a/packages/eslint-plugin/tests/rules/no-restricted-imports.test.ts +++ b/packages/eslint-plugin/tests/rules/no-restricted-imports.test.ts @@ -1,4 +1,4 @@ -import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/no-restricted-imports'; import { RuleTester } from '../RuleTester'; @@ -536,10 +536,10 @@ ruleTester.run('no-restricted-imports', rule, { ], }, { - code: "import type { InvalidTestCase } from '@typescript-eslint/experimental-utils/dist/ts-eslint';", + code: "import type { InvalidTestCase } from '@typescript-eslint/utils/dist/ts-eslint';", options: [ { - patterns: ['@typescript-eslint/experimental-utils/dist/*'], + patterns: ['@typescript-eslint/utils/dist/*'], }, ], errors: [ diff --git a/packages/eslint-plugin/tests/rules/no-shadow.test.ts b/packages/eslint-plugin/tests/rules/no-shadow.test.ts index 929ddf9d389..635dff307e1 100644 --- a/packages/eslint-plugin/tests/rules/no-shadow.test.ts +++ b/packages/eslint-plugin/tests/rules/no-shadow.test.ts @@ -1,4 +1,4 @@ -import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/no-shadow'; import { RuleTester } from '../RuleTester'; 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 43806a67fd9..0a8f7340bca 100644 --- a/packages/eslint-plugin/tests/rules/no-this-alias.test.ts +++ b/packages/eslint-plugin/tests/rules/no-this-alias.test.ts @@ -1,4 +1,4 @@ -import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/no-this-alias'; import { RuleTester } from '../RuleTester'; diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts index 82196fbc8a1..3e86749956c 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts @@ -1,7 +1,7 @@ import { TestCaseError, InvalidTestCase, -} from '@typescript-eslint/experimental-utils/dist/ts-eslint'; +} from '@typescript-eslint/utils/dist/ts-eslint'; import * as path from 'path'; import rule, { Options, 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 a03cdc7d747..7dd7fd2747d 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts @@ -1,4 +1,4 @@ -import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/no-unnecessary-qualifier'; import { RuleTester, getFixturesRootDir } from '../RuleTester'; diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-type-assertion.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-type-assertion.test.ts index 7cd16960139..3b6c8168ce8 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-type-assertion.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-type-assertion.test.ts @@ -15,7 +15,7 @@ const ruleTester = new RuleTester({ ruleTester.run('no-unnecessary-type-assertion', rule, { valid: [ ` -import { TSESTree } from '@typescript-eslint/experimental-utils'; +import { TSESTree } from '@typescript-eslint/utils'; declare const member: TSESTree.TSEnumMember; if ( member.id.type === AST_NODE_TYPES.Literal && diff --git a/packages/eslint-plugin/tests/rules/no-unsafe-assignment.test.ts b/packages/eslint-plugin/tests/rules/no-unsafe-assignment.test.ts index f9594fc9348..78ef7e78b38 100644 --- a/packages/eslint-plugin/tests/rules/no-unsafe-assignment.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unsafe-assignment.test.ts @@ -1,4 +1,4 @@ -import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/utils'; import rule from '../../src/rules/no-unsafe-assignment'; import { RuleTester, diff --git a/packages/eslint-plugin/tests/rules/no-unused-expressions.test.ts b/packages/eslint-plugin/tests/rules/no-unused-expressions.test.ts index 06d9019f38a..cf9082af764 100644 --- a/packages/eslint-plugin/tests/rules/no-unused-expressions.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unused-expressions.test.ts @@ -1,4 +1,4 @@ -import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/utils'; import rule from '../../src/rules/no-unused-expressions'; import { noFormat, RuleTester } from '../RuleTester'; diff --git a/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars-eslint.test.ts b/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars-eslint.test.ts index 8ef68ae781c..9ddde4e9f24 100644 --- a/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars-eslint.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars-eslint.test.ts @@ -4,10 +4,7 @@ 'use strict'; -import { - AST_NODE_TYPES, - TSESLint, -} from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES, TSESLint } from '@typescript-eslint/utils'; import rule, { MessageIds } from '../../../src/rules/no-unused-vars'; import { RuleTester } from '../../RuleTester'; 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 e585b66e3ac..32924973a5c 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,6 +1,6 @@ import rule from '../../src/rules/no-use-before-define'; import { RuleTester } from '../RuleTester'; -import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', 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 0730f280dc2..7cedb9151e3 100644 --- a/packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts +++ b/packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts @@ -1,4 +1,4 @@ -import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/no-useless-constructor'; import { RuleTester } from '../RuleTester'; diff --git a/packages/eslint-plugin/tests/rules/object-curly-spacing.test.ts b/packages/eslint-plugin/tests/rules/object-curly-spacing.test.ts index 7b917a67308..c64a7e17b9a 100644 --- a/packages/eslint-plugin/tests/rules/object-curly-spacing.test.ts +++ b/packages/eslint-plugin/tests/rules/object-curly-spacing.test.ts @@ -3,7 +3,7 @@ /* eslint "@typescript-eslint/internal/plugin-test-formatting": ["error", { formatWithPrettier: false }] */ /* eslint-enable eslint-comments/no-use */ -import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/object-curly-spacing'; import { RuleTester } from '../RuleTester'; 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 51aa8523489..50fb8370b18 100644 --- a/packages/eslint-plugin/tests/rules/prefer-function-type.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-function-type.test.ts @@ -1,4 +1,4 @@ -import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule, { phrases } from '../../src/rules/prefer-function-type'; import { noFormat, RuleTester } from '../RuleTester'; diff --git a/packages/eslint-plugin/tests/rules/prefer-nullish-coalescing.test.ts b/packages/eslint-plugin/tests/rules/prefer-nullish-coalescing.test.ts index a984484edd5..8096df94c32 100644 --- a/packages/eslint-plugin/tests/rules/prefer-nullish-coalescing.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-nullish-coalescing.test.ts @@ -1,4 +1,4 @@ -import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/utils'; import rule, { MessageIds, Options, diff --git a/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts b/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts index feb7f9bd524..d6ac19abb89 100644 --- a/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts @@ -1,6 +1,6 @@ import rule from '../../src/rules/prefer-optional-chain'; import { RuleTester, noFormat } from '../RuleTester'; -import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/utils'; import { InferMessageIdsTypeFromRule, InferOptionsTypeFromRule, diff --git a/packages/eslint-plugin/tests/rules/prefer-readonly-parameter-types.test.ts b/packages/eslint-plugin/tests/rules/prefer-readonly-parameter-types.test.ts index be50f096963..f17a19f1f6d 100644 --- a/packages/eslint-plugin/tests/rules/prefer-readonly-parameter-types.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-readonly-parameter-types.test.ts @@ -1,4 +1,4 @@ -import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/utils'; import { RuleTester, getFixturesRootDir } from '../RuleTester'; import rule from '../../src/rules/prefer-readonly-parameter-types'; import { diff --git a/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts b/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts index aefb7cd8d2d..d1e76250d57 100644 --- a/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts @@ -1,4 +1,4 @@ -import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/utils'; import rule from '../../src/rules/prefer-string-starts-ends-with'; import { RuleTester, getFixturesRootDir } from '../RuleTester'; diff --git a/packages/eslint-plugin/tests/rules/promise-function-async.test.ts b/packages/eslint-plugin/tests/rules/promise-function-async.test.ts index 6a0451ed858..53ba5cb81a0 100644 --- a/packages/eslint-plugin/tests/rules/promise-function-async.test.ts +++ b/packages/eslint-plugin/tests/rules/promise-function-async.test.ts @@ -1,4 +1,4 @@ -import { noFormat } from '@typescript-eslint/experimental-utils/src/eslint-utils'; +import { noFormat } from '@typescript-eslint/utils/src/eslint-utils'; import rule from '../../src/rules/promise-function-async'; import { getFixturesRootDir, RuleTester } from '../RuleTester'; diff --git a/packages/eslint-plugin/tests/rules/semi.test.ts b/packages/eslint-plugin/tests/rules/semi.test.ts index 48c68a2f059..b5d88f77a93 100644 --- a/packages/eslint-plugin/tests/rules/semi.test.ts +++ b/packages/eslint-plugin/tests/rules/semi.test.ts @@ -3,7 +3,7 @@ /* eslint "@typescript-eslint/internal/plugin-test-formatting": ["error", { formatWithPrettier: false }] */ /* eslint-enable eslint-comments/no-use */ -import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/utils'; import rule, { MessageIds, Options } from '../../src/rules/semi'; import { RuleTester } from '../RuleTester'; diff --git a/packages/eslint-plugin/tests/rules/sort-type-union-intersection-members.test.ts b/packages/eslint-plugin/tests/rules/sort-type-union-intersection-members.test.ts index a0cf2d71dd5..a5eeb2f2fa4 100644 --- a/packages/eslint-plugin/tests/rules/sort-type-union-intersection-members.test.ts +++ b/packages/eslint-plugin/tests/rules/sort-type-union-intersection-members.test.ts @@ -1,4 +1,4 @@ -import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/utils'; import rule, { MessageIds, Options, diff --git a/packages/eslint-plugin/tests/rules/space-before-function-paren.test.ts b/packages/eslint-plugin/tests/rules/space-before-function-paren.test.ts index 13c68b88bc7..72405cf35d6 100644 --- a/packages/eslint-plugin/tests/rules/space-before-function-paren.test.ts +++ b/packages/eslint-plugin/tests/rules/space-before-function-paren.test.ts @@ -3,7 +3,7 @@ /* eslint "@typescript-eslint/internal/plugin-test-formatting": ["error", { formatWithPrettier: false }] */ /* eslint-enable eslint-comments/no-use */ -import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/space-before-function-paren'; import { RuleTester } from '../RuleTester'; diff --git a/packages/eslint-plugin/tests/rules/type-annotation-spacing.test.ts b/packages/eslint-plugin/tests/rules/type-annotation-spacing.test.ts index 19349a80889..17ae884c72f 100644 --- a/packages/eslint-plugin/tests/rules/type-annotation-spacing.test.ts +++ b/packages/eslint-plugin/tests/rules/type-annotation-spacing.test.ts @@ -3,7 +3,7 @@ /* eslint "@typescript-eslint/internal/plugin-test-formatting": ["error", { formatWithPrettier: false }] */ /* eslint-enable eslint-comments/no-use */ -import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/utils'; import { RuleTester } from '../RuleTester'; import rule from '../../src/rules/type-annotation-spacing'; import { diff --git a/packages/eslint-plugin/tests/rules/unbound-method.test.ts b/packages/eslint-plugin/tests/rules/unbound-method.test.ts index 3075e93fe67..524f64a47a4 100644 --- a/packages/eslint-plugin/tests/rules/unbound-method.test.ts +++ b/packages/eslint-plugin/tests/rules/unbound-method.test.ts @@ -1,4 +1,4 @@ -import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/utils'; import rule, { MessageIds, Options } from '../../src/rules/unbound-method'; import { RuleTester, getFixturesRootDir } from '../RuleTester'; diff --git a/packages/eslint-plugin/tests/util/getWrappingFixer.test.ts b/packages/eslint-plugin/tests/util/getWrappingFixer.test.ts index bcbb4c6d5fb..8e2b48e4bed 100644 --- a/packages/eslint-plugin/tests/util/getWrappingFixer.test.ts +++ b/packages/eslint-plugin/tests/util/getWrappingFixer.test.ts @@ -1,4 +1,4 @@ -import { TSESTree } from '@typescript-eslint/experimental-utils'; +import { TSESTree } from '@typescript-eslint/utils'; import { getFixturesRootDir, RuleTester } from '../RuleTester'; import { createRule, getWrappingFixer } from '../../src/util'; diff --git a/packages/eslint-plugin/tools/generate-configs.ts b/packages/eslint-plugin/tools/generate-configs.ts index ed84f286496..f1da74b67c7 100644 --- a/packages/eslint-plugin/tools/generate-configs.ts +++ b/packages/eslint-plugin/tools/generate-configs.ts @@ -1,4 +1,4 @@ -import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/utils'; import chalk from 'chalk'; import fs from 'fs'; import path from 'path'; diff --git a/packages/eslint-plugin/tsconfig.build.json b/packages/eslint-plugin/tsconfig.build.json index fc60d9a85a7..af60c77e84f 100644 --- a/packages/eslint-plugin/tsconfig.build.json +++ b/packages/eslint-plugin/tsconfig.build.json @@ -10,7 +10,7 @@ }, "include": ["src", "typings"], "references": [ - { "path": "../experimental-utils/tsconfig.build.json" }, + { "path": "../utils/tsconfig.build.json" }, { "path": "../parser/tsconfig.build.json" }, { "path": "../scope-manager/tsconfig.build.json" }, { "path": "../type-utils/tsconfig.build.json" } diff --git a/packages/eslint-plugin/tsconfig.json b/packages/eslint-plugin/tsconfig.json index 31db855dad8..7801773b539 100644 --- a/packages/eslint-plugin/tsconfig.json +++ b/packages/eslint-plugin/tsconfig.json @@ -6,7 +6,7 @@ }, "include": ["src", "typings", "tests", "tools", "index.d.ts"], "references": [ - { "path": "../experimental-utils/tsconfig.build.json" }, + { "path": "../utils/tsconfig.build.json" }, { "path": "../parser/tsconfig.build.json" }, { "path": "../scope-manager/tsconfig.build.json" }, { "path": "../type-utils/tsconfig.build.json" } diff --git a/packages/eslint-plugin/typings/eslint-rules.d.ts b/packages/eslint-plugin/typings/eslint-rules.d.ts index 44b679281fb..a279276e91b 100644 --- a/packages/eslint-plugin/typings/eslint-rules.d.ts +++ b/packages/eslint-plugin/typings/eslint-rules.d.ts @@ -5,7 +5,7 @@ // } declare module 'eslint/lib/rules/arrow-parens' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< | 'unexpectedParens' @@ -26,7 +26,7 @@ declare module 'eslint/lib/rules/arrow-parens' { } declare module 'eslint/lib/rules/camelcase' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'notCamelCase', @@ -46,7 +46,7 @@ declare module 'eslint/lib/rules/camelcase' { } declare module 'eslint/lib/rules/indent' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; type ElementList = number | 'first' | 'off'; const rule: TSESLint.RuleModule< @@ -142,8 +142,8 @@ declare module 'eslint/lib/rules/indent' { } declare module 'eslint/lib/rules/keyword-spacing' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; - import { RuleFunction } from '@typescript-eslint/experimental-utils/dist/ts-eslint'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import { RuleFunction } from '@typescript-eslint/utils/dist/ts-eslint'; type Options = [ { @@ -221,7 +221,7 @@ declare module 'eslint/lib/rules/keyword-spacing' { } declare module 'eslint/lib/rules/no-dupe-class-members' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'unexpected', @@ -242,7 +242,7 @@ declare module 'eslint/lib/rules/no-dupe-class-members' { } declare module 'eslint/lib/rules/no-dupe-args' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'unexpected', @@ -256,7 +256,7 @@ declare module 'eslint/lib/rules/no-dupe-args' { } declare module 'eslint/lib/rules/no-empty-function' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'unexpected', @@ -274,7 +274,7 @@ declare module 'eslint/lib/rules/no-empty-function' { } declare module 'eslint/lib/rules/no-implicit-globals' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< | 'globalNonLexicalBinding' @@ -291,7 +291,7 @@ declare module 'eslint/lib/rules/no-implicit-globals' { } declare module 'eslint/lib/rules/no-loop-func' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'unsafeRefs', @@ -306,7 +306,7 @@ declare module 'eslint/lib/rules/no-loop-func' { } declare module 'eslint/lib/rules/no-magic-numbers' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'noMagic', @@ -329,7 +329,7 @@ declare module 'eslint/lib/rules/no-magic-numbers' { } declare module 'eslint/lib/rules/no-redeclare' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'redeclared' | 'redeclaredAsBuiltin' | 'redeclaredBySyntax', @@ -346,7 +346,7 @@ declare module 'eslint/lib/rules/no-redeclare' { } declare module 'eslint/lib/rules/no-restricted-globals' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'defaultMessage' | 'customMessage', @@ -365,7 +365,7 @@ declare module 'eslint/lib/rules/no-restricted-globals' { } declare module 'eslint/lib/rules/no-shadow' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'noShadow', @@ -384,7 +384,7 @@ declare module 'eslint/lib/rules/no-shadow' { } declare module 'eslint/lib/rules/no-undef' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'undef', @@ -401,7 +401,7 @@ declare module 'eslint/lib/rules/no-undef' { } declare module 'eslint/lib/rules/no-unused-vars' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'unusedVar', @@ -426,7 +426,7 @@ declare module 'eslint/lib/rules/no-unused-vars' { } declare module 'eslint/lib/rules/no-unused-expressions' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'expected', @@ -445,7 +445,7 @@ declare module 'eslint/lib/rules/no-unused-expressions' { } declare module 'eslint/lib/rules/no-use-before-define' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'usedBeforeDefine', @@ -465,7 +465,7 @@ declare module 'eslint/lib/rules/no-use-before-define' { } declare module 'eslint/lib/rules/strict' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< | 'function' @@ -487,7 +487,7 @@ declare module 'eslint/lib/rules/strict' { } declare module 'eslint/lib/rules/no-useless-constructor' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'noUselessConstructor', @@ -500,7 +500,7 @@ declare module 'eslint/lib/rules/no-useless-constructor' { } declare module 'eslint/lib/rules/no-extra-parens' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'unexpected', @@ -557,7 +557,7 @@ declare module 'eslint/lib/rules/no-extra-parens' { } declare module 'eslint/lib/rules/semi' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'missingSemi' | 'extraSemi', @@ -587,7 +587,7 @@ declare module 'eslint/lib/rules/semi' { } declare module 'eslint/lib/rules/quotes' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'wrongQuotes', @@ -607,7 +607,7 @@ declare module 'eslint/lib/rules/quotes' { } declare module 'eslint/lib/rules/brace-style' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< | 'nextLineOpen' @@ -634,7 +634,7 @@ declare module 'eslint/lib/rules/brace-style' { } declare module 'eslint/lib/rules/no-extra-semi' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'unexpected', @@ -654,7 +654,7 @@ declare module 'eslint/lib/rules/no-extra-semi' { } declare module 'eslint/lib/rules/lines-between-class-members' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'always' | 'never', @@ -673,7 +673,7 @@ declare module 'eslint/lib/rules/lines-between-class-members' { } declare module 'eslint/lib/rules/init-declarations' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'initialized' | 'notInitialized', @@ -691,7 +691,7 @@ declare module 'eslint/lib/rules/init-declarations' { } declare module 'eslint/lib/rules/no-invalid-this' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'unexpectedThis', @@ -713,7 +713,7 @@ declare module 'eslint/lib/rules/no-invalid-this' { export = rule; } declare module 'eslint/lib/rules/dot-notation' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'useDot' | 'useBrackets', @@ -734,7 +734,7 @@ declare module 'eslint/lib/rules/dot-notation' { } declare module 'eslint/lib/rules/no-loss-of-precision' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'noLossOfPrecision', @@ -747,7 +747,7 @@ declare module 'eslint/lib/rules/no-loss-of-precision' { } declare module 'eslint/lib/rules/comma-dangle' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; type StringOptions = | 'always-multiline' @@ -780,7 +780,7 @@ declare module 'eslint/lib/rules/comma-dangle' { } declare module 'eslint/lib/rules/no-duplicate-imports' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< | 'import' @@ -806,7 +806,7 @@ declare module 'eslint/lib/rules/no-duplicate-imports' { } declare module 'eslint/lib/rules/space-infix-ops' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'missingSpace', @@ -828,7 +828,7 @@ declare module 'eslint/lib/rules/space-infix-ops' { } declare module 'eslint/lib/rules/prefer-const' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'useConst', @@ -847,7 +847,7 @@ declare module 'eslint/lib/rules/prefer-const' { } declare module 'eslint/lib/rules/object-curly-spacing' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< | 'requireSpaceBefore' @@ -872,7 +872,7 @@ declare module 'eslint/lib/rules/object-curly-spacing' { } declare module 'eslint/lib/rules/no-restricted-imports' { - import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + import { TSESLint, TSESTree } from '@typescript-eslint/utils'; namespace rule { export type ArrayOfStringOrObject = ( diff --git a/packages/experimental-utils/CHANGELOG.md b/packages/experimental-utils/CHANGELOG.md index eecafe20025..a1fce3cc9eb 100644 --- a/packages/experimental-utils/CHANGELOG.md +++ b/packages/experimental-utils/CHANGELOG.md @@ -1,5 +1,7 @@ # Change Log +> ⚠ Changes for version 6.0 onwards are documented in the `@typescript-eslint/utils` changelog. + All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. diff --git a/packages/experimental-utils/README.md b/packages/experimental-utils/README.md index 7f9f6b24207..3073308c16b 100644 --- a/packages/experimental-utils/README.md +++ b/packages/experimental-utils/README.md @@ -4,33 +4,21 @@

CI - NPM Version - NPM Downloads + NPM Version + NPM Downloads

## Note -This package has inherited its version number from the `@typescript-eslint` project. -Meaning that even though this package is `2.x.y`, you shouldn't expect 100% stability between minor version bumps. -i.e. treat it as a `0.x.y` package. +**This package is purely a re-export of `@typescript-eslint/utils`.** +You should switch to importing from that non-experimental package instead. -Feel free to use it now, and let us know what utilities you need or send us PRs with utilities you build on top of it. +```diff +- import { RuleCreator } from '@typescript-eslint/experimental-utils'; ++ import { RuleCreator } from '@typescript-eslint/utils'; +``` -Once it is stable, it will be renamed to `@typescript-eslint/util` for a `6.0.0` release. - -## Exports - -| Name | Description | -| -------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [`ASTUtils`](./src/ast-utils) | Tools for operating on the ESTree AST. Also includes the [`eslint-utils`](https://www.npmjs.com/package/eslint-utils) package, correctly typed to work with the types found in `TSESTree` | -| [`ESLintUtils`](./src/eslint-utils) | Tools for creating ESLint rules with TypeScript. | -| `JSONSchema` | Types from the [`@types/json-schema`](https://www.npmjs.com/package/@types/json-schema) package, re-exported to save you having to manually import them. Also ensures you're using the same version of the types as this package. | -| [`TSESLint`](./src/ts-eslint) | Types for ESLint, correctly typed to work with the types found in `TSESTree`. | -| [`TSESLintScope`](./src/ts-eslint-scope) | The [`eslint-scope`](https://www.npmjs.com/package/eslint-scope) package, correctly typed to work with the types found in both `TSESTree` and `TSESLint` | -| [`TSESTree`](../types/src/ts-estree.ts) | Types for the TypeScript flavor of ESTree created by `@typescript-eslint/typescript-estree`. | -| [`AST_NODE_TYPES`](../types/src/ast-node-types.ts) | An enum with the names of every single _node_ found in `TSESTree`. | -| [`AST_TOKEN_TYPES`](../types/src/ast-token-types.ts) | An enum with the names of every single _token_ found in `TSESTree`. | -| [`ParserServices`](../typescript-estree/src/parser-options.ts) | Typing for the parser services provided when parsing a file using `@typescript-eslint/typescript-estree`. | +> ⚠ A future major version of this old package will `console.warn` to ask you to switch. ## Contributing diff --git a/packages/experimental-utils/package.json b/packages/experimental-utils/package.json index fc09b4f2d8b..342f8955f1b 100644 --- a/packages/experimental-utils/package.json +++ b/packages/experimental-utils/package.json @@ -35,16 +35,10 @@ "postclean": "rimraf dist && rimraf _ts3.4 && rimraf coverage", "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore", "lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'", - "test": "jest --coverage", "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.9.1", - "@typescript-eslint/types": "5.9.1", - "@typescript-eslint/typescript-estree": "5.9.1", - "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0" + "@typescript-eslint/utils": "5.9.1" }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" @@ -55,12 +49,5 @@ "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" - }, - "typesVersions": { - "<3.8": { - "*": [ - "_ts3.4/*" - ] - } } } diff --git a/packages/experimental-utils/src/index.ts b/packages/experimental-utils/src/index.ts index 31328386269..ae481e0310b 100644 --- a/packages/experimental-utils/src/index.ts +++ b/packages/experimental-utils/src/index.ts @@ -1,8 +1,2 @@ -import * as ASTUtils from './ast-utils'; -import * as ESLintUtils from './eslint-utils'; -import * as JSONSchema from './json-schema'; -import * as TSESLint from './ts-eslint'; -import * as TSESLintScope from './ts-eslint-scope'; - -export { ASTUtils, ESLintUtils, JSONSchema, TSESLint, TSESLintScope }; -export * from './ts-estree'; +// TODO (#4139): Once typescript-eslint hits v7, this package will console.warn to switch... +export * from '@typescript-eslint/utils'; diff --git a/packages/parser/tsconfig.build.json b/packages/parser/tsconfig.build.json index 1725797310b..8556d030722 100644 --- a/packages/parser/tsconfig.build.json +++ b/packages/parser/tsconfig.build.json @@ -8,7 +8,7 @@ }, "include": ["src"], "references": [ - { "path": "../experimental-utils/tsconfig.build.json" }, + { "path": "../utils/tsconfig.build.json" }, { "path": "../scope-manager/tsconfig.build.json" }, { "path": "../types/tsconfig.build.json" }, { "path": "../typescript-estree/tsconfig.build.json" } diff --git a/packages/parser/tsconfig.json b/packages/parser/tsconfig.json index f69f9ce1078..ae4f11eded6 100644 --- a/packages/parser/tsconfig.json +++ b/packages/parser/tsconfig.json @@ -7,7 +7,7 @@ "include": ["src", "tests", "tools"], "exclude": ["tests/fixtures"], "references": [ - { "path": "../experimental-utils/tsconfig.build.json" }, + { "path": "../utils/tsconfig.build.json" }, { "path": "../scope-manager/tsconfig.build.json" }, { "path": "../types/tsconfig.build.json" }, { "path": "../typescript-estree/tsconfig.build.json" } diff --git a/packages/type-utils/README.md b/packages/type-utils/README.md index 099067095a4..19a4bf7e964 100644 --- a/packages/type-utils/README.md +++ b/packages/type-utils/README.md @@ -8,7 +8,7 @@ NPM Downloads

-This utilities in this package are separated from `@typescript-eslint/experimental-utils` so that that package does not require a dependency on `typescript`. +This utilities in this package are separated from `@typescript-eslint/utils` so that that package does not require a dependency on `typescript`. ## Contributing diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index 924b71ccbe1..cd0c1209d8d 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -39,7 +39,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/experimental-utils": "5.9.1", + "@typescript-eslint/utils": "5.9.1", "debug": "^4.3.2", "tsutils": "^3.21.0" }, diff --git a/packages/type-utils/src/isTypeReadonly.ts b/packages/type-utils/src/isTypeReadonly.ts index 7f689b5b7df..d5d05e94a0e 100644 --- a/packages/type-utils/src/isTypeReadonly.ts +++ b/packages/type-utils/src/isTypeReadonly.ts @@ -1,4 +1,4 @@ -import { ESLintUtils } from '@typescript-eslint/experimental-utils'; +import { ESLintUtils } from '@typescript-eslint/utils'; import { isObjectType, isUnionType, diff --git a/packages/type-utils/src/isUnsafeAssignment.ts b/packages/type-utils/src/isUnsafeAssignment.ts index 32dc84b0c30..926e215ae08 100644 --- a/packages/type-utils/src/isUnsafeAssignment.ts +++ b/packages/type-utils/src/isUnsafeAssignment.ts @@ -1,7 +1,4 @@ -import { - TSESTree, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; import { isTypeReference } from 'tsutils'; import * as ts from 'typescript'; import { isTypeAnyType, isTypeUnknownType } from './predicates'; diff --git a/packages/type-utils/tests/isUnsafeAssignment.test.ts b/packages/type-utils/tests/isUnsafeAssignment.test.ts index 060dc880e53..6b794705751 100644 --- a/packages/type-utils/tests/isUnsafeAssignment.test.ts +++ b/packages/type-utils/tests/isUnsafeAssignment.test.ts @@ -1,5 +1,5 @@ import * as ts from 'typescript'; -import { TSESTree } from '@typescript-eslint/experimental-utils'; +import { TSESTree } from '@typescript-eslint/utils'; import { parseForESLint } from '@typescript-eslint/parser'; import { isUnsafeAssignment } from '../src/isUnsafeAssignment'; import path from 'path'; diff --git a/packages/type-utils/tsconfig.build.json b/packages/type-utils/tsconfig.build.json index 3b5743aaf5d..782f14402ae 100644 --- a/packages/type-utils/tsconfig.build.json +++ b/packages/type-utils/tsconfig.build.json @@ -7,5 +7,5 @@ "resolveJsonModule": true }, "include": ["src", "typings"], - "references": [{ "path": "../experimental-utils/tsconfig.build.json" }] + "references": [{ "path": "../utils/tsconfig.build.json" }] } diff --git a/packages/type-utils/tsconfig.json b/packages/type-utils/tsconfig.json index 9c0c2ac4ba5..93bec73e74a 100644 --- a/packages/type-utils/tsconfig.json +++ b/packages/type-utils/tsconfig.json @@ -5,5 +5,5 @@ "rootDir": "." }, "include": ["src", "typings", "tests", "tools"], - "references": [{ "path": "../experimental-utils/tsconfig.build.json" }] + "references": [{ "path": "../utils/tsconfig.build.json" }] } diff --git a/packages/types/README.md b/packages/types/README.md index 5c91f1687d2..273ac71a936 100644 --- a/packages/types/README.md +++ b/packages/types/README.md @@ -9,7 +9,7 @@ This package exists to help us reduce cycles and provide lighter-weight packages at runtime. You probably don't want to use it directly. -If you're building an ESLint plugin, consider using [`@typescript-eslint/experimental-utils`](../experimental-utils). +If you're building an ESLint plugin, consider using [`@typescript-eslint/utils`](../utils). If you're parsing TypeScript code, consider using [`@typescript-eslint/typescript-estree`](../typescript-estree). ## Contributing diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md new file mode 100644 index 00000000000..e4d87c4d45c --- /dev/null +++ b/packages/utils/CHANGELOG.md @@ -0,0 +1,4 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. diff --git a/packages/utils/LICENSE b/packages/utils/LICENSE new file mode 100644 index 00000000000..7e7370143b2 --- /dev/null +++ b/packages/utils/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 TypeScript ESLint and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/utils/README.md b/packages/utils/README.md new file mode 100644 index 00000000000..d517cc457a5 --- /dev/null +++ b/packages/utils/README.md @@ -0,0 +1,27 @@ +

Utils for ESLint Plugins

+ +

Utilities for working with TypeScript + ESLint together.

+ +

+ CI + NPM Version + NPM Downloads +

+ +## Exports + +| Name | Description | +| -------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [`ASTUtils`](./src/ast-utils) | Tools for operating on the ESTree AST. Also includes the [`eslint-utils`](https://www.npmjs.com/package/eslint-utils) package, correctly typed to work with the types found in `TSESTree` | +| [`ESLintUtils`](./src/eslint-utils) | Tools for creating ESLint rules with TypeScript. | +| `JSONSchema` | Types from the [`@types/json-schema`](https://www.npmjs.com/package/@types/json-schema) package, re-exported to save you having to manually import them. Also ensures you're using the same version of the types as this package. | +| [`TSESLint`](./src/ts-eslint) | Types for ESLint, correctly typed to work with the types found in `TSESTree`. | +| [`TSESLintScope`](./src/ts-eslint-scope) | The [`eslint-scope`](https://www.npmjs.com/package/eslint-scope) package, correctly typed to work with the types found in both `TSESTree` and `TSESLint` | +| [`TSESTree`](../types/src/ts-estree.ts) | Types for the TypeScript flavor of ESTree created by `@typescript-eslint/typescript-estree`. | +| [`AST_NODE_TYPES`](../types/src/ast-node-types.ts) | An enum with the names of every single _node_ found in `TSESTree`. | +| [`AST_TOKEN_TYPES`](../types/src/ast-token-types.ts) | An enum with the names of every single _token_ found in `TSESTree`. | +| [`ParserServices`](../typescript-estree/src/parser-options.ts) | Typing for the parser services provided when parsing a file using `@typescript-eslint/typescript-estree`. | + +## Contributing + +[See the contributing guide here](../../CONTRIBUTING.md) diff --git a/packages/utils/jest.config.js b/packages/utils/jest.config.js new file mode 100644 index 00000000000..bf4e270e376 --- /dev/null +++ b/packages/utils/jest.config.js @@ -0,0 +1,21 @@ +'use strict'; + +// @ts-check +/** @type {import('@jest/types').Config.InitialOptions} */ +module.exports = { + resolver: '/../../tests/jest-resolver.js', + globals: { + 'ts-jest': { + isolatedModules: true, + }, + }, + testEnvironment: 'node', + transform: { + '^.+\\.tsx?$': 'ts-jest', + }, + testRegex: './tests/.+\\.test\\.ts$', + collectCoverage: false, + collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'], + moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], + coverageReporters: ['text-summary', 'lcov'], +}; diff --git a/packages/utils/package.json b/packages/utils/package.json new file mode 100644 index 00000000000..be1a712fff3 --- /dev/null +++ b/packages/utils/package.json @@ -0,0 +1,66 @@ +{ + "name": "@typescript-eslint/utils", + "version": "5.9.1", + "description": "Utilities for working with TypeScript + ESLint together", + "keywords": [ + "eslint", + "typescript", + "estree" + ], + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "files": [ + "dist", + "_ts3.4", + "package.json", + "README.md", + "LICENSE" + ], + "repository": { + "type": "git", + "url": "https://github.com/typescript-eslint/typescript-eslint.git", + "directory": "packages/utils" + }, + "bugs": { + "url": "https://github.com/typescript-eslint/typescript-eslint/issues" + }, + "license": "MIT", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "build": "tsc -b tsconfig.build.json", + "postbuild": "downlevel-dts dist _ts3.4/dist", + "clean": "tsc -b tsconfig.build.json --clean", + "postclean": "rimraf dist && rimraf _ts3.4 && rimraf coverage", + "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore", + "lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'", + "test": "jest --coverage", + "typecheck": "tsc -p tsconfig.json --noEmit" + }, + "dependencies": { + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.9.1", + "@typescript-eslint/types": "5.9.1", + "@typescript-eslint/typescript-estree": "5.9.1", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "devDependencies": { + "typescript": "*" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "typesVersions": { + "<3.8": { + "*": [ + "_ts3.4/*" + ] + } + } +} diff --git a/packages/utils/project.json b/packages/utils/project.json new file mode 100644 index 00000000000..b55a371ba33 --- /dev/null +++ b/packages/utils/project.json @@ -0,0 +1,5 @@ +{ + "root": "packages/utils", + "type": "library", + "implicitDependencies": [] +} diff --git a/packages/experimental-utils/src/ast-utils/eslint-utils/PatternMatcher.ts b/packages/utils/src/ast-utils/eslint-utils/PatternMatcher.ts similarity index 100% rename from packages/experimental-utils/src/ast-utils/eslint-utils/PatternMatcher.ts rename to packages/utils/src/ast-utils/eslint-utils/PatternMatcher.ts diff --git a/packages/experimental-utils/src/ast-utils/eslint-utils/ReferenceTracker.ts b/packages/utils/src/ast-utils/eslint-utils/ReferenceTracker.ts similarity index 100% rename from packages/experimental-utils/src/ast-utils/eslint-utils/ReferenceTracker.ts rename to packages/utils/src/ast-utils/eslint-utils/ReferenceTracker.ts diff --git a/packages/experimental-utils/src/ast-utils/eslint-utils/astUtilities.ts b/packages/utils/src/ast-utils/eslint-utils/astUtilities.ts similarity index 100% rename from packages/experimental-utils/src/ast-utils/eslint-utils/astUtilities.ts rename to packages/utils/src/ast-utils/eslint-utils/astUtilities.ts diff --git a/packages/experimental-utils/src/ast-utils/eslint-utils/index.ts b/packages/utils/src/ast-utils/eslint-utils/index.ts similarity index 100% rename from packages/experimental-utils/src/ast-utils/eslint-utils/index.ts rename to packages/utils/src/ast-utils/eslint-utils/index.ts diff --git a/packages/experimental-utils/src/ast-utils/eslint-utils/predicates.ts b/packages/utils/src/ast-utils/eslint-utils/predicates.ts similarity index 100% rename from packages/experimental-utils/src/ast-utils/eslint-utils/predicates.ts rename to packages/utils/src/ast-utils/eslint-utils/predicates.ts diff --git a/packages/experimental-utils/src/ast-utils/eslint-utils/scopeAnalysis.ts b/packages/utils/src/ast-utils/eslint-utils/scopeAnalysis.ts similarity index 100% rename from packages/experimental-utils/src/ast-utils/eslint-utils/scopeAnalysis.ts rename to packages/utils/src/ast-utils/eslint-utils/scopeAnalysis.ts diff --git a/packages/experimental-utils/src/ast-utils/helpers.ts b/packages/utils/src/ast-utils/helpers.ts similarity index 100% rename from packages/experimental-utils/src/ast-utils/helpers.ts rename to packages/utils/src/ast-utils/helpers.ts diff --git a/packages/experimental-utils/src/ast-utils/index.ts b/packages/utils/src/ast-utils/index.ts similarity index 100% rename from packages/experimental-utils/src/ast-utils/index.ts rename to packages/utils/src/ast-utils/index.ts diff --git a/packages/experimental-utils/src/ast-utils/misc.ts b/packages/utils/src/ast-utils/misc.ts similarity index 100% rename from packages/experimental-utils/src/ast-utils/misc.ts rename to packages/utils/src/ast-utils/misc.ts diff --git a/packages/experimental-utils/src/ast-utils/predicates.ts b/packages/utils/src/ast-utils/predicates.ts similarity index 100% rename from packages/experimental-utils/src/ast-utils/predicates.ts rename to packages/utils/src/ast-utils/predicates.ts diff --git a/packages/experimental-utils/src/eslint-utils/InferTypesFromRule.ts b/packages/utils/src/eslint-utils/InferTypesFromRule.ts similarity index 100% rename from packages/experimental-utils/src/eslint-utils/InferTypesFromRule.ts rename to packages/utils/src/eslint-utils/InferTypesFromRule.ts diff --git a/packages/experimental-utils/src/eslint-utils/RuleCreator.ts b/packages/utils/src/eslint-utils/RuleCreator.ts similarity index 100% rename from packages/experimental-utils/src/eslint-utils/RuleCreator.ts rename to packages/utils/src/eslint-utils/RuleCreator.ts diff --git a/packages/experimental-utils/src/eslint-utils/RuleTester.ts b/packages/utils/src/eslint-utils/RuleTester.ts similarity index 100% rename from packages/experimental-utils/src/eslint-utils/RuleTester.ts rename to packages/utils/src/eslint-utils/RuleTester.ts diff --git a/packages/experimental-utils/src/eslint-utils/applyDefault.ts b/packages/utils/src/eslint-utils/applyDefault.ts similarity index 100% rename from packages/experimental-utils/src/eslint-utils/applyDefault.ts rename to packages/utils/src/eslint-utils/applyDefault.ts diff --git a/packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts b/packages/utils/src/eslint-utils/batchedSingleLineTests.ts similarity index 100% rename from packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts rename to packages/utils/src/eslint-utils/batchedSingleLineTests.ts diff --git a/packages/experimental-utils/src/eslint-utils/deepMerge.ts b/packages/utils/src/eslint-utils/deepMerge.ts similarity index 100% rename from packages/experimental-utils/src/eslint-utils/deepMerge.ts rename to packages/utils/src/eslint-utils/deepMerge.ts diff --git a/packages/experimental-utils/src/eslint-utils/getParserServices.ts b/packages/utils/src/eslint-utils/getParserServices.ts similarity index 100% rename from packages/experimental-utils/src/eslint-utils/getParserServices.ts rename to packages/utils/src/eslint-utils/getParserServices.ts diff --git a/packages/experimental-utils/src/eslint-utils/index.ts b/packages/utils/src/eslint-utils/index.ts similarity index 100% rename from packages/experimental-utils/src/eslint-utils/index.ts rename to packages/utils/src/eslint-utils/index.ts diff --git a/packages/experimental-utils/src/eslint-utils/nullThrows.ts b/packages/utils/src/eslint-utils/nullThrows.ts similarity index 100% rename from packages/experimental-utils/src/eslint-utils/nullThrows.ts rename to packages/utils/src/eslint-utils/nullThrows.ts diff --git a/packages/utils/src/index.ts b/packages/utils/src/index.ts new file mode 100644 index 00000000000..31328386269 --- /dev/null +++ b/packages/utils/src/index.ts @@ -0,0 +1,8 @@ +import * as ASTUtils from './ast-utils'; +import * as ESLintUtils from './eslint-utils'; +import * as JSONSchema from './json-schema'; +import * as TSESLint from './ts-eslint'; +import * as TSESLintScope from './ts-eslint-scope'; + +export { ASTUtils, ESLintUtils, JSONSchema, TSESLint, TSESLintScope }; +export * from './ts-estree'; diff --git a/packages/experimental-utils/src/json-schema.ts b/packages/utils/src/json-schema.ts similarity index 100% rename from packages/experimental-utils/src/json-schema.ts rename to packages/utils/src/json-schema.ts diff --git a/packages/experimental-utils/src/ts-eslint-scope/Definition.ts b/packages/utils/src/ts-eslint-scope/Definition.ts similarity index 100% rename from packages/experimental-utils/src/ts-eslint-scope/Definition.ts rename to packages/utils/src/ts-eslint-scope/Definition.ts diff --git a/packages/experimental-utils/src/ts-eslint-scope/Options.ts b/packages/utils/src/ts-eslint-scope/Options.ts similarity index 100% rename from packages/experimental-utils/src/ts-eslint-scope/Options.ts rename to packages/utils/src/ts-eslint-scope/Options.ts diff --git a/packages/experimental-utils/src/ts-eslint-scope/PatternVisitor.ts b/packages/utils/src/ts-eslint-scope/PatternVisitor.ts similarity index 100% rename from packages/experimental-utils/src/ts-eslint-scope/PatternVisitor.ts rename to packages/utils/src/ts-eslint-scope/PatternVisitor.ts diff --git a/packages/experimental-utils/src/ts-eslint-scope/README.md b/packages/utils/src/ts-eslint-scope/README.md similarity index 100% rename from packages/experimental-utils/src/ts-eslint-scope/README.md rename to packages/utils/src/ts-eslint-scope/README.md diff --git a/packages/experimental-utils/src/ts-eslint-scope/Reference.ts b/packages/utils/src/ts-eslint-scope/Reference.ts similarity index 100% rename from packages/experimental-utils/src/ts-eslint-scope/Reference.ts rename to packages/utils/src/ts-eslint-scope/Reference.ts diff --git a/packages/experimental-utils/src/ts-eslint-scope/Referencer.ts b/packages/utils/src/ts-eslint-scope/Referencer.ts similarity index 100% rename from packages/experimental-utils/src/ts-eslint-scope/Referencer.ts rename to packages/utils/src/ts-eslint-scope/Referencer.ts diff --git a/packages/experimental-utils/src/ts-eslint-scope/Scope.ts b/packages/utils/src/ts-eslint-scope/Scope.ts similarity index 100% rename from packages/experimental-utils/src/ts-eslint-scope/Scope.ts rename to packages/utils/src/ts-eslint-scope/Scope.ts diff --git a/packages/experimental-utils/src/ts-eslint-scope/ScopeManager.ts b/packages/utils/src/ts-eslint-scope/ScopeManager.ts similarity index 100% rename from packages/experimental-utils/src/ts-eslint-scope/ScopeManager.ts rename to packages/utils/src/ts-eslint-scope/ScopeManager.ts diff --git a/packages/experimental-utils/src/ts-eslint-scope/Variable.ts b/packages/utils/src/ts-eslint-scope/Variable.ts similarity index 100% rename from packages/experimental-utils/src/ts-eslint-scope/Variable.ts rename to packages/utils/src/ts-eslint-scope/Variable.ts diff --git a/packages/experimental-utils/src/ts-eslint-scope/analyze.ts b/packages/utils/src/ts-eslint-scope/analyze.ts similarity index 100% rename from packages/experimental-utils/src/ts-eslint-scope/analyze.ts rename to packages/utils/src/ts-eslint-scope/analyze.ts diff --git a/packages/experimental-utils/src/ts-eslint-scope/index.ts b/packages/utils/src/ts-eslint-scope/index.ts similarity index 100% rename from packages/experimental-utils/src/ts-eslint-scope/index.ts rename to packages/utils/src/ts-eslint-scope/index.ts diff --git a/packages/experimental-utils/src/ts-eslint/AST.ts b/packages/utils/src/ts-eslint/AST.ts similarity index 100% rename from packages/experimental-utils/src/ts-eslint/AST.ts rename to packages/utils/src/ts-eslint/AST.ts diff --git a/packages/experimental-utils/src/ts-eslint/CLIEngine.ts b/packages/utils/src/ts-eslint/CLIEngine.ts similarity index 100% rename from packages/experimental-utils/src/ts-eslint/CLIEngine.ts rename to packages/utils/src/ts-eslint/CLIEngine.ts diff --git a/packages/experimental-utils/src/ts-eslint/ESLint.ts b/packages/utils/src/ts-eslint/ESLint.ts similarity index 100% rename from packages/experimental-utils/src/ts-eslint/ESLint.ts rename to packages/utils/src/ts-eslint/ESLint.ts diff --git a/packages/experimental-utils/src/ts-eslint/Linter.ts b/packages/utils/src/ts-eslint/Linter.ts similarity index 100% rename from packages/experimental-utils/src/ts-eslint/Linter.ts rename to packages/utils/src/ts-eslint/Linter.ts diff --git a/packages/experimental-utils/src/ts-eslint/ParserOptions.ts b/packages/utils/src/ts-eslint/ParserOptions.ts similarity index 100% rename from packages/experimental-utils/src/ts-eslint/ParserOptions.ts rename to packages/utils/src/ts-eslint/ParserOptions.ts diff --git a/packages/experimental-utils/src/ts-eslint/Rule.ts b/packages/utils/src/ts-eslint/Rule.ts similarity index 100% rename from packages/experimental-utils/src/ts-eslint/Rule.ts rename to packages/utils/src/ts-eslint/Rule.ts diff --git a/packages/experimental-utils/src/ts-eslint/RuleTester.ts b/packages/utils/src/ts-eslint/RuleTester.ts similarity index 100% rename from packages/experimental-utils/src/ts-eslint/RuleTester.ts rename to packages/utils/src/ts-eslint/RuleTester.ts diff --git a/packages/experimental-utils/src/ts-eslint/Scope.ts b/packages/utils/src/ts-eslint/Scope.ts similarity index 100% rename from packages/experimental-utils/src/ts-eslint/Scope.ts rename to packages/utils/src/ts-eslint/Scope.ts diff --git a/packages/experimental-utils/src/ts-eslint/SourceCode.ts b/packages/utils/src/ts-eslint/SourceCode.ts similarity index 100% rename from packages/experimental-utils/src/ts-eslint/SourceCode.ts rename to packages/utils/src/ts-eslint/SourceCode.ts diff --git a/packages/experimental-utils/src/ts-eslint/index.ts b/packages/utils/src/ts-eslint/index.ts similarity index 100% rename from packages/experimental-utils/src/ts-eslint/index.ts rename to packages/utils/src/ts-eslint/index.ts diff --git a/packages/experimental-utils/src/ts-estree.ts b/packages/utils/src/ts-estree.ts similarity index 100% rename from packages/experimental-utils/src/ts-estree.ts rename to packages/utils/src/ts-estree.ts diff --git a/packages/experimental-utils/tests/eslint-utils/RuleCreator.test.ts b/packages/utils/tests/eslint-utils/RuleCreator.test.ts similarity index 100% rename from packages/experimental-utils/tests/eslint-utils/RuleCreator.test.ts rename to packages/utils/tests/eslint-utils/RuleCreator.test.ts diff --git a/packages/experimental-utils/tests/eslint-utils/applyDefault.test.ts b/packages/utils/tests/eslint-utils/applyDefault.test.ts similarity index 100% rename from packages/experimental-utils/tests/eslint-utils/applyDefault.test.ts rename to packages/utils/tests/eslint-utils/applyDefault.test.ts diff --git a/packages/experimental-utils/tests/eslint-utils/batchedSingleLineTests.test.ts b/packages/utils/tests/eslint-utils/batchedSingleLineTests.test.ts similarity index 100% rename from packages/experimental-utils/tests/eslint-utils/batchedSingleLineTests.test.ts rename to packages/utils/tests/eslint-utils/batchedSingleLineTests.test.ts diff --git a/packages/experimental-utils/tests/eslint-utils/deepMerge.test.ts b/packages/utils/tests/eslint-utils/deepMerge.test.ts similarity index 100% rename from packages/experimental-utils/tests/eslint-utils/deepMerge.test.ts rename to packages/utils/tests/eslint-utils/deepMerge.test.ts diff --git a/packages/utils/tsconfig.build.json b/packages/utils/tsconfig.build.json new file mode 100644 index 00000000000..e5c1077c5e5 --- /dev/null +++ b/packages/utils/tsconfig.build.json @@ -0,0 +1,15 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "composite": true, + "outDir": "./dist", + "rootDir": "./src", + "resolveJsonModule": true + }, + "include": ["src", "typings"], + "references": [ + { "path": "../scope-manager/tsconfig.build.json" }, + { "path": "../types/tsconfig.build.json" }, + { "path": "../typescript-estree/tsconfig.build.json" } + ] +} diff --git a/packages/utils/tsconfig.json b/packages/utils/tsconfig.json new file mode 100644 index 00000000000..20ea2496c6b --- /dev/null +++ b/packages/utils/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "./tsconfig.build.json", + "compilerOptions": { + "composite": false, + "rootDir": "." + }, + "include": ["src", "typings", "tests", "tools"], + "references": [ + { "path": "../scope-manager/tsconfig.build.json" }, + { "path": "../types/tsconfig.build.json" }, + { "path": "../typescript-estree/tsconfig.build.json" } + ] +} diff --git a/packages/experimental-utils/typings/eslint-scope.d.ts b/packages/utils/typings/eslint-scope.d.ts similarity index 100% rename from packages/experimental-utils/typings/eslint-scope.d.ts rename to packages/utils/typings/eslint-scope.d.ts diff --git a/packages/experimental-utils/typings/eslint-utils.d.ts b/packages/utils/typings/eslint-utils.d.ts similarity index 100% rename from packages/experimental-utils/typings/eslint-utils.d.ts rename to packages/utils/typings/eslint-utils.d.ts diff --git a/packages/experimental-utils/typings/eslint.d.ts b/packages/utils/typings/eslint.d.ts similarity index 100% rename from packages/experimental-utils/typings/eslint.d.ts rename to packages/utils/typings/eslint.d.ts diff --git a/packages/website-eslint/package.json b/packages/website-eslint/package.json index 9f7102dc3a7..aa38a0bc01d 100644 --- a/packages/website-eslint/package.json +++ b/packages/website-eslint/package.json @@ -16,8 +16,8 @@ "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore" }, "dependencies": { - "@typescript-eslint/experimental-utils": "5.9.1", - "@typescript-eslint/types": "5.9.1" + "@typescript-eslint/types": "5.9.1", + "@typescript-eslint/utils": "5.9.1" }, "devDependencies": { "@rollup/plugin-commonjs": "^21.0.1", diff --git a/packages/website-eslint/rollup.config.js b/packages/website-eslint/rollup.config.js index f1edc288512..2941ec568f6 100644 --- a/packages/website-eslint/rollup.config.js +++ b/packages/website-eslint/rollup.config.js @@ -21,13 +21,13 @@ module.exports = { match: [ /eslint\/lib\/(rule-tester|eslint|cli-engine|init)\//u, /eslint\/lib\/cli\.js$/, - /experimental-utils\/dist\/eslint-utils\/RuleTester\.js$/, - /experimental-utils\/dist\/ts-eslint\/CLIEngine\.js$/, - /experimental-utils\/dist\/ts-eslint\/RuleTester\.js$/, + /utils\/dist\/eslint-utils\/RuleTester\.js$/, + /utils\/dist\/ts-eslint\/CLIEngine\.js$/, + /utils\/dist\/ts-eslint\/RuleTester\.js$/, /typescript-estree\/dist\/create-program\/createWatchProgram\.js/, /typescript-estree\/dist\/create-program\/createProjectProgram\.js/, /typescript-estree\/dist\/create-program\/createIsolatedProgram\.js/, - /experimental-utils\/dist\/ts-eslint\/ESLint\.js/, + /utils\/dist\/ts-eslint\/ESLint\.js/, // 'eslint/lib/shared/ajv.js', // 'eslint/lib/shared/runtime-info.js', ], diff --git a/packages/website-eslint/types/index.d.ts b/packages/website-eslint/types/index.d.ts index 4e923c2fef1..ed3e1e2422f 100644 --- a/packages/website-eslint/types/index.d.ts +++ b/packages/website-eslint/types/index.d.ts @@ -1,4 +1,4 @@ -import type { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; import type { ParserOptions } from '@typescript-eslint/types'; import type { SourceFile } from 'typescript'; diff --git a/workspace.json b/workspace.json index 6fbf76fb078..152f3d9f6d0 100644 --- a/workspace.json +++ b/workspace.json @@ -9,9 +9,10 @@ "@typescript-eslint/parser": "packages/parser", "@typescript-eslint/scope-manager": "packages/scope-manager", "@typescript-eslint/shared-fixtures": "packages/shared-fixtures", - "@typescript-eslint/types": "packages/types", "@typescript-eslint/type-utils": "packages/type-utils", + "@typescript-eslint/types": "packages/types", "@typescript-eslint/typescript-estree": "packages/typescript-estree", + "@typescript-eslint/utils": "packages/utils", "@typescript-eslint/visitor-keys": "packages/visitor-keys", "@typescript-eslint/website-eslint": "packages/website-eslint", "website": "packages/website"