Skip to content

Commit d9587c7

Browse files
Update eslint (major) (#400)
* Update eslint * Update code to use stabilized APIs * Use absolute parser path eslint/eslint#11728 --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Luiz Ferraz <[email protected]>
1 parent 87ddbae commit d9587c7

File tree

16 files changed

+818
-295
lines changed

16 files changed

+818
-295
lines changed

package-lock.json

Lines changed: 774 additions & 249 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,30 +37,29 @@
3737
],
3838
"dependencies": {
3939
"@rushstack/eslint-patch": "^1.1",
40-
"@typescript-eslint/eslint-plugin": "^5.10",
41-
"@typescript-eslint/experimental-utils": "^5.10",
40+
"@typescript-eslint/eslint-plugin": "^6.4.0",
41+
"@typescript-eslint/utils": "^6.4.0",
4242
"eslint-config-airbnb": "^19.0",
4343
"eslint-config-airbnb-base": "^15.0",
4444
"eslint-plugin-cypress": "^2.12",
4545
"eslint-plugin-eslint-comments": "^3.2.0",
4646
"eslint-plugin-import": "^2.25",
4747
"eslint-plugin-import-newlines": "^1.1",
4848
"eslint-plugin-jest": "^27.0.0",
49-
"eslint-plugin-jest-dom": "^4.0",
49+
"eslint-plugin-jest-dom": "^5.0.0",
5050
"eslint-plugin-jsx-a11y": "^6.5",
5151
"eslint-plugin-newline-destructuring": "^1.0.1",
5252
"eslint-plugin-no-smart-quotes": "^1.3",
5353
"eslint-plugin-react": "^7.28",
5454
"eslint-plugin-react-hooks": "^4.3",
55-
"eslint-plugin-testing-library": "^5.0"
55+
"eslint-plugin-testing-library": "^6.0.0"
5656
},
5757
"devDependencies": {
5858
"@types/eslint": "^8.4",
5959
"@types/jest": "^29.0.0",
6060
"@types/semver": "^7.3.12",
61-
"@typescript-eslint/parser": "^5.10",
62-
"@typescript-eslint/types": "^5.10",
63-
"@typescript-eslint/utils": "^5.10",
61+
"@typescript-eslint/parser": "^6.4.0",
62+
"@typescript-eslint/types": "^6.4.0",
6463
"eslint": "^8.8",
6564
"eslint-plugin-eslint-plugin": "^5.0.0",
6665
"eslint-plugin-self": "^1.2.1",
@@ -69,7 +68,7 @@
6968
"typescript": "^5.0.0"
7069
},
7170
"peerDependencies": {
72-
"@typescript-eslint/parser": ">= 5",
71+
"@typescript-eslint/parser": ">= 6",
7372
"eslint": ">= 8"
7473
}
7574
}

src/rules/argument-spacing/index.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import {ESLintUtils} from '@typescript-eslint/utils';
1+
import {RuleTester} from '@typescript-eslint/utils/ts-eslint';
22
import {argumentSpacing} from './index';
33

4-
const ruleTester = new ESLintUtils.RuleTester({
5-
parser: '@typescript-eslint/parser',
4+
const ruleTester = new RuleTester({
5+
parser: require.resolve('@typescript-eslint/parser'),
66
});
77

88
ruleTester.run('argument-spacing', argumentSpacing, {

src/rules/argument-spacing/index.ts

Lines changed: 2 additions & 2 deletions
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
import {createRule} from '../createRule';
33

44
export const argumentSpacing = createRule({
@@ -8,7 +8,7 @@ export const argumentSpacing = createRule({
88
docs: {
99
description: 'Enforces a surrounding line break before and after '
1010
+ 'the argument list in multiline functional calls.',
11-
recommended: 'error',
11+
recommended: 'recommended',
1212
},
1313
fixable: 'whitespace',
1414
schema: [],

src/rules/complex-expression-spacing/index.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import {ESLintUtils} from '@typescript-eslint/utils';
1+
import {RuleTester} from '@typescript-eslint/utils/ts-eslint';
22
import {complexExpressionSpacing} from './index';
33

4-
const ruleTester = new ESLintUtils.RuleTester({
5-
parser: '@typescript-eslint/parser',
4+
const ruleTester = new RuleTester({
5+
parser: require.resolve('@typescript-eslint/parser'),
66
});
77

88
ruleTester.run('complex-expression-spacing', complexExpressionSpacing, {

src/rules/complex-expression-spacing/index.ts

Lines changed: 2 additions & 2 deletions
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
import {createRule} from '../createRule';
33

44
export const complexExpressionSpacing = createRule({
@@ -7,7 +7,7 @@ export const complexExpressionSpacing = createRule({
77
type: 'suggestion',
88
docs: {
99
description: 'Enforces a surrounding line break in complex expression.',
10-
recommended: 'error',
10+
recommended: 'recommended',
1111
},
1212
fixable: 'whitespace',
1313
schema: [],

src/rules/createRule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {ESLintUtils} from '@typescript-eslint/experimental-utils';
1+
import {ESLintUtils} from '@typescript-eslint/utils';
22

33
export const createRule = ESLintUtils.RuleCreator(
44
name => `https://github.com/croct-tech/coding-standard-js/tree/master/docs/${name}.md`,

src/rules/jsx-attribute-spacing/index.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import {ESLintUtils} from '@typescript-eslint/utils';
1+
import {RuleTester} from '@typescript-eslint/utils/ts-eslint';
22
import {jsxAttributeSpacing} from './index';
33

4-
const ruleTester = new ESLintUtils.RuleTester({
5-
parser: '@typescript-eslint/parser',
4+
const ruleTester = new RuleTester({
5+
parser: require.resolve('@typescript-eslint/parser'),
66
parserOptions: {
77
ecmaFeatures: {
88
jsx: true,

src/rules/jsx-attribute-spacing/index.ts

Lines changed: 2 additions & 2 deletions
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
import {createRule} from '../createRule';
33

44
export const jsxAttributeSpacing = createRule({
@@ -7,7 +7,7 @@ export const jsxAttributeSpacing = createRule({
77
type: 'suggestion',
88
docs: {
99
description: 'Enforces a surrounding line break in multiline JSX attributes.',
10-
recommended: 'error',
10+
recommended: 'recommended',
1111
},
1212
fixable: 'whitespace',
1313
schema: [],

src/rules/min-chained-call-depth/index.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import {ESLintUtils} from '@typescript-eslint/utils';
1+
import {RuleTester} from '@typescript-eslint/utils/ts-eslint';
22
import {minChainedCallDepth} from './index';
33

4-
const ruleTester = new ESLintUtils.RuleTester({
5-
parser: '@typescript-eslint/parser',
4+
const ruleTester = new RuleTester({
5+
parser: require.resolve('@typescript-eslint/parser'),
66
parserOptions: {
77
ecmaFeatures: {
88
jsx: true,

0 commit comments

Comments
 (0)