Skip to content

Commit

Permalink
feat: support ESLint 7.x
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey committed Oct 18, 2022
1 parent 53b3c84 commit 7fec012
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 14 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,21 @@ jobs:
matrix.os }})
strategy:
matrix:
eslint: [6]
eslint: [7]
node: [12.22.0, 12, 14.17.0, 14, 16, 18]
os: [ubuntu-latest]
include:
# On other platforms
- os: windows-latest
eslint: 6
eslint: 7
node: 18
- os: macos-latest
eslint: 6
eslint: 7
node: 18
# On old ESLint versions
- eslint: 6
node: 18
os: ubuntu-latest
# On the minimum supported ESLint/Node.js version
- eslint: 6.6.0
node: 12.22.0
Expand All @@ -72,8 +76,8 @@ jobs:
- name: 📥 Install dependencies
run: npm install

# - name: 📥 Install ESLint v${{ matrix.eslint }}
# run: npm install --save-dev eslint@${{ matrix.eslint }}
- name: 📥 Install ESLint v${{ matrix.eslint }}
run: npm install --save-dev eslint@${{ matrix.eslint }}

- name: ▶️ Run test script
run: npm run test
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ npm install --save-dev eslint @eslint-community/eslint-plugin-mysticatea
### Requirements

- Node.js `^12.22.0 || ^14.17.0 || >=16.0.0` or newer versions.
- ESLint `^6.6.0` or newer versions.
- ESLint `^6.6.0 || ^7.0.0` or newer versions.

## 📖 Usage

Expand Down
13 changes: 10 additions & 3 deletions lib/configs/_base.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module.exports = {
"consistent-return": "error",
curly: "error",
"default-case": "error",
"default-case-last": "error",
"default-param-last": "error",
"dot-notation": "error",
eqeqeq: ["error", "always", { null: "ignore" }],
Expand Down Expand Up @@ -92,6 +93,7 @@ module.exports = {
"no-lone-blocks": "error",
"no-lonely-if": "error",
"no-loop-func": "error",
"no-loss-of-precision": "error",
"no-misleading-character-class": "error",
"no-mixed-operators": [
"error",
Expand All @@ -106,12 +108,14 @@ module.exports = {
"no-new-object": "error",
"no-new-require": "error",
"no-new-wrappers": "error",
"no-nonoctal-decimal-escape": "error",
"no-obj-calls": "error",
"no-octal": "error",
"no-octal-escape": "error",
"no-param-reassign": ["error", { props: false }],
"no-process-env": "error",
"no-process-exit": "error",
"no-promise-executor-return": "error",
"no-prototype-builtins": "error",
"no-redeclare": ["error", { builtinGlobals: true }],
"no-regex-spaces": "error",
Expand Down Expand Up @@ -142,8 +146,10 @@ module.exports = {
"no-unmodified-loop-condition": "error",
"no-unneeded-ternary": "error",
"no-unreachable": "error",
"no-unreachable-loop": "error",
"no-unsafe-finally": "error",
"no-unsafe-negation": ["error", { enforceForOrderingRelations: true }],
"no-unsafe-optional-chaining": "error",
"no-unused-expressions": "error",
"no-unused-labels": "error",
"no-unused-vars": [
Expand All @@ -157,6 +163,7 @@ module.exports = {
},
],
"no-use-before-define": ["error", "nofunc"],
"no-useless-backreference": "error",
"no-useless-call": "error",
"no-useless-catch": "error",
"no-useless-concat": "error",
Expand Down Expand Up @@ -299,6 +306,7 @@ module.exports = {
"guard-for-in": "off",
"handle-callback-err": "off",
"id-blacklist": "off",
"id-denylist": "off",
"id-length": "off",
"id-match": "off",
"line-comment-position": "off",
Expand Down Expand Up @@ -332,6 +340,7 @@ module.exports = {
"no-path-concat": "off",
"no-plusplus": "off",
"no-proto": "off",
"no-restricted-exports": "off",
"no-restricted-globals": "off",
"no-restricted-imports": "off",
"no-restricted-modules": "off",
Expand Down Expand Up @@ -409,9 +418,7 @@ module.exports = {
semi: false,
tabWidth: 4,
},
{
usePrettierrc: false,
},
{ usePrettierrc: false },
],

// my own
Expand Down
2 changes: 0 additions & 2 deletions lib/configs/_override-special.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ module.exports = {
extends: [require.resolve("./+node.js")],
rules: {
"no-console": "off",
"no-process-env": "off",
},
},
{
Expand All @@ -33,7 +32,6 @@ module.exports = {
],
rules: {
"no-console": "off",
"no-process-env": "off",
},
},
],
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@
"vue-eslint-parser": "^8.3.0"
},
"devDependencies": {
"@eslint/eslintrc": "^0.4.3",
"@eslint-community/eslint-plugin-mysticatea": "file:.",
"eslint": "~6.8.0",
"eslint": "~7.32.0",
"fs-extra": "^8.1.0",
"globals": "^13.17.0",
"mocha": "^9.2.2",
Expand All @@ -65,7 +66,7 @@
"typescript": "^4.8.4"
},
"peerDependencies": {
"eslint": ">=6.6.0"
"eslint": "^6.6.0 || ^7.0.0"
},
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/configs/_rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
const { Linter } = require("eslint")
const {
ConfigArrayFactory,
} = require("eslint/lib/cli-engine/config-array-factory")
} = require("@eslint/eslintrc/lib/config-array-factory")
const Validator = require("eslint/lib/shared/config-validator")
const { rules: removedRules } = require("eslint/conf/replacements.json")
const {
Expand Down

0 comments on commit 7fec012

Please sign in to comment.