From 62e2d883f6a6c57a71aa6594a79ea11ad4a5939a Mon Sep 17 00:00:00 2001 From: yosuke ota Date: Mon, 16 Aug 2021 12:48:15 +0900 Subject: [PATCH] [New] Support `eslint` v8 --- .github/workflows/node-4+.yml | 21 +++++++++++++++++++++ .nycrc | 3 ++- CHANGELOG.md | 3 +++ package.json | 5 +++-- tests/dep-time-travel.sh | 8 ++++++++ tests/src/cli.js | 2 +- 6 files changed, 38 insertions(+), 4 deletions(-) diff --git a/.github/workflows/node-4+.yml b/.github/workflows/node-4+.yml index f2498807c..aaa11f3a0 100644 --- a/.github/workflows/node-4+.yml +++ b/.github/workflows/node-4+.yml @@ -26,6 +26,7 @@ jobs: matrix: node-version: ${{ fromJson(needs.matrix.outputs.latest) }} eslint: + - 8 - 7 - 6 - 5 @@ -44,24 +45,44 @@ jobs: env: TS_PARSER: 2 exclude: + - node-version: 15 + eslint: 8 + - node-version: 13 + eslint: 8 + - node-version: 11 + eslint: 8 + - node-version: 10 + eslint: 8 + - node-version: 9 + eslint: 8 - node-version: 9 eslint: 7 + - node-version: 8 + eslint: 8 - node-version: 8 eslint: 7 + - node-version: 7 + eslint: 8 - node-version: 7 eslint: 7 - node-version: 7 eslint: 6 + - node-version: 6 + eslint: 8 - node-version: 6 eslint: 7 - node-version: 6 eslint: 6 + - node-version: 5 + eslint: 8 - node-version: 5 eslint: 7 - node-version: 5 eslint: 6 - node-version: 5 eslint: 5 + - node-version: 4 + eslint: 8 - node-version: 4 eslint: 7 - node-version: 4 diff --git a/.nycrc b/.nycrc index a19f5b8b1..5d75e2157 100644 --- a/.nycrc +++ b/.nycrc @@ -13,6 +13,7 @@ "tests", "resolvers/*/test", "scripts", - "memo-parser" + "memo-parser", + "lib" ] } diff --git a/CHANGELOG.md b/CHANGELOG.md index 264b20c73..b7dc919a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel ## [Unreleased] ### Added +- Support `eslint` v8 ([#2191], thanks [@ota-meshi]) - [`no-unresolved`]: add `caseSensitiveStrict` option ([#1262], thanks [@sergei-startsev]) - [`no-unused-modules`]: add eslint v8 support ([#2194], thanks [@coderaiser]) - [`no-restricted-paths`]: add/restore glob pattern support ([#2219], thanks [@stropho]) @@ -924,6 +925,7 @@ for info on changes for earlier releases. [#2212]: https://github.com/import-js/eslint-plugin-import/pull/2212 [#2196]: https://github.com/import-js/eslint-plugin-import/pull/2196 [#2194]: https://github.com/import-js/eslint-plugin-import/pull/2194 +[#2191]: https://github.com/import-js/eslint-plugin-import/pull/2191 [#2184]: https://github.com/import-js/eslint-plugin-import/pull/2184 [#2179]: https://github.com/import-js/eslint-plugin-import/pull/2179 [#2160]: https://github.com/import-js/eslint-plugin-import/pull/2160 @@ -1517,6 +1519,7 @@ for info on changes for earlier releases. [@noelebrun]: https://github.com/noelebrun [@ntdb]: https://github.com/ntdb [@nwalters512]: https://github.com/nwalters512 +[@ota-meshi]: https://github.com/ota-meshi [@panrafal]: https://github.com/panrafal [@paztis]: https://github.com/paztis [@pcorpet]: https://github.com/pcorpet diff --git a/package.json b/package.json index 08d5699f6..31d54e201 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,8 @@ "babylon": "^6.18.0", "chai": "^4.3.4", "cross-env": "^4.0.0", - "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0", + "escope": "^3.6.0", + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8", "eslint-import-resolver-node": "file:./resolvers/node", "eslint-import-resolver-typescript": "^1.0.2 || ^1.1.1", "eslint-import-resolver-webpack": "file:./resolvers/webpack", @@ -95,7 +96,7 @@ "typescript-eslint-parser": "^15 || ^22.0.0" }, "peerDependencies": { - "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0" + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" }, "dependencies": { "array-includes": "^3.1.3", diff --git a/tests/dep-time-travel.sh b/tests/dep-time-travel.sh index 2e2459576..116a4bfd4 100755 --- a/tests/dep-time-travel.sh +++ b/tests/dep-time-travel.sh @@ -34,3 +34,11 @@ if [[ "$TRAVIS_NODE_VERSION" -lt "8" ]]; then echo "Downgrading eslint-import-resolver-typescript..." npm i --no-save eslint-import-resolver-typescript@1.0.2 fi + +if [ "${ESLINT_VERSION}" = '8' ]; then + # This is a workaround for the crash in the initial processing of the ESLint class. + echo "Installing self" + npm i --no-save eslint-plugin-import@'.' -f + echo "Build self" + npm run build +fi diff --git a/tests/src/cli.js b/tests/src/cli.js index 9867e0498..5b7e705b0 100644 --- a/tests/src/cli.js +++ b/tests/src/cli.js @@ -97,7 +97,7 @@ describe('CLI regression tests', function () { }, ], errorCount: 1, - ...(semver.satisfies(eslintPkg.version, '>= 7.32 || ^8.0.0-0') && { + ...(semver.satisfies(eslintPkg.version, '>= 7.32 || ^8.0.0') && { fatalErrorCount: 0, }), warningCount: 0,