diff --git a/.eslintrc.json b/.eslintrc.json index 1a7ed2d4..5761661c 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -36,7 +36,7 @@ "no-restricted-imports": [ "error", { - "patterns": ["@typescript-eslint/experimental-utils/dist/*"] + "patterns": ["@typescript-eslint/utils/dist/*"] } ], diff --git a/lib/configs/index.ts b/lib/configs/index.ts index 15b63782..c9edb204 100644 --- a/lib/configs/index.ts +++ b/lib/configs/index.ts @@ -1,6 +1,6 @@ import { join } from 'path'; -import type { TSESLint } from '@typescript-eslint/experimental-utils'; +import type { TSESLint } from '@typescript-eslint/utils'; import { importDefault, diff --git a/lib/create-testing-library-rule/detect-testing-library-utils.ts b/lib/create-testing-library-rule/detect-testing-library-utils.ts index f811dec7..a962ceed 100644 --- a/lib/create-testing-library-rule/detect-testing-library-utils.ts +++ b/lib/create-testing-library-rule/detect-testing-library-utils.ts @@ -1,8 +1,4 @@ -import { - ASTUtils, - TSESLint, - TSESTree, -} from '@typescript-eslint/experimental-utils'; +import { ASTUtils, TSESLint, TSESTree } from '@typescript-eslint/utils'; import { findClosestVariableDeclaratorNode, diff --git a/lib/create-testing-library-rule/index.ts b/lib/create-testing-library-rule/index.ts index 0da77b4a..2edf6ee8 100644 --- a/lib/create-testing-library-rule/index.ts +++ b/lib/create-testing-library-rule/index.ts @@ -1,4 +1,4 @@ -import { ESLintUtils, TSESLint } from '@typescript-eslint/experimental-utils'; +import { ESLintUtils, TSESLint } from '@typescript-eslint/utils'; import { getDocsUrl, TestingLibraryRuleMeta } from '../utils'; diff --git a/lib/node-utils/index.ts b/lib/node-utils/index.ts index d1718f01..138ca956 100644 --- a/lib/node-utils/index.ts +++ b/lib/node-utils/index.ts @@ -4,7 +4,7 @@ import { TSESLint, TSESLintScope, TSESTree, -} from '@typescript-eslint/experimental-utils'; +} from '@typescript-eslint/utils'; import { isArrayExpression, diff --git a/lib/node-utils/is-node-of-type.ts b/lib/node-utils/is-node-of-type.ts index 1ccddbd4..41de9eac 100644 --- a/lib/node-utils/is-node-of-type.ts +++ b/lib/node-utils/is-node-of-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'; const isNodeOfType = (nodeType: NodeType) => diff --git a/lib/rules/await-async-query.ts b/lib/rules/await-async-query.ts index 90be4e9f..d981644f 100644 --- a/lib/rules/await-async-query.ts +++ b/lib/rules/await-async-query.ts @@ -1,4 +1,4 @@ -import { ASTUtils, TSESTree } from '@typescript-eslint/experimental-utils'; +import { ASTUtils, TSESTree } from '@typescript-eslint/utils'; import { createTestingLibraryRule } from '../create-testing-library-rule'; import { diff --git a/lib/rules/await-async-utils.ts b/lib/rules/await-async-utils.ts index 1f23e9fa..c0999d4f 100644 --- a/lib/rules/await-async-utils.ts +++ b/lib/rules/await-async-utils.ts @@ -1,4 +1,4 @@ -import { TSESTree } from '@typescript-eslint/experimental-utils'; +import { TSESTree } from '@typescript-eslint/utils'; import { createTestingLibraryRule } from '../create-testing-library-rule'; import { diff --git a/lib/rules/await-fire-event.ts b/lib/rules/await-fire-event.ts index e6a70568..b9858aea 100644 --- a/lib/rules/await-fire-event.ts +++ b/lib/rules/await-fire-event.ts @@ -1,4 +1,4 @@ -import { ASTUtils, TSESTree } from '@typescript-eslint/experimental-utils'; +import { ASTUtils, TSESTree } from '@typescript-eslint/utils'; import { createTestingLibraryRule } from '../create-testing-library-rule'; import { diff --git a/lib/rules/index.ts b/lib/rules/index.ts index 1a1e79f1..7b20c3ce 100644 --- a/lib/rules/index.ts +++ b/lib/rules/index.ts @@ -1,7 +1,7 @@ import { readdirSync } from 'fs'; import { join, parse } from 'path'; -import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/utils'; import { importDefault, TestingLibraryRuleMeta } from '../utils'; diff --git a/lib/rules/no-await-sync-events.ts b/lib/rules/no-await-sync-events.ts index 87753dc6..ea7ce157 100644 --- a/lib/rules/no-await-sync-events.ts +++ b/lib/rules/no-await-sync-events.ts @@ -1,4 +1,4 @@ -import { ASTUtils, TSESTree } from '@typescript-eslint/experimental-utils'; +import { ASTUtils, TSESTree } from '@typescript-eslint/utils'; import { createTestingLibraryRule } from '../create-testing-library-rule'; import { diff --git a/lib/rules/no-await-sync-query.ts b/lib/rules/no-await-sync-query.ts index 1797aa9d..99baf668 100644 --- a/lib/rules/no-await-sync-query.ts +++ b/lib/rules/no-await-sync-query.ts @@ -1,4 +1,4 @@ -import { TSESTree } from '@typescript-eslint/experimental-utils'; +import { TSESTree } from '@typescript-eslint/utils'; import { createTestingLibraryRule } from '../create-testing-library-rule'; import { getDeepestIdentifierNode } from '../node-utils'; diff --git a/lib/rules/no-container.ts b/lib/rules/no-container.ts index e64af6ca..540d67a5 100644 --- a/lib/rules/no-container.ts +++ b/lib/rules/no-container.ts @@ -1,4 +1,4 @@ -import { ASTUtils, TSESTree } from '@typescript-eslint/experimental-utils'; +import { ASTUtils, TSESTree } from '@typescript-eslint/utils'; import { createTestingLibraryRule } from '../create-testing-library-rule'; import { diff --git a/lib/rules/no-debugging-utils.ts b/lib/rules/no-debugging-utils.ts index a6357cd5..819075f4 100644 --- a/lib/rules/no-debugging-utils.ts +++ b/lib/rules/no-debugging-utils.ts @@ -1,8 +1,4 @@ -import { - ASTUtils, - TSESTree, - JSONSchema, -} from '@typescript-eslint/experimental-utils'; +import { ASTUtils, TSESTree, JSONSchema } from '@typescript-eslint/utils'; import { createTestingLibraryRule } from '../create-testing-library-rule'; import { diff --git a/lib/rules/no-dom-import.ts b/lib/rules/no-dom-import.ts index 9ae585ee..abefbf21 100644 --- a/lib/rules/no-dom-import.ts +++ b/lib/rules/no-dom-import.ts @@ -1,4 +1,4 @@ -import { TSESTree } from '@typescript-eslint/experimental-utils'; +import { TSESTree } from '@typescript-eslint/utils'; import { createTestingLibraryRule } from '../create-testing-library-rule'; import { isCallExpression } from '../node-utils'; diff --git a/lib/rules/no-manual-cleanup.ts b/lib/rules/no-manual-cleanup.ts index 45d4a1c2..b7c02ca1 100644 --- a/lib/rules/no-manual-cleanup.ts +++ b/lib/rules/no-manual-cleanup.ts @@ -1,8 +1,4 @@ -import { - ASTUtils, - TSESTree, - TSESLint, -} from '@typescript-eslint/experimental-utils'; +import { ASTUtils, TSESTree, TSESLint } from '@typescript-eslint/utils'; import { createTestingLibraryRule } from '../create-testing-library-rule'; import { diff --git a/lib/rules/no-node-access.ts b/lib/rules/no-node-access.ts index 36d232be..41e2b596 100644 --- a/lib/rules/no-node-access.ts +++ b/lib/rules/no-node-access.ts @@ -1,4 +1,4 @@ -import { TSESTree, ASTUtils } from '@typescript-eslint/experimental-utils'; +import { TSESTree, ASTUtils } from '@typescript-eslint/utils'; import { createTestingLibraryRule } from '../create-testing-library-rule'; import { ALL_RETURNING_NODES } from '../utils'; diff --git a/lib/rules/no-promise-in-fire-event.ts b/lib/rules/no-promise-in-fire-event.ts index 01027201..aca6a19b 100644 --- a/lib/rules/no-promise-in-fire-event.ts +++ b/lib/rules/no-promise-in-fire-event.ts @@ -1,4 +1,4 @@ -import { ASTUtils, TSESTree } from '@typescript-eslint/experimental-utils'; +import { ASTUtils, TSESTree } from '@typescript-eslint/utils'; import { createTestingLibraryRule } from '../create-testing-library-rule'; import { diff --git a/lib/rules/no-render-in-setup.ts b/lib/rules/no-render-in-setup.ts index 29f9a442..ad4fe705 100644 --- a/lib/rules/no-render-in-setup.ts +++ b/lib/rules/no-render-in-setup.ts @@ -1,4 +1,4 @@ -import { ASTUtils, TSESTree } from '@typescript-eslint/experimental-utils'; +import { ASTUtils, TSESTree } from '@typescript-eslint/utils'; import { createTestingLibraryRule } from '../create-testing-library-rule'; import { diff --git a/lib/rules/no-unnecessary-act.ts b/lib/rules/no-unnecessary-act.ts index 5cd9f4b1..a9cd0eec 100644 --- a/lib/rules/no-unnecessary-act.ts +++ b/lib/rules/no-unnecessary-act.ts @@ -1,4 +1,4 @@ -import { TSESTree, ASTUtils } from '@typescript-eslint/experimental-utils'; +import { TSESTree, ASTUtils } from '@typescript-eslint/utils'; import { createTestingLibraryRule } from '../create-testing-library-rule'; import { diff --git a/lib/rules/no-wait-for-empty-callback.ts b/lib/rules/no-wait-for-empty-callback.ts index 7bbfef99..b90e0b22 100644 --- a/lib/rules/no-wait-for-empty-callback.ts +++ b/lib/rules/no-wait-for-empty-callback.ts @@ -1,4 +1,4 @@ -import { ASTUtils, TSESTree } from '@typescript-eslint/experimental-utils'; +import { ASTUtils, TSESTree } from '@typescript-eslint/utils'; import { createTestingLibraryRule } from '../create-testing-library-rule'; import { diff --git a/lib/rules/no-wait-for-multiple-assertions.ts b/lib/rules/no-wait-for-multiple-assertions.ts index f3f23ebd..938f7a02 100644 --- a/lib/rules/no-wait-for-multiple-assertions.ts +++ b/lib/rules/no-wait-for-multiple-assertions.ts @@ -1,4 +1,4 @@ -import { TSESTree } from '@typescript-eslint/experimental-utils'; +import { TSESTree } from '@typescript-eslint/utils'; import { createTestingLibraryRule } from '../create-testing-library-rule'; import { diff --git a/lib/rules/no-wait-for-side-effects.ts b/lib/rules/no-wait-for-side-effects.ts index 4c919245..990fa474 100644 --- a/lib/rules/no-wait-for-side-effects.ts +++ b/lib/rules/no-wait-for-side-effects.ts @@ -1,4 +1,4 @@ -import { TSESTree } from '@typescript-eslint/experimental-utils'; +import { TSESTree } from '@typescript-eslint/utils'; import { createTestingLibraryRule } from '../create-testing-library-rule'; import { diff --git a/lib/rules/no-wait-for-snapshot.ts b/lib/rules/no-wait-for-snapshot.ts index 96450678..21704c2c 100644 --- a/lib/rules/no-wait-for-snapshot.ts +++ b/lib/rules/no-wait-for-snapshot.ts @@ -1,4 +1,4 @@ -import { ASTUtils, TSESTree } from '@typescript-eslint/experimental-utils'; +import { ASTUtils, TSESTree } from '@typescript-eslint/utils'; import { createTestingLibraryRule } from '../create-testing-library-rule'; import { diff --git a/lib/rules/prefer-explicit-assert.ts b/lib/rules/prefer-explicit-assert.ts index a8d376f0..663bbbd1 100644 --- a/lib/rules/prefer-explicit-assert.ts +++ b/lib/rules/prefer-explicit-assert.ts @@ -1,4 +1,4 @@ -import { TSESTree, ASTUtils } from '@typescript-eslint/experimental-utils'; +import { TSESTree, ASTUtils } from '@typescript-eslint/utils'; import { createTestingLibraryRule } from '../create-testing-library-rule'; import { diff --git a/lib/rules/prefer-find-by.ts b/lib/rules/prefer-find-by.ts index a5dc0eba..be5d33f8 100644 --- a/lib/rules/prefer-find-by.ts +++ b/lib/rules/prefer-find-by.ts @@ -1,8 +1,4 @@ -import { - TSESTree, - ASTUtils, - TSESLint, -} from '@typescript-eslint/experimental-utils'; +import { TSESTree, ASTUtils, TSESLint } from '@typescript-eslint/utils'; import { createTestingLibraryRule } from '../create-testing-library-rule'; import { diff --git a/lib/rules/prefer-presence-queries.ts b/lib/rules/prefer-presence-queries.ts index 611cf5ed..cb469ab6 100644 --- a/lib/rules/prefer-presence-queries.ts +++ b/lib/rules/prefer-presence-queries.ts @@ -1,4 +1,4 @@ -import { TSESTree } from '@typescript-eslint/experimental-utils'; +import { TSESTree } from '@typescript-eslint/utils'; import { createTestingLibraryRule } from '../create-testing-library-rule'; import { findClosestCallNode, isMemberExpression } from '../node-utils'; diff --git a/lib/rules/prefer-query-by-disappearance.ts b/lib/rules/prefer-query-by-disappearance.ts index bbb2a9e6..bf3e3493 100644 --- a/lib/rules/prefer-query-by-disappearance.ts +++ b/lib/rules/prefer-query-by-disappearance.ts @@ -1,4 +1,4 @@ -import { TSESTree } from '@typescript-eslint/experimental-utils'; +import { TSESTree } from '@typescript-eslint/utils'; import { createTestingLibraryRule } from '../create-testing-library-rule'; import { diff --git a/lib/rules/prefer-screen-queries.ts b/lib/rules/prefer-screen-queries.ts index acca7c5a..6889ecdd 100644 --- a/lib/rules/prefer-screen-queries.ts +++ b/lib/rules/prefer-screen-queries.ts @@ -1,4 +1,4 @@ -import { ASTUtils, TSESTree } from '@typescript-eslint/experimental-utils'; +import { ASTUtils, TSESTree } from '@typescript-eslint/utils'; import { createTestingLibraryRule } from '../create-testing-library-rule'; import { diff --git a/lib/rules/prefer-user-event.ts b/lib/rules/prefer-user-event.ts index 2e0a8958..29f3220c 100644 --- a/lib/rules/prefer-user-event.ts +++ b/lib/rules/prefer-user-event.ts @@ -1,4 +1,4 @@ -import { TSESTree, ASTUtils } from '@typescript-eslint/experimental-utils'; +import { TSESTree, ASTUtils } from '@typescript-eslint/utils'; import { createTestingLibraryRule } from '../create-testing-library-rule'; import { diff --git a/lib/rules/prefer-wait-for.ts b/lib/rules/prefer-wait-for.ts index a302ee1c..ea4e1726 100644 --- a/lib/rules/prefer-wait-for.ts +++ b/lib/rules/prefer-wait-for.ts @@ -1,4 +1,4 @@ -import { TSESTree, ASTUtils } from '@typescript-eslint/experimental-utils'; +import { TSESTree, ASTUtils } from '@typescript-eslint/utils'; import { createTestingLibraryRule } from '../create-testing-library-rule'; import { diff --git a/lib/rules/render-result-naming-convention.ts b/lib/rules/render-result-naming-convention.ts index fab06430..7b189e6e 100644 --- a/lib/rules/render-result-naming-convention.ts +++ b/lib/rules/render-result-naming-convention.ts @@ -1,4 +1,4 @@ -import { ASTUtils, TSESTree } from '@typescript-eslint/experimental-utils'; +import { ASTUtils, TSESTree } from '@typescript-eslint/utils'; import { createTestingLibraryRule } from '../create-testing-library-rule'; import { diff --git a/lib/utils/types.ts b/lib/utils/types.ts index 694d1d96..4908ccf9 100644 --- a/lib/utils/types.ts +++ b/lib/utils/types.ts @@ -1,10 +1,10 @@ -import type { TSESLint } from '@typescript-eslint/experimental-utils'; +import type { TSESLint } from '@typescript-eslint/utils'; type RecommendedConfig = | TSESLint.RuleMetaDataDocs['recommended'] | [TSESLint.RuleMetaDataDocs['recommended'], ...TOptions]; -// These 2 types are copied from @typescript-eslint/experimental-utils' CreateRuleMeta +// These 2 types are copied from @typescript-eslint/utils' CreateRuleMeta // and modified to our needs export type TestingLibraryRuleMetaDocs = Omit & { diff --git a/package.json b/package.json index da8689dd..19aacd83 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "prepare": "is-ci || husky install" }, "dependencies": { - "@typescript-eslint/experimental-utils": "^5.9.0" + "@typescript-eslint/utils": "^5.10.2" }, "devDependencies": { "@babel/eslint-plugin": "^7.16.5", @@ -50,8 +50,8 @@ "@commitlint/config-conventional": "^16.0.0", "@types/jest": "^27.4.0", "@types/node": "^16.11.19", - "@typescript-eslint/eslint-plugin": "^5.9.0", - "@typescript-eslint/parser": "^5.9.0", + "@typescript-eslint/eslint-plugin": "^5.10.2", + "@typescript-eslint/parser": "^5.10.2", "cpy-cli": "^3.1.1", "eslint": "^8.6.0", "eslint-config-kentcdodds": "^20.0.1", diff --git a/tests/fake-rule.ts b/tests/fake-rule.ts index 9f57493e..02cad182 100644 --- a/tests/fake-rule.ts +++ b/tests/fake-rule.ts @@ -2,7 +2,7 @@ * @file Fake rule to be able to test createTestingLibraryRule and * detectTestingLibraryUtils properly */ -import { TSESTree } from '@typescript-eslint/experimental-utils'; +import { TSESTree } from '@typescript-eslint/utils'; import { createTestingLibraryRule } from '../lib/create-testing-library-rule'; diff --git a/tests/lib/rules/await-async-query.test.ts b/tests/lib/rules/await-async-query.test.ts index 648b0ce5..d207c7d7 100644 --- a/tests/lib/rules/await-async-query.test.ts +++ b/tests/lib/rules/await-async-query.test.ts @@ -1,4 +1,4 @@ -import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/utils'; import rule, { RULE_NAME } from '../../../lib/rules/await-async-query'; import { diff --git a/tests/lib/rules/consistent-data-testid.test.ts b/tests/lib/rules/consistent-data-testid.test.ts index 331b5709..687cd8df 100644 --- a/tests/lib/rules/consistent-data-testid.test.ts +++ b/tests/lib/rules/consistent-data-testid.test.ts @@ -1,4 +1,4 @@ -import type { TSESLint } from '@typescript-eslint/experimental-utils'; +import type { TSESLint } from '@typescript-eslint/utils'; import rule, { MessageIds, diff --git a/tests/lib/rules/no-unnecessary-act.test.ts b/tests/lib/rules/no-unnecessary-act.test.ts index 62407e30..997570ae 100644 --- a/tests/lib/rules/no-unnecessary-act.test.ts +++ b/tests/lib/rules/no-unnecessary-act.test.ts @@ -1,4 +1,4 @@ -import type { TSESLint } from '@typescript-eslint/experimental-utils'; +import type { TSESLint } from '@typescript-eslint/utils'; import rule, { MessageIds, diff --git a/tests/lib/rules/prefer-find-by.test.ts b/tests/lib/rules/prefer-find-by.test.ts index 909b58ca..2c9d1da5 100644 --- a/tests/lib/rules/prefer-find-by.test.ts +++ b/tests/lib/rules/prefer-find-by.test.ts @@ -1,4 +1,4 @@ -import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/utils'; import rule, { WAIT_METHODS, diff --git a/tests/lib/rules/prefer-presence-queries.test.ts b/tests/lib/rules/prefer-presence-queries.test.ts index 8ff037d4..64312985 100644 --- a/tests/lib/rules/prefer-presence-queries.test.ts +++ b/tests/lib/rules/prefer-presence-queries.test.ts @@ -1,4 +1,4 @@ -import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/utils'; import rule, { RULE_NAME, diff --git a/tests/lib/rules/prefer-user-event.test.ts b/tests/lib/rules/prefer-user-event.test.ts index 4b7de9a2..5cf29e47 100644 --- a/tests/lib/rules/prefer-user-event.test.ts +++ b/tests/lib/rules/prefer-user-event.test.ts @@ -1,4 +1,4 @@ -import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/utils'; import rule, { MAPPING_TO_USER_EVENT, diff --git a/tests/lib/test-utils.ts b/tests/lib/test-utils.ts index 4c7cbf46..8770755a 100644 --- a/tests/lib/test-utils.ts +++ b/tests/lib/test-utils.ts @@ -1,6 +1,6 @@ import { resolve } from 'path'; -import { TSESLint } from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/utils'; const DEFAULT_TEST_CASE_CONFIG = { filename: 'MyComponent.test.js', diff --git a/tools/generate-configs/utils.ts b/tools/generate-configs/utils.ts index 0394c044..339755a0 100644 --- a/tools/generate-configs/utils.ts +++ b/tools/generate-configs/utils.ts @@ -1,7 +1,7 @@ import { writeFileSync } from 'fs'; import { resolve } from 'path'; -import type { TSESLint } from '@typescript-eslint/experimental-utils'; +import type { TSESLint } from '@typescript-eslint/utils'; import { format, resolveConfig } from 'prettier'; const prettierConfig = resolveConfig.sync(__dirname);