Skip to content

Commit 2cc287c

Browse files
committed
feat: support ESLint 8.x
1 parent 9225766 commit 2cc287c

File tree

5 files changed

+39
-12
lines changed

5 files changed

+39
-12
lines changed

.github/workflows/CI.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,21 @@ jobs:
4141
matrix.os }})
4242
strategy:
4343
matrix:
44-
eslint: [7]
44+
eslint: [8]
4545
node: [12.22.0, 12, 14.17.0, 14, 16, 18]
4646
os: [ubuntu-latest]
4747
include:
4848
# On other platforms
4949
- os: windows-latest
50-
eslint: 7
50+
eslint: 8
5151
node: 18
5252
- os: macos-latest
53-
eslint: 7
53+
eslint: 8
5454
node: 18
5555
# On old ESLint versions
56+
- eslint: 7
57+
node: 18
58+
os: ubuntu-latest
5659
- eslint: 6
5760
node: 18
5861
os: ubuntu-latest

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ npm install --save-dev eslint @eslint-community/eslint-plugin-mysticatea
1717
### Requirements
1818

1919
- Node.js `^12.22.0 || ^14.17.0 || >=16.0.0` or newer versions.
20-
- ESLint `^6.6.0 || ^7.0.0` or newer versions.
20+
- ESLint `^6.6.0 || ^7.0.0 || ^8.0.0` or newer versions.
2121

2222
## 📖 Usage
2323

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@
5353
"vue-eslint-parser": "^8.3.0"
5454
},
5555
"devDependencies": {
56-
"@eslint/eslintrc": "^0.4.3",
56+
"@eslint/eslintrc": "^1.3.3",
5757
"@eslint-community/eslint-plugin-mysticatea": "file:.",
58-
"eslint": "~7.32.0",
58+
"eslint": "~8.25.0",
5959
"globals": "^13.17.0",
6060
"mocha": "^9.2.2",
6161
"npm-run-all": "^4.1.5",
@@ -65,7 +65,7 @@
6565
"typescript": "^4.8.4"
6666
},
6767
"peerDependencies": {
68-
"eslint": ">=6.6.0"
68+
"eslint": "^6.6.0 || ^7.0.0 || ^8.0.0"
6969
},
7070
"engines": {
7171
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"

tests/lib/configs/_rules.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66

77
const { Linter } = require("eslint")
88
const {
9-
ConfigArrayFactory,
10-
} = require("@eslint/eslintrc/lib/config-array-factory")
11-
const Validator = require("eslint/lib/shared/config-validator")
12-
const { rules: removedRules } = require("eslint/conf/replacements.json")
9+
Legacy: { ConfigArrayFactory, ConfigValidator },
10+
} = require("@eslint/eslintrc")
1311
const {
1412
rules: PluginRulesIndex,
1513
} = require("@eslint-community/eslint-plugin-mysticatea")
14+
const { rules: removedRules } = require("./eslint-replacements.json")
1615

1716
const coreRules = new Linter().getRules()
1817
const pluginRules = new Map(
@@ -31,6 +30,7 @@ const deprecatedRuleNames = new Set(
3130
const removedRuleNames = new Set(Object.keys(removedRules))
3231

3332
const configFactory = new ConfigArrayFactory()
33+
const configValidator = new ConfigValidator()
3434

3535
module.exports = {
3636
/**
@@ -40,7 +40,9 @@ module.exports = {
4040
* @returns {void}
4141
*/
4242
validateConfig(config, source) {
43-
Validator.validate(config, source, (ruleId) => allRules.get(ruleId))
43+
configValidator.validate(config, source, (ruleId) =>
44+
allRules.get(ruleId)
45+
)
4446

4547
/* istanbul ignore next */
4648
for (const ruleId of [].concat(
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"rules": {
3+
"generator-star": ["generator-star-spacing"],
4+
"global-strict": ["strict"],
5+
"no-arrow-condition": ["no-confusing-arrow", "no-constant-condition"],
6+
"no-comma-dangle": ["comma-dangle"],
7+
"no-empty-class": ["no-empty-character-class"],
8+
"no-empty-label": ["no-labels"],
9+
"no-extra-strict": ["strict"],
10+
"no-reserved-keys": ["quote-props"],
11+
"no-space-before-semi": ["semi-spacing"],
12+
"no-wrap-func": ["no-extra-parens"],
13+
"space-after-function-name": ["space-before-function-paren"],
14+
"space-after-keywords": ["keyword-spacing"],
15+
"space-before-function-parentheses": ["space-before-function-paren"],
16+
"space-before-keywords": ["keyword-spacing"],
17+
"space-in-brackets": ["object-curly-spacing", "array-bracket-spacing", "computed-property-spacing"],
18+
"space-return-throw-case": ["keyword-spacing"],
19+
"space-unary-word-ops": ["space-unary-ops"],
20+
"spaced-line-comment": ["spaced-comment"]
21+
}
22+
}

0 commit comments

Comments
 (0)