diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 7b817f4..dffef30 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - eslint: [6] + eslint: [7] node: [12.22.0, 12, 14.17.0, 14, 16, 18] include: # On other platforms @@ -21,6 +21,9 @@ jobs: node: 18 - os: macos-latest node: 18 + # On old ESLint versions + - eslint: 6 + node: 18 # On the minimum supported ESLint/Node.js version - eslint: 6.6.0 node: 12.22.0 diff --git a/README.md b/README.md index b20a186..0ea9975 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ npm install --save-dev eslint @mysticatea/eslint-plugin ### 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 diff --git a/lib/configs/_base.js b/lib/configs/_base.js index 7708e61..8f55027 100644 --- a/lib/configs/_base.js +++ b/lib/configs/_base.js @@ -26,6 +26,7 @@ module.exports = { camelcase: "error", "consistent-return": "error", curly: "error", + "default-case-last": "error", "default-case": "error", "default-param-last": "error", "dot-notation": "error", @@ -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", @@ -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", @@ -141,9 +145,11 @@ module.exports = { "no-unexpected-multiline": "error", "no-unmodified-loop-condition": "error", "no-unneeded-ternary": "error", + "no-unreachable-loop": "error", "no-unreachable": "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": [ @@ -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", @@ -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", @@ -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", @@ -392,6 +401,7 @@ module.exports = { ], }, ], + // "@mysticatea/eslint-comments/require-description": "error", "@mysticatea/eslint-comments/require-description": "off", // prettier diff --git a/lib/configs/_override-special.js b/lib/configs/_override-special.js index 17916c0..e24a2fa 100644 --- a/lib/configs/_override-special.js +++ b/lib/configs/_override-special.js @@ -18,7 +18,6 @@ module.exports = { extends: [require.resolve("./+node.js")], rules: { "no-console": "off", - "no-process-env": "off", }, }, { @@ -33,7 +32,6 @@ module.exports = { ], rules: { "no-console": "off", - "no-process-env": "off", }, }, ], diff --git a/package.json b/package.json index 91089ad..d4d4a40 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,10 @@ "lib" ], "peerDependencies": { - "eslint": ">=6.6.0" + "eslint": "^6.6.0 || ^7.0.0" }, "dependencies": { + "@eslint/eslintrc": "^0.4.3", "@typescript-eslint/eslint-plugin": "^4.33.0", "@typescript-eslint/parser": "^4.33.0", "eslint-plugin-eslint-comments": "^3.2.0", @@ -26,7 +27,7 @@ "devDependencies": { "@mysticatea/eslint-plugin": "file:.", "codecov": "^3.8.3", - "eslint": "^6.8.0", + "eslint": "^7.32.0", "globals": "^13.17.0", "mocha": "^9.2.2", "npm-run-all": "^4.1.5", diff --git a/tests/lib/configs/_rules.js b/tests/lib/configs/_rules.js index cbd9afe..5e3cfec 100644 --- a/tests/lib/configs/_rules.js +++ b/tests/lib/configs/_rules.js @@ -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 { rules: PluginRulesIndex } = require("@mysticatea/eslint-plugin")