Skip to content

Commit db36086

Browse files
committed
feat: support ESLint 8.x
1 parent 95a45c9 commit db36086

Some content is hidden

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

49 files changed

+116
-186
lines changed

.eslintrc.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ module.exports = {
3434
'@typescript-eslint/ban-types': 'error',
3535
'@typescript-eslint/no-unused-vars': 'error',
3636
'eslint-comments/no-unused-disable': 'error',
37+
'eslint-plugin/require-meta-fixable': [
38+
'error',
39+
{ catchNoFixerButFixableProperty: true },
40+
],
41+
'eslint-plugin/require-meta-has-suggestions': 'error',
3742
'eslint-plugin/test-case-property-ordering': 'error',
3843
'no-else-return': 'error',
3944
'no-negated-condition': 'error',

.github/workflows/nodejs.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020

2121
- uses: actions/setup-node@v2
2222
with:
23-
node-version: 14.x
23+
node-version: 16
2424
cache: yarn
2525

2626
- name: Validate cache
@@ -38,7 +38,7 @@ jobs:
3838
- uses: actions/checkout@v2
3939
- uses: actions/setup-node@v2
4040
with:
41-
node-version: 14.x
41+
node-version: 16
4242
cache: yarn
4343
- name: install
4444
run: yarn
@@ -52,7 +52,7 @@ jobs:
5252
- uses: actions/checkout@v2
5353
- uses: actions/setup-node@v2
5454
with:
55-
node-version: 14.x
55+
node-version: 16
5656
cache: yarn
5757
- name: install
5858
run: yarn
@@ -67,9 +67,12 @@ jobs:
6767
strategy:
6868
fail-fast: false
6969
matrix:
70-
node-version: [12.x, 14.x, 16.x]
71-
eslint-version: [6, 7]
70+
node-version: [12, 14, 16]
71+
eslint-version: [6, 7, 8]
7272
ts-eslint-plugin-version: [4, 5]
73+
exclude:
74+
- eslint-version: 8
75+
ts-eslint-plugin-version: 4
7376
runs-on: ubuntu-latest
7477

7578
steps:
@@ -104,7 +107,7 @@ jobs:
104107
- uses: actions/checkout@v2
105108
- uses: actions/setup-node@v2
106109
with:
107-
node-version: 14.x
110+
node-version: 16
108111
cache: yarn
109112
- name: install
110113
run: yarn
@@ -123,7 +126,7 @@ jobs:
123126
- uses: actions/checkout@v2
124127
- uses: actions/setup-node@v2
125128
with:
126-
node-version: 14.x
129+
node-version: 16
127130
cache: yarn
128131
- name: install
129132
run: yarn
@@ -146,7 +149,7 @@ jobs:
146149
- uses: actions/checkout@v2
147150
- uses: actions/setup-node@v2
148151
with:
149-
node-version: 14.x
152+
node-version: 16
150153
cache: yarn
151154
- name: install
152155
run: yarn

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,14 @@
100100
"babel-jest": "^27.0.0",
101101
"babel-plugin-replace-ts-export-assignment": "^0.0.2",
102102
"dedent": "^0.7.0",
103-
"eslint": "^6.0.0 || ^7.0.0",
103+
"eslint": "^6.0.0 || ^7.0.0 || ^8.0.0-0",
104104
"eslint-config-prettier": "^8.3.0",
105-
"eslint-plugin-eslint-comments": "^3.1.2",
105+
"eslint-plugin-eslint-comments": "^3.2.0",
106106
"eslint-plugin-eslint-config": "^2.0.0",
107-
"eslint-plugin-eslint-plugin": "^3.5.3",
107+
"eslint-plugin-eslint-plugin": "^4.0.0-0",
108108
"eslint-plugin-import": "^2.25.1",
109-
"eslint-plugin-node": "^11.0.0",
110-
"eslint-plugin-prettier": "^3.4.1",
109+
"eslint-plugin-node": "^11.1.0",
110+
"eslint-plugin-prettier": "^4.0.0",
111111
"husky": "^7.0.2",
112112
"is-ci": "^3.0.0",
113113
"jest": "^27.0.0",
@@ -123,7 +123,7 @@
123123
},
124124
"peerDependencies": {
125125
"@typescript-eslint/eslint-plugin": "^4.0.0 || ^5.0.0",
126-
"eslint": "^6.0.0 || ^7.0.0"
126+
"eslint": "^6.0.0 || ^7.0.0 || ^8.0.0"
127127
},
128128
"peerDependenciesMeta": {
129129
"@typescript-eslint/eslint-plugin": {

src/index.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@ type RuleModule = TSESLint.RuleModule<string, unknown[]> & {
88
meta: Required<Pick<TSESLint.RuleMetaData<string>, 'docs'>>;
99
};
1010

11-
// v5 of `@typescript-eslint/experimental-utils` removed this
12-
declare module '@typescript-eslint/experimental-utils/dist/ts-eslint/Rule' {
13-
export interface RuleMetaDataDocs {
14-
category: 'Best Practices' | 'Possible Errors';
15-
}
16-
}
17-
1811
// copied from https://github.com/babel/babel/blob/d8da63c929f2d28c401571e2a43166678c555bc4/packages/babel-helpers/src/helpers.js#L602-L606
1912
/* istanbul ignore next */
2013
const interopRequireDefault = (obj: any): { default: any } =>

src/rules/__tests__/utils.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ const rule = createRule({
1818
name: __filename,
1919
meta: {
2020
docs: {
21-
category: 'Possible Errors',
2221
description: 'Fake rule for testing AST guards',
2322
recommended: false,
2423
},

src/rules/consistent-test-it.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ export default createRule<
3939
name: __filename,
4040
meta: {
4141
docs: {
42-
category: 'Best Practices',
4342
description: 'Have control over `test` and `it` usages',
4443
recommended: false,
4544
},

src/rules/expect-expect.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ export default createRule<
4747
name: __filename,
4848
meta: {
4949
docs: {
50-
category: 'Best Practices',
5150
description: 'Enforce assertion to be made in a test body',
5251
recommended: 'warn',
5352
},

src/rules/max-nested-describe.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ export default createRule({
88
name: __filename,
99
meta: {
1010
docs: {
11-
category: 'Best Practices',
1211
description: 'Enforces a maximum depth to nested describe calls',
1312
recommended: false,
1413
},

src/rules/no-alias-methods.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ export default createRule({
44
name: __filename,
55
meta: {
66
docs: {
7-
category: 'Best Practices',
87
description: 'Disallow alias methods',
98
recommended: false,
109
},

src/rules/no-commented-out-tests.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ export default createRule({
1111
name: __filename,
1212
meta: {
1313
docs: {
14-
category: 'Best Practices',
1514
description: 'Disallow commented out tests',
1615
recommended: 'warn',
1716
},

0 commit comments

Comments
 (0)