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

feat: support ESLint 8.x #33

Closed
wants to merge 1 commit into from
Closed
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 .travis.yml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ dist: focal
arch: arm64-graviton2
language: node_js
node_js:
- 10
- 12
script:
- npm run test
after_success:
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -53,6 +53,10 @@ This is how Canonical ruleset compares to other popular configurations.

|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)|
|---|---|---|---|---|
|`@babel/new-cap`|off|N/A 👻|N/A 👻|N/A 👻|
|`@babel/no-invalid-this`|error 🚨|N/A 👻|N/A 👻|N/A 👻|
|`@babel/object-curly-spacing`|error 🚨|N/A 👻|N/A 👻|N/A 👻|
|`@babel/valid-typeof`|error 🚨|N/A 👻|N/A 👻|N/A 👻|
|[`@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 👻|
|[`@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 👻|
|[`@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.
|[`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 👻|
|[`ava/use-test`](https://github.com/avajs/eslint-plugin-ava/blob/master/docs/rules/use-test.md)|error 🚨|N/A 👻|N/A 👻|N/A 👻|
|[`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 👻|
|`babel/new-cap`|off|N/A 👻|N/A 👻|N/A 👻|
|`babel/no-invalid-this`|error 🚨|N/A 👻|N/A 👻|N/A 👻|
|`babel/object-curly-spacing`|error 🚨|N/A 👻|N/A 👻|N/A 👻|
|`babel/valid-typeof`|error 🚨|N/A 👻|N/A 👻|N/A 👻|
|[`block-scoped-var`](https://eslint.org/docs/rules/block-scoped-var)|error 🚨|error 🚨|N/A 👻|N/A 👻|
|[`block-spacing`](https://eslint.org/docs/rules/block-spacing)|error 🚨|error 🚨|error 🚨|error 🚨|
|[`brace-style`](https://eslint.org/docs/rules/brace-style)|error 🚨|error 🚨|error 🚨|error 🚨|
16 changes: 8 additions & 8 deletions configurations/eslintrc.json
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@
"sort-keys-fix",
"fp",
"no-use-extend-native",
"babel",
"@babel",
"import",
"jsdoc",
"promise",
@@ -29,6 +29,13 @@
"eslint-comments"
],
"rules": {
"@babel/new-cap": 0,
"@babel/no-invalid-this": 2,
"@babel/object-curly-spacing": [
2,
"never"
],
"@babel/valid-typeof": 2,
"accessor-pairs": 2,
"array-bracket-newline": 0,
"array-bracket-spacing": [
@@ -55,13 +62,6 @@
"before": true
}
],
"babel/new-cap": 0,
"babel/no-invalid-this": 2,
"babel/object-curly-spacing": [
2,
"never"
],
"babel/valid-typeof": 2,
"block-scoped-var": 2,
"block-spacing": [
2,
41 changes: 20 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -18,44 +18,43 @@
]
},
"dependencies": {
"@babel/eslint-parser": "^7.13.14",
"@typescript-eslint/eslint-plugin": "^4.22.0",
"@typescript-eslint/parser": "^4.22.0",
"eslint-plugin-ava": "^12.0.0",
"eslint-plugin-babel": "^5.3.1",
"eslint-plugin-cypress": "^2.11.2",
"@babel/eslint-parser": "^7.15.8",
"@babel/eslint-plugin": "^7.14.5",
"@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "^5.0.0",
"eslint-plugin-ava": "^13.0.0",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-filenames": "^1.3.2",
gajus marked this conversation as resolved.
Show resolved Hide resolved
"eslint-plugin-flowtype": "^5.7.1",
"eslint-plugin-flowtype": "^6.1.0",
"eslint-plugin-fp": "^2.3.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.3.5",
"eslint-plugin-jsdoc": "^32.3.0",
"eslint-plugin-lodash": "^7.2.0",
"eslint-plugin-mocha": "^8.1.0",
"eslint-plugin-modules-newline": "0.0.6",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-jest": "^25.0.1",
"eslint-plugin-jsdoc": "^36.1.1",
"eslint-plugin-lodash": "^7.3.0",
"eslint-plugin-mocha": "^9.0.0",
"eslint-plugin-no-use-extend-native": "^0.5.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-react": "^7.23.2",
"eslint-plugin-react": "^7.26.1",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-sort-keys-fix": "^1.1.1",
"eslint-plugin-sort-keys-fix": "^1.1.2",
"eslint-plugin-typescript-sort-keys": "^1.8.0",
"eslint-plugin-unicorn": "^30.0.0"
"eslint-plugin-unicorn": "^37.0.0"
},
"description": "Canonical ESLint Shareable Config",
"devDependencies": {
"@ava/babel": "^1.0.1",
"@babel/core": "^7.13.16",
"@babel/register": "^7.13.16",
"@babel/core": "^7.15.8",
"@babel/register": "^7.15.3",
"ava": "^3.15.0",
"eslint": "^7.24.0",
"eslint": "^8.0.0",
"husky": "^4.3.8",
"jsonlint": "^1.6.3",
"semantic-release": "^17.4.2"
},
"engines": {
"node": ">=10.0.0"
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"husky": {
"hooks": {
@@ -71,7 +70,7 @@
"main": "./eslintrc.js",
"name": "eslint-config-canonical",
"peerDependencies": {
"eslint": "^6.0.0 || ^7.0.0"
"eslint": "^8.0.0"
},
"repository": {
"type": "git",
6 changes: 3 additions & 3 deletions test/eslint-config-canonical/canonical.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const test = require('ava');
const CLIEngine = require('eslint').CLIEngine;
const {ESLint} = require('eslint');

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

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