Skip to content

Commit f03f6ef

Browse files
fix: move to non-experimental TS-ESLint utils (#550)
1 parent 9b8e5fb commit f03f6ef

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+46
-65
lines changed

.eslintrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"no-restricted-imports": [
3737
"error",
3838
{
39-
"patterns": ["@typescript-eslint/experimental-utils/dist/*"]
39+
"patterns": ["@typescript-eslint/utils/dist/*"]
4040
}
4141
],
4242

lib/configs/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { join } from 'path';
22

3-
import type { TSESLint } from '@typescript-eslint/experimental-utils';
3+
import type { TSESLint } from '@typescript-eslint/utils';
44

55
import {
66
importDefault,

lib/create-testing-library-rule/detect-testing-library-utils.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import {
2-
ASTUtils,
3-
TSESLint,
4-
TSESTree,
5-
} from '@typescript-eslint/experimental-utils';
1+
import { ASTUtils, TSESLint, TSESTree } from '@typescript-eslint/utils';
62

73
import {
84
findClosestVariableDeclaratorNode,

lib/create-testing-library-rule/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ESLintUtils, TSESLint } from '@typescript-eslint/experimental-utils';
1+
import { ESLintUtils, TSESLint } from '@typescript-eslint/utils';
22

33
import { getDocsUrl, TestingLibraryRuleMeta } from '../utils';
44

lib/node-utils/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
TSESLint,
55
TSESLintScope,
66
TSESTree,
7-
} from '@typescript-eslint/experimental-utils';
7+
} from '@typescript-eslint/utils';
88

99
import {
1010
isArrayExpression,

lib/node-utils/is-node-of-type.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import {
2-
AST_NODE_TYPES,
3-
TSESTree,
4-
} from '@typescript-eslint/experimental-utils';
1+
import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
52

63
const isNodeOfType =
74
<NodeType extends AST_NODE_TYPES>(nodeType: NodeType) =>

lib/rules/await-async-query.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ASTUtils, TSESTree } from '@typescript-eslint/experimental-utils';
1+
import { ASTUtils, TSESTree } from '@typescript-eslint/utils';
22

33
import { createTestingLibraryRule } from '../create-testing-library-rule';
44
import {

lib/rules/await-async-utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TSESTree } from '@typescript-eslint/experimental-utils';
1+
import { TSESTree } from '@typescript-eslint/utils';
22

33
import { createTestingLibraryRule } from '../create-testing-library-rule';
44
import {

lib/rules/await-fire-event.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ASTUtils, TSESTree } from '@typescript-eslint/experimental-utils';
1+
import { ASTUtils, TSESTree } from '@typescript-eslint/utils';
22

33
import { createTestingLibraryRule } from '../create-testing-library-rule';
44
import {

lib/rules/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { readdirSync } from 'fs';
22
import { join, parse } from 'path';
33

4-
import { TSESLint } from '@typescript-eslint/experimental-utils';
4+
import { TSESLint } from '@typescript-eslint/utils';
55

66
import { importDefault, TestingLibraryRuleMeta } from '../utils';
77

lib/rules/no-await-sync-events.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ASTUtils, TSESTree } from '@typescript-eslint/experimental-utils';
1+
import { ASTUtils, TSESTree } from '@typescript-eslint/utils';
22

33
import { createTestingLibraryRule } from '../create-testing-library-rule';
44
import {

lib/rules/no-await-sync-query.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TSESTree } from '@typescript-eslint/experimental-utils';
1+
import { TSESTree } from '@typescript-eslint/utils';
22

33
import { createTestingLibraryRule } from '../create-testing-library-rule';
44
import { getDeepestIdentifierNode } from '../node-utils';

lib/rules/no-container.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ASTUtils, TSESTree } from '@typescript-eslint/experimental-utils';
1+
import { ASTUtils, TSESTree } from '@typescript-eslint/utils';
22

33
import { createTestingLibraryRule } from '../create-testing-library-rule';
44
import {

lib/rules/no-debugging-utils.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import {
2-
ASTUtils,
3-
TSESTree,
4-
JSONSchema,
5-
} from '@typescript-eslint/experimental-utils';
1+
import { ASTUtils, TSESTree, JSONSchema } from '@typescript-eslint/utils';
62

73
import { createTestingLibraryRule } from '../create-testing-library-rule';
84
import {

lib/rules/no-dom-import.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TSESTree } from '@typescript-eslint/experimental-utils';
1+
import { TSESTree } from '@typescript-eslint/utils';
22

33
import { createTestingLibraryRule } from '../create-testing-library-rule';
44
import { isCallExpression } from '../node-utils';

lib/rules/no-manual-cleanup.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import {
2-
ASTUtils,
3-
TSESTree,
4-
TSESLint,
5-
} from '@typescript-eslint/experimental-utils';
1+
import { ASTUtils, TSESTree, TSESLint } from '@typescript-eslint/utils';
62

73
import { createTestingLibraryRule } from '../create-testing-library-rule';
84
import {

lib/rules/no-node-access.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TSESTree, ASTUtils } from '@typescript-eslint/experimental-utils';
1+
import { TSESTree, ASTUtils } from '@typescript-eslint/utils';
22

33
import { createTestingLibraryRule } from '../create-testing-library-rule';
44
import { ALL_RETURNING_NODES } from '../utils';

lib/rules/no-promise-in-fire-event.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ASTUtils, TSESTree } from '@typescript-eslint/experimental-utils';
1+
import { ASTUtils, TSESTree } from '@typescript-eslint/utils';
22

