Skip to content

Commit eb31074

Browse files
committed
feat: support ESLint 8.x
BREAKING CHANGE: Requires Node@^12.22.0 || ^14.17.0 || >=16.0.0 BREAKING CHANGE: Requires ESLint@^8.0.0
1 parent bf3f302 commit eb31074

File tree

5 files changed

+36
-37
lines changed

5 files changed

+36
-37
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ dist: focal
33
arch: arm64-graviton2
44
language: node_js
55
node_js:
6-
- 10
6+
- 12
77
script:
88
- npm run test
99
after_success:

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ This is how Canonical ruleset compares to other popular configurations.
5353

5454
|Rule|Canonical|[Airbnb](https://www.npmjs.com/package/eslint-config-airbnb)|[Google](https://www.npmjs.com/package/eslint-config-google)|[Standard](https://www.npmjs.com/package/eslint-config-standard)|
5555
|---|---|---|---|---|
56+
|`@babel/new-cap`|off|N/A 👻|N/A 👻|N/A 👻|
57+
|`@babel/no-invalid-this`|error 🚨|N/A 👻|N/A 👻|N/A 👻|
58+
|`@babel/object-curly-spacing`|error 🚨|N/A 👻|N/A 👻|N/A 👻|
59+
|`@babel/valid-typeof`|error 🚨|N/A 👻|N/A 👻|N/A 👻|
5660
|[`@typescript-eslint/@typescript-eslint/explicit-member-accessibility`](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/@typescript-eslint/explicit-member-accessibility.md)|off|N/A 👻|N/A 👻|N/A 👻|
5761
|[`@typescript-eslint/adjacent-overload-signatures`](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/adjacent-overload-signatures.md)|error 🚨|N/A 👻|N/A 👻|N/A 👻|
5862
|[`@typescript-eslint/array-type`](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/array-type.md)|error 🚨|N/A 👻|N/A 👻|N/A 👻|
@@ -174,10 +178,6 @@ This is how Canonical ruleset compares to other popular configurations.
174178
|[`ava/use-t-well`](https://github.com/avajs/eslint-plugin-ava/blob/master/docs/rules/use-t-well.md)|error 🚨|N/A 👻|N/A 👻|N/A 👻|
175179
|[`ava/use-test`](https://github.com/avajs/eslint-plugin-ava/blob/master/docs/rules/use-test.md)|error 🚨|N/A 👻|N/A 👻|N/A 👻|
176180
|[`ava/use-true-false`](https://github.com/avajs/eslint-plugin-ava/blob/master/docs/rules/use-true-false.md)|error 🚨|N/A 👻|N/A 👻|N/A 👻|
177-
|`babel/new-cap`|off|N/A 👻|N/A 👻|N/A 👻|
178-
|`babel/no-invalid-this`|error 🚨|N/A 👻|N/A 👻|N/A 👻|
179-
|`babel/object-curly-spacing`|error 🚨|N/A 👻|N/A 👻|N/A 👻|
180-
|`babel/valid-typeof`|error 🚨|N/A 👻|N/A 👻|N/A 👻|
181181
|[`block-scoped-var`](https://eslint.org/docs/rules/block-scoped-var)|error 🚨|error 🚨|N/A 👻|N/A 👻|
182182
|[`block-spacing`](https://eslint.org/docs/rules/block-spacing)|error 🚨|error 🚨|error 🚨|error 🚨|
183183
|[`brace-style`](https://eslint.org/docs/rules/brace-style)|error 🚨|error 🚨|error 🚨|error 🚨|

configurations/eslintrc.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"sort-keys-fix",
2121
"fp",
2222
"no-use-extend-native",
23-
"babel",
23+
"@babel",
2424
"import",
2525
"jsdoc",
2626
"promise",
@@ -29,6 +29,13 @@
2929
"eslint-comments"
3030
],
3131
"rules": {
32+
"@babel/new-cap": 0,
33+
"@babel/no-invalid-this": 2,
34+
"@babel/object-curly-spacing": [
35+
2,
36+
"never"
37+
],
38+
"@babel/valid-typeof": 2,
3239
"accessor-pairs": 2,
3340
"array-bracket-newline": 0,
3441
"array-bracket-spacing": [
@@ -55,13 +62,6 @@
5562
"before": true
5663
}
5764
],
58-
"babel/new-cap": 0,
59-
"babel/no-invalid-this": 2,
60-
"babel/object-curly-spacing": [
61-
2,
62-
"never"
63-
],
64-
"babel/valid-typeof": 2,
6565
"block-scoped-var": 2,
6666
"block-spacing": [
6767
2,

package.json

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,44 +18,43 @@
1818
]
1919
},
2020
"dependencies": {
21-
"@babel/eslint-parser": "^7.13.14",
22-
"@typescript-eslint/eslint-plugin": "^4.22.0",
23-
"@typescript-eslint/parser": "^4.22.0",
24-
"eslint-plugin-ava": "^12.0.0",
25-
"eslint-plugin-babel": "^5.3.1",
26-
"eslint-plugin-cypress": "^2.11.2",
21+
"@babel/eslint-parser": "^7.15.8",
22+
"@babel/eslint-plugin": "^7.14.5",
23+
"@typescript-eslint/eslint-plugin": "^5.0.0",
24+
"@typescript-eslint/parser": "^5.0.0",
25+
"eslint-plugin-ava": "^13.0.0",
26+
"eslint-plugin-cypress": "^2.12.1",
2727
"eslint-plugin-eslint-comments": "^3.2.0",
2828
"eslint-plugin-filenames": "^1.3.2",
29-
"eslint-plugin-flowtype": "^5.7.1",
29+
"eslint-plugin-flowtype": "^6.1.0",
3030
"eslint-plugin-fp": "^2.3.0",
31-
"eslint-plugin-import": "^2.22.1",
32-
"eslint-plugin-jest": "^24.3.5",
33-
"eslint-plugin-jsdoc": "^32.3.0",
34-
"eslint-plugin-lodash": "^7.2.0",
35-
"eslint-plugin-mocha": "^8.1.0",
36-
"eslint-plugin-modules-newline": "0.0.6",
31+
"eslint-plugin-import": "^2.25.2",
32+
"eslint-plugin-jest": "^25.0.1",
33+
"eslint-plugin-jsdoc": "^36.1.1",
34+
"eslint-plugin-lodash": "^7.3.0",
35+
"eslint-plugin-mocha": "^9.0.0",
3736
"eslint-plugin-no-use-extend-native": "^0.5.0",
3837
"eslint-plugin-node": "^11.1.0",
3938
"eslint-plugin-promise": "^5.1.0",
40-
"eslint-plugin-react": "^7.23.2",
39+
"eslint-plugin-react": "^7.26.1",
4140
"eslint-plugin-react-hooks": "^4.2.0",
42-
"eslint-plugin-sort-keys-fix": "^1.1.1",
41+
"eslint-plugin-sort-keys-fix": "^1.1.2",
4342
"eslint-plugin-typescript-sort-keys": "^1.8.0",
44-
"eslint-plugin-unicorn": "^30.0.0"
43+
"eslint-plugin-unicorn": "^37.0.0"
4544
},
4645
"description": "Canonical ESLint Shareable Config",
4746
"devDependencies": {
4847
"@ava/babel": "^1.0.1",
49-
"@babel/core": "^7.13.16",
50-
"@babel/register": "^7.13.16",
48+
"@babel/core": "^7.15.8",
49+
"@babel/register": "^7.15.3",
5150
"ava": "^3.15.0",
52-
"eslint": "^7.24.0",
51+
"eslint": "^8.0.0",
5352
"husky": "^4.3.8",
5453
"jsonlint": "^1.6.3",
5554
"semantic-release": "^17.4.2"
5655
},
5756
"engines": {
58-
"node": ">=10.0.0"
57+
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
5958
},
6059
"husky": {
6160
"hooks": {
@@ -71,7 +70,7 @@
7170
"main": "./eslintrc.js",
7271
"name": "eslint-config-canonical",
7372
"peerDependencies": {
74-
"eslint": "^6.0.0 || ^7.0.0"
73+
"eslint": "^8.0.0"
7574
},
7675
"repository": {
7776
"type": "git",

test/eslint-config-canonical/canonical.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const test = require('ava');
2-
const CLIEngine = require('eslint').CLIEngine;
2+
const {ESLint} = require('eslint');
33

44
const configurations = [
55
'ava',
@@ -16,8 +16,8 @@ for (const configuration of configurations) {
1616
// eslint-disable-next-line import/no-dynamic-require -- Safe as for testing
1717
const config = require('../../' + configuration);
1818

19-
const rulesDefinition = new CLIEngine({
20-
configFile: './' + configuration + '.js',
19+
const rulesDefinition = new ESLint({
20+
overrideConfigFile: './' + configuration + '.js',
2121
useEslintrc: false,
2222
})
2323
.getRules();

0 commit comments

Comments
 (0)