Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.

Commit abcd666

Browse files
Replace devDependency @typescript-eslint/experimental-utils with @typescript-eslint/utils (#453)
1 parent e8d2d08 commit abcd666

Some content is hidden

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

51 files changed

+52
-76
lines changed

package-lock.json

+1-25
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
"@types/lodash": "4.14.182",
4545
"@types/minimist": "1.2.2",
4646
"@types/node": "14.14.31",
47-
"@typescript-eslint/experimental-utils": "5.30.7",
4847
"@typescript-eslint/parser": "5.30.7",
48+
"@typescript-eslint/utils": "5.30.7",
4949
"eslint": "8.47.0",
5050
"eslint-config-prettier": "8.5.0",
5151
"eslint-plugin-import": "2.26.0",

src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* along with this program; if not, write to the Free Software Foundation,
1818
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1919
*/
20-
import type { TSESLint } from '@typescript-eslint/experimental-utils';
20+
import type { TSESLint } from '@typescript-eslint/utils';
2121

2222
const sonarjsRules: string[] = [
2323
'cognitive-complexity',

src/rules/cognitive-complexity.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S3776
2121

22-
import type { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
22+
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
2323
import { isIfStatement, isLogicalExpression } from '../utils/nodes';
2424
import {
2525
getFirstToken,

src/rules/elseif-without-else.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S126
2121

22-
import type { TSESTree, TSESLint } from '@typescript-eslint/experimental-utils';
22+
import type { TSESTree, TSESLint } from '@typescript-eslint/utils';
2323
import docsUrl from '../utils/docs-url';
2424

2525
const rule: TSESLint.RuleModule<string, string[]> = {

src/rules/max-switch-cases.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S1479
2121

22-
import type { TSESTree, TSESLint } from '@typescript-eslint/experimental-utils';
22+
import type { TSESTree, TSESLint } from '@typescript-eslint/utils';
2323
import docsUrl from '../utils/docs-url';
2424

2525
const DEFAULT_MAX_SWITCH_CASES = 30;

src/rules/no-all-duplicated-branches.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S3923
2121

22-
import type { TSESTree, TSESLint } from '@typescript-eslint/experimental-utils';
22+
import type { TSESTree, TSESLint } from '@typescript-eslint/utils';
2323
import { isIfStatement } from '../utils/nodes';
2424
import { areEquivalent } from '../utils/equivalence';
2525
import { collectIfBranches, collectSwitchBranches } from '../utils/conditions';

src/rules/no-collapsible-if.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S1066
2121

22-
import type { TSESTree, TSESLint } from '@typescript-eslint/experimental-utils';
22+
import type { TSESTree, TSESLint } from '@typescript-eslint/utils';
2323
import { isIfStatement, isBlockStatement } from '../utils/nodes';
2424
import { report, issueLocation } from '../utils/locations';
2525
import docsUrl from '../utils/docs-url';

src/rules/no-collection-size-mischeck.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S3981
2121

22-
import type { TSESTree, TSESLint } from '@typescript-eslint/experimental-utils';
22+
import type { TSESTree, TSESLint } from '@typescript-eslint/utils';
2323
import { isRequiredParserServices, RequiredParserServices } from '../utils/parser-services';
2424
import docsUrl from '../utils/docs-url';
2525

src/rules/no-duplicate-string.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S1192
2121

22-
import type { TSESTree, TSESLint } from '@typescript-eslint/experimental-utils';
22+
import type { TSESTree, TSESLint } from '@typescript-eslint/utils';
2323
import docsUrl from '../utils/docs-url';
2424
import { issueLocation, report } from '../utils/locations';
2525

src/rules/no-duplicated-branches.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S1871
2121

22-
import type { TSESTree, TSESLint } from '@typescript-eslint/experimental-utils';
22+
import type { TSESTree, TSESLint } from '@typescript-eslint/utils';
2323
import { isIfStatement, isBlockStatement } from '../utils/nodes';
2424
import { areEquivalent } from '../utils/equivalence';
2525
import { collectIfBranches, takeWithoutBreak, collectSwitchBranches } from '../utils/conditions';

src/rules/no-element-overwrite.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S4143
2121

22-
import type { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
22+
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
2323
import { areEquivalent } from '../utils/equivalence';
2424
import {
2525
isExpressionStatement,

src/rules/no-empty-collection.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S4158
2121

22-
import type { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
22+
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
2323
import {
2424
isIdentifier,
2525
findFirstMatchingAncestor,

src/rules/no-extra-arguments.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S930
2121

22-
import type { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
22+
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
2323
import {
2424
isArrowFunctionExpression,
2525
isFunctionDeclaration,

src/rules/no-gratuitous-expressions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S2589
2121

22-
import type { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
22+
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
2323
import { report } from '../utils/locations';
2424
import { isIdentifier, isIfStatement } from '../utils/nodes';
2525
import docsUrl from '../utils/docs-url';

src/rules/no-identical-conditions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S1862
2121

22-
import type { TSESTree, TSESLint } from '@typescript-eslint/experimental-utils';
22+
import type { TSESTree, TSESLint } from '@typescript-eslint/utils';
2323
import { areEquivalent } from '../utils/equivalence';
2424
import { report, issueLocation } from '../utils/locations';
2525
import docsUrl from '../utils/docs-url';

src/rules/no-identical-expressions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S1764
2121

22-
import type { TSESTree, TSESLint } from '@typescript-eslint/experimental-utils';
22+
import type { TSESTree, TSESLint } from '@typescript-eslint/utils';
2323
import { isIdentifier, isLiteral } from '../utils/nodes';
2424
import { areEquivalent } from '../utils/equivalence';
2525
import { report, issueLocation, IssueLocation } from '../utils/locations';

src/rules/no-identical-functions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S4144
2121

22-
import type { TSESTree, TSESLint } from '@typescript-eslint/experimental-utils';
22+
import type { TSESTree, TSESLint } from '@typescript-eslint/utils';
2323
import { areEquivalent } from '../utils/equivalence';
2424
import { getMainFunctionTokenLocation, report, issueLocation } from '../utils/locations';
2525
import docsUrl from '../utils/docs-url';

src/rules/no-ignored-return.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S2201
2121

22-
import type { TSESTree, TSESLint } from '@typescript-eslint/experimental-utils';
22+
import type { TSESTree, TSESLint } from '@typescript-eslint/utils';
2323
import { isRequiredParserServices, RequiredParserServices } from '../utils/parser-services';
2424
import docsUrl from '../utils/docs-url';
2525
import { getTypeFromTreeNode } from '../utils';

src/rules/no-inverted-boolean-check.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S1940
2121

22-
import type { TSESTree, TSESLint } from '@typescript-eslint/experimental-utils';
22+
import type { TSESTree, TSESLint } from '@typescript-eslint/utils';
2323
import { isBinaryExpression } from '../utils/nodes';
2424
import docsUrl from '../utils/docs-url';
2525

src/rules/no-nested-switch.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S1821
2121

22-
import type { TSESTree, TSESLint } from '@typescript-eslint/experimental-utils';
22+
import type { TSESTree, TSESLint } from '@typescript-eslint/utils';
2323
import docsUrl from '../utils/docs-url';
2424

2525
const rule: TSESLint.RuleModule<string, string[]> = {

src/rules/no-nested-template-literals.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S4624
2121

22-
import type { TSESTree, TSESLint } from '@typescript-eslint/experimental-utils';
22+
import type { TSESTree, TSESLint } from '@typescript-eslint/utils';
2323
import { ancestorsChain } from '../utils';
2424
import docsUrl from '../utils/docs-url';
2525

src/rules/no-one-iteration-loop.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S1751
2121

22-
import type { TSESTree, TSESLint } from '@typescript-eslint/experimental-utils';
22+
import type { TSESTree, TSESLint } from '@typescript-eslint/utils';
2323
import { Rule } from 'eslint';
2424
import { isContinueStatement } from '../utils/nodes';
2525
import docsUrl from '../utils/docs-url';
@@ -38,7 +38,7 @@ const rule: TSESLint.RuleModule<string, string[]> = {
3838
url: docsUrl(__filename),
3939
},
4040
},
41-
// @ts-ignore The typings of @typescript-eslint/experimental-utils does not contain the 'onX' methods.
41+
// @ts-ignore The typings of @typescript-eslint/utils does not contain the 'onX' methods.
4242
create(context) {
4343
const loopingNodes: Set<TSESTree.Node> = new Set();
4444
const loops: Set<TSESTree.Node> = new Set();

src/rules/no-redundant-boolean.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S1125
2121

22-
import type { TSESTree, TSESLint } from '@typescript-eslint/experimental-utils';
22+
import type { TSESTree, TSESLint } from '@typescript-eslint/utils';
2323
import { isBooleanLiteral, isIfStatement, isConditionalExpression } from '../utils/nodes';
2424
import docsUrl from '../utils/docs-url';
2525

src/rules/no-redundant-jump.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S3626
2121

22-
import type { TSESTree, TSESLint } from '@typescript-eslint/experimental-utils';
22+
import type { TSESTree, TSESLint } from '@typescript-eslint/utils';
2323
import docsUrl from '../utils/docs-url';
2424

2525
const loops = 'WhileStatement, ForStatement, DoWhileStatement, ForInStatement, ForOfStatement';

src/rules/no-same-line-conditional.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S3972
2121

22-
import type { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
22+
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
2323
import docsUrl from '../utils/docs-url';
2424
import { issueLocation, report } from '../utils/locations';
2525

src/rules/no-small-switch.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S1301
2121

22-
import type { TSESTree, TSESLint } from '@typescript-eslint/experimental-utils';
22+
import type { TSESTree, TSESLint } from '@typescript-eslint/utils';
2323
import docsUrl from '../utils/docs-url';
2424

2525
const rule: TSESLint.RuleModule<string, string[]> = {

src/rules/no-unused-collection.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S4030
2121

22-
import type { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
22+
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
2323
import { collectionConstructor, writingMethods } from '../utils/collections';
2424
import docsUrl from '../utils/docs-url';
2525

src/rules/no-use-of-empty-return-value.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S3699
2121

22-
import { TSESTree, TSESLint } from '@typescript-eslint/experimental-utils';
22+
import { TSESTree, TSESLint } from '@typescript-eslint/utils';
2323
import { isFunctionExpression, isArrowFunctionExpression, isBlockStatement } from '../utils/nodes';
2424
import docsUrl from '../utils/docs-url';
2525

src/rules/no-useless-catch.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S1940
2121

22-
import type { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
22+
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
2323
import { isThrowStatement } from '../utils/nodes';
2424
import { areEquivalent } from '../utils/equivalence';
2525
import docsUrl from '../utils/docs-url';

src/rules/non-existent-operator.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S2757
2121

22-
import type { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
22+
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
2323
import docsUrl from '../utils/docs-url';
2424

2525
const rule: TSESLint.RuleModule<string, string[]> = {

src/rules/prefer-immediate-return.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S1488
2121

22-
import type { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
22+
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
2323
import {
2424
isReturnStatement,
2525
isThrowStatement,

src/rules/prefer-object-literal.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S2428
2121

22-
import type { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
22+
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
2323
import {
2424
isModuleDeclaration,
2525
isVariableDeclaration,

src/rules/prefer-single-boolean-return.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S1126
21-
import type { TSESTree, TSESLint } from '@typescript-eslint/experimental-utils';
21+
import type { TSESTree, TSESLint } from '@typescript-eslint/utils';
2222
import {
2323
isReturnStatement,
2424
isBlockStatement,

src/rules/prefer-while.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
// https://sonarsource.github.io/rspec/#/rspec/S1264
2121

22-
import type { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
22+
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
2323
import docsUrl from '../utils/docs-url';
2424

2525
const rule: TSESLint.RuleModule<string, string[]> = {

src/utils/conditions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* along with this program; if not, write to the Free Software Foundation,
1818
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1919
*/
20-
import type { TSESTree } from '@typescript-eslint/experimental-utils';
20+
import type { TSESTree } from '@typescript-eslint/utils';
2121
import { isIfStatement } from './nodes';
2222

2323
/** Returns a list of statements corresponding to a `if - else if - else` chain */

src/utils/equivalence.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* along with this program; if not, write to the Free Software Foundation,
1818
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1919
*/
20-
import type { TSESTree, TSESLint } from '@typescript-eslint/experimental-utils';
20+
import type { TSESTree, TSESLint } from '@typescript-eslint/utils';
2121

2222
/**
2323
* Equivalence is implemented by comparing node types and their tokens.

src/utils/jsx.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1919
*/
2020

21-
import type { TSESTree } from '@typescript-eslint/experimental-utils';
21+
import type { TSESTree } from '@typescript-eslint/utils';
2222

2323
export function getJsxShortCircuitNodes(logicalExpression: TSESTree.LogicalExpression) {
2424
if (logicalExpression.parent?.type !== 'JSXExpressionContainer') {

src/utils/locations.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1919
*/
2020

21-
import type { TSESTree, TSESLint } from '@typescript-eslint/experimental-utils';
21+
import type { TSESTree, TSESLint } from '@typescript-eslint/utils';
2222

2323
type Writeable<T> = { -readonly [P in keyof T]: T[P] };
2424
export type MutableReportDescriptor = Writeable<TSESLint.ReportDescriptor<string>>;

0 commit comments

Comments
 (0)