33
import { createTestingLibraryRule } from '../create-testing-library-rule';
44
import {

lib/rules/no-render-in-setup.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ASTUtils, TSESTree } from '@typescript-eslint/experimental-utils';
1+
import { ASTUtils, TSESTree } from '@typescript-eslint/utils';
22

33
import { createTestingLibraryRule } from '../create-testing-library-rule';
44
import {

lib/rules/no-unnecessary-act.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TSESTree, ASTUtils } from '@typescript-eslint/experimental-utils';
1+
import { TSESTree, ASTUtils } from '@typescript-eslint/utils';
22

33
import { createTestingLibraryRule } from '../create-testing-library-rule';
44
import {

lib/rules/no-wait-for-empty-callback.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ASTUtils, TSESTree } from '@typescript-eslint/experimental-utils';
1+
import { ASTUtils, TSESTree } from '@typescript-eslint/utils';
22

33
import { createTestingLibraryRule } from '../create-testing-library-rule';
44
import {

lib/rules/no-wait-for-multiple-assertions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TSESTree } from '@typescript-eslint/experimental-utils';
1+
import { TSESTree } from '@typescript-eslint/utils';
22

33
import { createTestingLibraryRule } from '../create-testing-library-rule';
44
import {

lib/rules/no-wait-for-side-effects.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TSESTree } from '@typescript-eslint/experimental-utils';
1+
import { TSESTree } from '@typescript-eslint/utils';
22

33
import { createTestingLibraryRule } from '../create-testing-library-rule';
44
import {

lib/rules/no-wait-for-snapshot.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ASTUtils, TSESTree } from '@typescript-eslint/experimental-utils';
1+
import { ASTUtils, TSESTree } from '@typescript-eslint/utils';
22

33
import { createTestingLibraryRule } from '../create-testing-library-rule';
44
import {

lib/rules/prefer-explicit-assert.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TSESTree, ASTUtils } from '@typescript-eslint/experimental-utils';
1+
import { TSESTree, ASTUtils } from '@typescript-eslint/utils';
22

33
import { createTestingLibraryRule } from '../create-testing-library-rule';
44
import {

lib/rules/prefer-find-by.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import {
2-
TSESTree,
3-
ASTUtils,
4-
TSESLint,
5-
} from '@typescript-eslint/experimental-utils';
1+
import { TSESTree, ASTUtils, TSESLint } from '@typescript-eslint/utils';
62

73
import { createTestingLibraryRule } from '../create-testing-library-rule';
84
import {

lib/rules/prefer-presence-queries.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TSESTree } from '@typescript-eslint/experimental-utils';
1+
import { TSESTree } from '@typescript-eslint/utils';
22

33
import { createTestingLibraryRule } from '../create-testing-library-rule';
44
import { findClosestCallNode, isMemberExpression } from '../node-utils';

lib/rules/prefer-query-by-disappearance.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TSESTree } from '@typescript-eslint/experimental-utils';
1+
import { TSESTree } from '@typescript-eslint/utils';
22

33
import { createTestingLibraryRule } from '../create-testing-library-rule';
44
import {

lib/rules/prefer-screen-queries.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ASTUtils, TSESTree } from '@typescript-eslint/experimental-utils';
1+
import { ASTUtils, TSESTree } from '@typescript-eslint/utils';
22

33
import { createTestingLibraryRule } from '../create-testing-library-rule';
44
import {

lib/rules/prefer-user-event.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TSESTree, ASTUtils } from '@typescript-eslint/experimental-utils';
1+
import { TSESTree, ASTUtils } from '@typescript-eslint/utils';
22

33
import { createTestingLibraryRule } from '../create-testing-library-rule';
44
import {

lib/rules/prefer-wait-for.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TSESTree, ASTUtils } from '@typescript-eslint/experimental-utils';
1+
import { TSESTree, ASTUtils } from '@typescript-eslint/utils';
22

