From 45cf9581da2adeec8463e80b323cccf91c475ba6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Mon, 23 Aug 2021 02:28:38 +0200 Subject: [PATCH] feat: support ESLint 8.x --- .github/workflows/CI.yml | 9 ++++++--- README.md | 2 +- package.json | 6 +++--- tests/lib/configs/_rules.js | 11 +++++------ 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 2537599..3be30b5 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -41,18 +41,21 @@ jobs: matrix.os }}) strategy: matrix: - eslint: [7] + eslint: [8] node: [12.22.0, 12, 14.17.0, 14, 16, 18] os: [ubuntu-latest] include: # On other platforms - os: windows-latest - eslint: 7 + eslint: 8 node: 18 - os: macos-latest - eslint: 7 + eslint: 8 node: 18 # On old ESLint versions + - eslint: 7 + node: 18 + os: ubuntu-latest - eslint: 6 node: 18 os: ubuntu-latest diff --git a/README.md b/README.md index d68f032..22355c0 100644 --- a/README.md +++ b/README.md @@ -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 || ^7.0.0` or newer versions. +- ESLint `^6.6.0 || ^7.0.0 || ^8.0.0` or newer versions. ## 📖 Usage diff --git a/package.json b/package.json index b40ce6c..15f7b78 100644 --- a/package.json +++ b/package.json @@ -53,9 +53,9 @@ "vue-eslint-parser": "^8.3.0" }, "devDependencies": { - "@eslint/eslintrc": "^0.4.3", + "@eslint/eslintrc": "^1.3.3", "@eslint-community/eslint-plugin-mysticatea": "file:.", - "eslint": "~7.32.0", + "eslint": "~8.25.0", "globals": "^13.17.0", "mocha": "^9.2.2", "npm-run-all": "^4.1.5", @@ -65,7 +65,7 @@ "typescript": "^4.8.4" }, "peerDependencies": { - "eslint": ">=6.6.0" + "eslint": "^6.6.0 || ^7.0.0 || ^8.0.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" diff --git a/tests/lib/configs/_rules.js b/tests/lib/configs/_rules.js index 7d603c8..170517b 100644 --- a/tests/lib/configs/_rules.js +++ b/tests/lib/configs/_rules.js @@ -5,14 +5,11 @@ "use strict" const { Linter } = require("eslint") -const { - ConfigArrayFactory, -} = require("@eslint/eslintrc/lib/config-array-factory") -const Validator = require("eslint/lib/shared/config-validator") -const { rules: removedRules } = require("eslint/conf/replacements.json") +const { ConfigArrayFactory, ConfigValidator } = require("@eslint/eslintrc") const { rules: PluginRulesIndex, } = require("@eslint-community/eslint-plugin-mysticatea") +const { rules: removedRules } = require("eslint/conf/replacements.json") const coreRules = new Linter().getRules() const pluginRules = new Map( @@ -40,7 +37,9 @@ module.exports = { * @returns {void} */ validateConfig(config, source) { - Validator.validate(config, source, (ruleId) => allRules.get(ruleId)) + ConfigValidator.validate(config, source, (ruleId) => + allRules.get(ruleId) + ) /* istanbul ignore next */ for (const ruleId of [].concat(