Skip to content

Commit

Permalink
fix: move to non-experimental TS-ESLint utils
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey committed Feb 1, 2022
1 parent 9b8e5fb commit bff5c09
Show file tree
Hide file tree
Showing 43 changed files with 44 additions and 63 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Expand Up @@ -36,7 +36,7 @@
"no-restricted-imports": [
"error",
{
"patterns": ["@typescript-eslint/experimental-utils/dist/*"]
"patterns": ["@typescript-eslint/utils/dist/*"]
}
],

Expand Down
2 changes: 1 addition & 1 deletion 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,
Expand Down
@@ -1,8 +1,4 @@
import {
ASTUtils,
TSESLint,
TSESTree,
} from '@typescript-eslint/experimental-utils';
import { ASTUtils, TSESLint, TSESTree } from '@typescript-eslint/utils';

import {
findClosestVariableDeclaratorNode,
Expand Down
2 changes: 1 addition & 1 deletion 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';

Expand Down
2 changes: 1 addition & 1 deletion lib/node-utils/index.ts
Expand Up @@ -4,7 +4,7 @@ import {
TSESLint,
TSESLintScope,
TSESTree,
} from '@typescript-eslint/experimental-utils';
} from '@typescript-eslint/utils';

import {
isArrayExpression,
Expand Down
5 changes: 1 addition & 4 deletions 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 extends AST_NODE_TYPES>(nodeType: NodeType) =>
Expand Down
2 changes: 1 addition & 1 deletion 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 {
Expand Down
2 changes: 1 addition & 1 deletion 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 {
Expand Down
2 changes: 1 addition & 1 deletion 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 {
Expand Down
2 changes: 1 addition & 1 deletion 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';

Expand Down
2 changes: 1 addition & 1 deletion 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 {
Expand Down
2 changes: 1 addition & 1 deletion 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';
Expand Down
2 changes: 1 addition & 1 deletion 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 {
Expand Down
6 changes: 1 addition & 5 deletions 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 {
Expand Down
2 changes: 1 addition & 1 deletion 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';
Expand Down
6 changes: 1 addition & 5 deletions 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 {
Expand Down
2 changes: 1 addition & 1 deletion 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';
Expand Down
2 changes: 1 addition & 1 deletion 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 {
Expand Down
2 changes: 1 addition & 1 deletion 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 {
Expand Down
2 changes: 1 addition & 1 deletion 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 {
Expand Down
2 changes: 1 addition & 1 deletion 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 {
Expand Down
2 changes: 1 addition & 1 deletion 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 {
Expand Down
2 changes: 1 addition & 1 deletion 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 {
Expand Down
2 changes: 1 addition & 1 deletion 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 {
Expand Down
2 changes: 1 addition & 1 deletion 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 {
Expand Down
6 changes: 1 addition & 5 deletions 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 {
Expand Down
2 changes: 1 addition & 1 deletion 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';
Expand Down
2 changes: 1 addition & 1 deletion 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 {
Expand Down
2 changes: 1 addition & 1 deletion 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 {
Expand Down
2 changes: 1 addition & 1 deletion 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 {
Expand Down
2 changes: 1 addition & 1 deletion 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 {
Expand Down
2 changes: 1 addition & 1 deletion 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 {
Expand Down
4 changes: 2 additions & 2 deletions 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<TOptions extends readonly unknown[]> =
| 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<TOptions extends readonly unknown[]> =
Omit<TSESLint.RuleMetaDataDocs, 'recommended' | 'url'> & {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion tests/fake-rule.ts
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion 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 {
Expand Down
2 changes: 1 addition & 1 deletion 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,
Expand Down
2 changes: 1 addition & 1 deletion 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,
Expand Down
2 changes: 1 addition & 1 deletion 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,
Expand Down
2 changes: 1 addition & 1 deletion 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,
Expand Down
2 changes: 1 addition & 1 deletion 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,
Expand Down
2 changes: 1 addition & 1 deletion 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',
Expand Down
2 changes: 1 addition & 1 deletion 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);
Expand Down

0 comments on commit bff5c09

Please sign in to comment.