33
import { createTestingLibraryRule } from '../create-testing-library-rule';
44
import {

lib/rules/render-result-naming-convention.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ASTUtils, TSESTree } from '@typescript-eslint/experimental-utils';
1+
import { ASTUtils, TSESTree } from '@typescript-eslint/utils';
22

33
import { createTestingLibraryRule } from '../create-testing-library-rule';
44
import {

lib/utils/types.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import type { TSESLint } from '@typescript-eslint/experimental-utils';
1+
import type { TSESLint } from '@typescript-eslint/utils';
22

33
type RecommendedConfig<TOptions extends readonly unknown[]> =
44
| TSESLint.RuleMetaDataDocs['recommended']
55
| [TSESLint.RuleMetaDataDocs['recommended'], ...TOptions];
66

7-
// These 2 types are copied from @typescript-eslint/experimental-utils' CreateRuleMeta
7+
// These 2 types are copied from @typescript-eslint/utils' CreateRuleMeta
88
// and modified to our needs
99
export type TestingLibraryRuleMetaDocs<TOptions extends readonly unknown[]> =
1010
Omit<TSESLint.RuleMetaDataDocs, 'recommended' | 'url'> & {

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,16 @@
4242
"prepare": "is-ci || husky install"
4343
},
4444
"dependencies": {
45-
"@typescript-eslint/experimental-utils": "^5.9.0"
45+
"@typescript-eslint/utils": "^5.10.2"
4646
},
4747
"devDependencies": {
4848
"@babel/eslint-plugin": "^7.16.5",
4949
"@commitlint/cli": "^16.0.2",
5050
"@commitlint/config-conventional": "^16.0.0",
5151
"@types/jest": "^27.4.0",
5252
"@types/node": "^16.11.19",
53-
"@typescript-eslint/eslint-plugin": "^5.9.0",
54-
"@typescript-eslint/parser": "^5.9.0",
53+
"@typescript-eslint/eslint-plugin": "^5.10.2",
54+
"@typescript-eslint/parser": "^5.10.2",
5555
"cpy-cli": "^3.1.1",
5656
"eslint": "^8.6.0",
5757
"eslint-config-kentcdodds": "^20.0.1",

tests/fake-rule.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @file Fake rule to be able to test createTestingLibraryRule and
33
* detectTestingLibraryUtils properly
44
*/
5-
import { TSESTree } from '@typescript-eslint/experimental-utils';
5+
import { TSESTree } from '@typescript-eslint/utils';
66

77
import { createTestingLibraryRule } from '../lib/create-testing-library-rule';
88

tests/lib/rules/await-async-query.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TSESLint } from '@typescript-eslint/experimental-utils';
1+
import { TSESLint } from '@typescript-eslint/utils';
22

33
import rule, { RULE_NAME } from '../../../lib/rules/await-async-query';
44
import {

tests/lib/rules/consistent-data-testid.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { TSESLint } from '@typescript-eslint/experimental-utils';
1+
import type { TSESLint } from '@typescript-eslint/utils';
22

33
import rule, {
44
MessageIds,

tests/lib/rules/no-unnecessary-act.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { TSESLint } from '@typescript-eslint/experimental-utils';
1+
import type { TSESLint } from '@typescript-eslint/utils';
22

33
import rule, {
44
MessageIds,

tests/lib/rules/prefer-find-by.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TSESLint } from '@typescript-eslint/experimental-utils';
1+
import { TSESLint } from '@typescript-eslint/utils';
22

33
import rule, {
44
WAIT_METHODS,

tests/lib/rules/prefer-presence-queries.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TSESLint } from '@typescript-eslint/experimental-utils';
1+
import { TSESLint } from '@typescript-eslint/utils';
22

33
import rule, {
44
RULE_NAME,

tests/lib/rules/prefer-user-event.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TSESLint } from '@typescript-eslint/experimental-utils';
1+
import { TSESLint } from '@typescript-eslint/utils';
22

33
import rule, {
44
MAPPING_TO_USER_EVENT,

tests/lib/test-utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { resolve } from 'path';
22

3-
import { TSESLint } from '@typescript-eslint/experimental-utils';
3+
import { TSESLint } from '@typescript-eslint/utils';
44

55
const DEFAULT_TEST_CASE_CONFIG = {
66
filename: 'MyComponent.test.js',

tools/generate-configs/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { writeFileSync } from 'fs';
22
import { resolve } from 'path';
33

4-
import type { TSESLint } from '@typescript-eslint/experimental-utils';
4+
import type { TSESLint } from '@typescript-eslint/utils';
55
import { format, resolveConfig } from 'prettier';
66

77
const prettierConfig = resolveConfig.sync(__dirname);

0 commit comments

Comments
 (0)