Skip to content

Commit 87a1468

Browse files
committed
breaking: drop eslint < 7
1 parent 378751b commit 87a1468

13 files changed

+37
-218
lines changed

.eslintrc

+1-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
"node": true
66
},
77
"parserOptions": {
8-
"ecmaFeatures": {
9-
"impliedStrict": true
10-
},
11-
"ecmaVersion": 2017
8+
"ecmaVersion": 2018
129
},
1310
"plugins": ["json"],
1411
"root": true

.github/workflows/node.yml

-29
Original file line numberDiff line numberDiff line change
@@ -27,32 +27,9 @@ jobs:
2727
eslint:
2828
- 8
2929
- 7
30-
- 6
31-
- 5
32-
- 4
33-
- 3
3430
include:
3531
- node-version: 14
3632
eslint: 7.7
37-
- node-version: 8
38-
eslint: 6
39-
- node-version: 8
40-
eslint: 5
41-
- node-version: 8
42-
eslint: 4
43-
- node-version: 8
44-
eslint: 3
45-
- node-version: 6
46-
eslint: 5
47-
ajv: 5
48-
- node-version: 6
49-
eslint: 4
50-
- node-version: 6
51-
eslint: 3
52-
- node-version: 4
53-
eslint: 4
54-
- node-version: 4
55-
eslint: 3
5633
exclude:
5734
- node-version: 15
5835
eslint: 8
@@ -71,12 +48,6 @@ jobs:
7148
node-version: ${{ matrix.node-version }}
7249
skip-ls-check: true
7350
- run: npm install --no-save eslint@${{ matrix.eslint }}
74-
- run: npm install --no-save "ajv@${{ matrix.ajv }}"
75-
if: ${{ !!matrix.ajv }}
76-
- run: npm install --no-save "ajv@5"
77-
if: ${{ !matrix.ajv && matrix.eslint == 4 }}
78-
- run: npm install --no-save "ajv@6"
79-
if: ${{ !matrix.ajv && matrix.eslint == 5 }}
8051
- run: npm install --no-save @eslint/eslintrc@0
8152
if: ${{ matrix.eslint != 8 }}
8253
- run: npm prune > /dev/null

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"commitizen": "^2.10.1",
5151
"create-require": "^1.1.1",
5252
"cz-conventional-changelog": "^2.1.0",
53-
"eslint": "^3.12.0 || ^4 || ^5 || ^6 || ^7 || ^8",
53+
"eslint": "^7 || ^8.2.0",
5454
"eslint-plugin-json": "^3.1.0",
5555
"ghooks": "^2.0.4",
5656
"in-publish": "^2.0.1",
@@ -65,7 +65,7 @@
6565
"validate-commit-msg": "^2.14.0"
6666
},
6767
"peerDependencies": {
68-
"eslint": "^3.12.0 || ^4 || ^5 || ^6 || ^7 || ^8"
68+
"eslint": "^7 || ^8.2.0"
6969
},
7070
"nyc": {
7171
"exclude": [
@@ -107,6 +107,6 @@
107107
},
108108
"homepage": "https://github.com/sarbbottam/eslint-find-rules#readme",
109109
"engines": {
110-
"node": ">= 4"
110+
"node": "^10.12.0 || >=12.0.0 || ^14.17.0 || >=16.0.0"
111111
}
112112
}

src/lib/normalize-plugin-name.js

-74
Original file line numberDiff line numberDiff line change
@@ -27,80 +27,6 @@ function _getNormalizer() {
2727
getShorthandName: naming.getShorthandName
2828
}
2929
},
30-
// eslint >= 6.1.0
31-
function () {
32-
const normalizer = require('eslint/lib/shared/naming');
33-
34-
return {
35-
normalizePackageName: normalizer.normalizePackageName,
36-
getShorthandName: normalizer.getShorthandName
37-
};
38-
},
39-
// eslint 6.0.0 - 6.0.1
40-
function () {
41-
const normalizer = require('eslint/lib/cli-engine/naming');
42-
43-
return {
44-
normalizePackageName: normalizer.normalizePackageName,
45-
getShorthandName: normalizer.getShorthandName
46-
};
47-
},
48-
// eslint 5
49-
function () {
50-
const normalizer = require('eslint/lib/util/naming');
51-
52-
return {
53-
normalizePackageName: normalizer.normalizePackageName,
54-
getShorthandName: normalizer.getShorthandName
55-
};
56-
},
57-
// eslint 4
58-
function () {
59-
const normalizer = require('eslint/lib/util/naming');
60-
61-
return {
62-
normalizePackageName: normalizer.normalizePackageName,
63-
getShorthandName: normalizer.removeNamespaceFromTerm
64-
};
65-
},
66-
// eslint 3
67-
function () {
68-
const normalizer = require('eslint/lib/config/plugins');
69-
70-
const PLUGIN_NAME_PREFIX = 'eslint-plugin-';
71-
72-
function parsePluginName(pluginName) {
73-
const pluginNamespace = normalizer.getNamespace(pluginName);
74-
const pluginNameWithoutNamespace = normalizer.removeNamespace(pluginName);
75-
const pluginNameWithoutPrefix = normalizer.removePrefix(pluginNameWithoutNamespace);
76-
77-
return {
78-
pluginNamespace,
79-
pluginNameWithoutPrefix
80-
};
81-
}
82-
83-
function normalizePackageName(pluginName) {
84-
const sections = parsePluginName(pluginName);
85-
const longName = sections.pluginNamespace +
86-
PLUGIN_NAME_PREFIX +
87-
sections.pluginNameWithoutPrefix;
88-
89-
return longName;
90-
}
91-
92-
function getShorthandName(pluginName) {
93-
const sections = parsePluginName(pluginName);
94-
const shortName = sections.pluginNamespace + sections.pluginNameWithoutPrefix;
95-
96-
return shortName;
97-
}
98-
99-
return {
100-
normalizePackageName,
101-
getShorthandName
102-
};
103-
}
10430
];
10531

10632
for (const tryEslintVersion of eslintVersionFunctions) {

test/fixtures/prior-v5/eslint-dedupe-plugin-rules.json

-9
This file was deleted.

test/fixtures/prior-v5/eslint-with-deprecated-rules.json

-11
This file was deleted.

test/fixtures/prior-v5/eslint-with-plugin-with-no-rules.json

-7
This file was deleted.

test/fixtures/prior-v5/eslint.json

-8
This file was deleted.

test/fixtures/prior-v5/eslint.yml

-5
This file was deleted.

test/fixtures/prior-v5/eslintrc

-5
This file was deleted.

test/fixtures/prior-v5/no-path/index.js

-5
This file was deleted.

test/fixtures/prior-v5/no-path/package.json

-7
This file was deleted.

0 commit comments

Comments
 (0)