Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: move to non-experimental TS-ESLint utils #550

Merged
merged 1 commit into from
Feb 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@
"prepare": "is-ci || husky install"
},
"dependencies": {
"@typescript-eslint/experimental-utils": "^5.9.0"
"@typescript-eslint/utils": "^5.10.2"
MichaelDeBoey marked this conversation as resolved.
Show resolved Hide resolved
},
"devDependencies": {
"@babel/eslint-plugin": "^7.16.5",
"@commitlint/cli": "^16.0.2",
"@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",
Expand Down
2 changes: 1 addition & 1 deletion tests/fake-rule.ts
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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