Skip to content

Commit

Permalink
fix: remove @eslint/eslintrc as an explicit dep; it comes from esli…
Browse files Browse the repository at this point in the history
…nt when needed

See sarbbottam#332 (comment)
  • Loading branch information
ljharb committed Oct 31, 2021
1 parent 2b65377 commit 595d319
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ jobs:
if: ${{ !matrix.ajv && matrix.eslint == 5 }}
- run: npm prune > /dev/null
- run: npm ls > /dev/null
- run: npm uninstall --no-save @eslint/eslintrc
if: ${{ matrix.eslint < 7 || matrix.eslint == 7.7 }} # < 7.12, actually
- run: npm run cover
- uses: codecov/codecov-action@v2

Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
],
"license": "MIT",
"dependencies": {
"@eslint/eslintrc": "^0.1.3",
"cliui": "^3.2.0",
"eslint-rule-documentation": "^1.0.23",
"glob": "^7.1.6",
Expand Down Expand Up @@ -88,5 +87,8 @@
"bugs": {
"url": "https://github.com/sarbbottam/eslint-find-rules/issues"
},
"homepage": "https://github.com/sarbbottam/eslint-find-rules#readme"
"homepage": "https://github.com/sarbbottam/eslint-find-rules#readme",
"engines": {
"node": ">= 4"
}
}
13 changes: 9 additions & 4 deletions test/lib/rule-finder.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@ const path = require('path');
const assert = require('assert');
const proxyquire = require('proxyquire');

const semver = require('semver');
const eslintPkg = require('eslint/package.json');

let ModuleResolver;
try {
// eslint 7.12+
ModuleResolver = require('@eslint/eslintrc/lib/shared/relative-module-resolver');
if (semver.satisfies(eslintPkg.version, '>= 7.12')) {
// eslint 7.12+
ModuleResolver = require('@eslint/eslintrc/lib/shared/relative-module-resolver');
} else {
throw { code: 'MODULE_NOT_FOUND' };
}
} catch (err) {
if (err.code !== 'MODULE_NOT_FOUND') {
throw err;
Expand All @@ -26,8 +33,6 @@ try {

const processCwd = process.cwd;

const eslintPkg = require('eslint/package.json');
const semver = require('semver');
const eslintVersion = semver.satisfies(eslintPkg.version, '< 5') ? 'prior-v5' : 'post-v5';
const supportsScopedPlugins = semver.satisfies(eslintPkg.version, '>= 5');

Expand Down

0 comments on commit 595d319

Please sign in to comment.