Skip to content

Commit 6a7a1f1

Browse files
feat: support ESLint 7.x (#28)
1 parent 3e1f002 commit 6a7a1f1

File tree

6 files changed

+23
-13
lines changed

6 files changed

+23
-13
lines changed

.github/workflows/CI.yml

+9-5
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,21 @@ jobs:
4141
matrix.os }})
4242
strategy:
4343
matrix:
44-
eslint: [6]
44+
eslint: [7]
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: 6
50+
eslint: 7
5151
node: 18
5252
- os: macos-latest
53-
eslint: 6
53+
eslint: 7
5454
node: 18
55+
# On old ESLint versions
56+
- eslint: 6
57+
node: 18
58+
os: ubuntu-latest
5559
# On the minimum supported ESLint/Node.js version
5660
- eslint: 6.6.0
5761
node: 12.22.0
@@ -72,8 +76,8 @@ jobs:
7276
- name: 📥 Install dependencies
7377
run: npm install
7478

75-
# - name: 📥 Install ESLint v${{ matrix.eslint }}
76-
# run: npm install --save-dev eslint@${{ matrix.eslint }}
79+
- name: 📥 Install ESLint v${{ matrix.eslint }}
80+
run: npm install --save-dev eslint@${{ matrix.eslint }}
7781

7882
- name: ▶️ Run test script
7983
run: npm run test

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` or newer versions.
20+
- ESLint `^6.6.0 || ^7.0.0` or newer versions.
2121

2222
## 📖 Usage
2323

lib/configs/_base.js

+10-3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ module.exports = {
2727
"consistent-return": "error",
2828
curly: "error",
2929
"default-case": "error",
30+
"default-case-last": "error",
3031
"default-param-last": "error",
3132
"dot-notation": "error",
3233
eqeqeq: ["error", "always", { null: "ignore" }],
@@ -92,6 +93,7 @@ module.exports = {
9293
"no-lone-blocks": "error",
9394
"no-lonely-if": "error",
9495
"no-loop-func": "error",
96+
"no-loss-of-precision": "error",
9597
"no-misleading-character-class": "error",
9698
"no-mixed-operators": [
9799
"error",
@@ -106,12 +108,14 @@ module.exports = {
106108
"no-new-object": "error",
107109
"no-new-require": "error",
108110
"no-new-wrappers": "error",
111+
"no-nonoctal-decimal-escape": "error",
109112
"no-obj-calls": "error",
110113
"no-octal": "error",
111114
"no-octal-escape": "error",
112115
"no-param-reassign": ["error", { props: false }],
113116
"no-process-env": "error",
114117
"no-process-exit": "error",
118+
"no-promise-executor-return": "error",
115119
"no-prototype-builtins": "error",
116120
"no-redeclare": ["error", { builtinGlobals: true }],
117121
"no-regex-spaces": "error",
@@ -142,8 +146,10 @@ module.exports = {
142146
"no-unmodified-loop-condition": "error",
143147
"no-unneeded-ternary": "error",
144148
"no-unreachable": "error",
149+
"no-unreachable-loop": "error",
145150
"no-unsafe-finally": "error",
146151
"no-unsafe-negation": ["error", { enforceForOrderingRelations: true }],
152+
"no-unsafe-optional-chaining": "error",
147153
"no-unused-expressions": "error",
148154
"no-unused-labels": "error",
149155
"no-unused-vars": [
@@ -157,6 +163,7 @@ module.exports = {
157163
},
158164
],
159165
"no-use-before-define": ["error", "nofunc"],
166+
"no-useless-backreference": "error",
160167
"no-useless-call": "error",
161168
"no-useless-catch": "error",
162169
"no-useless-concat": "error",
@@ -299,6 +306,7 @@ module.exports = {
299306
"guard-for-in": "off",
300307
"handle-callback-err": "off",
301308
"id-blacklist": "off",
309+
"id-denylist": "off",
302310
"id-length": "off",
303311
"id-match": "off",
304312
"line-comment-position": "off",
@@ -332,6 +340,7 @@ module.exports = {
332340
"no-path-concat": "off",
333341
"no-plusplus": "off",
334342
"no-proto": "off",
343+
"no-restricted-exports": "off",
335344
"no-restricted-globals": "off",
336345
"no-restricted-imports": "off",
337346
"no-restricted-modules": "off",
@@ -409,9 +418,7 @@ module.exports = {
409418
semi: false,
410419
tabWidth: 4,
411420
},
412-
{
413-
usePrettierrc: false,
414-
},
421+
{ usePrettierrc: false },
415422
],
416423

417424
// my own

lib/configs/_override-special.js

-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ module.exports = {
1818
extends: [require.resolve("./+node.js")],
1919
rules: {
2020
"no-console": "off",
21-
"no-process-env": "off",
2221
},
2322
},
2423
{
@@ -33,7 +32,6 @@ module.exports = {
3332
],
3433
rules: {
3534
"no-console": "off",
36-
"no-process-env": "off",
3735
},
3836
},
3937
],

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@
5353
"vue-eslint-parser": "^8.3.0"
5454
},
5555
"devDependencies": {
56+
"@eslint/eslintrc": "^0.4.3",
5657
"@eslint-community/eslint-plugin-mysticatea": "file:.",
57-
"eslint": "~6.8.0",
58+
"eslint": "~7.32.0",
5859
"globals": "^13.17.0",
5960
"mocha": "^9.2.2",
6061
"npm-run-all": "^4.1.5",

tests/lib/configs/_rules.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
const { Linter } = require("eslint")
88
const {
99
ConfigArrayFactory,
10-
} = require("eslint/lib/cli-engine/config-array-factory")
10+
} = require("@eslint/eslintrc/lib/config-array-factory")
1111
const Validator = require("eslint/lib/shared/config-validator")
1212
const { rules: removedRules } = require("eslint/conf/replacements.json")
1313
const {

0 commit comments

Comments
 (0)