Skip to content

Commit 03cf3d7

Browse files
michaelfaithbmish
andauthored
feat!: remove eslint v8 / eslintrc support and remove flat/ prefix from configs (#528)
* feat!: remove eslint v8 support This change removes support for legacy rc-based configs, and moves minimum supported version to 9.0. I've also removed the deprecated `/configs` entry point. * use test setup file * docs: update examples * build: disable n/no-missing-import for md files * build: disable n/no-missing-import for md files --------- Co-authored-by: Bryan Mishkin <[email protected]>
1 parent 0b708d7 commit 03cf3d7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+107
-244
lines changed

.eslint-doc-generatorrc.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,6 @@ const config = {
99
'rules-recommended',
1010
'tests',
1111
'tests-recommended',
12-
'flat/recommended',
13-
'flat/all',
14-
'flat/all-type-checked',
15-
'flat/rules',
16-
'flat/rules-recommended',
17-
'flat/tests',
18-
'flat/tests-recommended',
1912
],
2013
postprocess: async (content, path) =>
2114
prettier.format(content, {

.github/workflows/main.yml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,17 @@ jobs:
3434
- uses: actions/checkout@v4
3535
- uses: actions/setup-node@v4
3636
with:
37-
node-version: "lts/*"
37+
node-version: 'lts/*'
3838
- run: npm install
3939
- run: npm run lint
4040

41-
eslint8:
42-
runs-on: ubuntu-latest
43-
steps:
44-
- uses: actions/checkout@v4
45-
- uses: actions/setup-node@v4
46-
with:
47-
node-version: "lts/*"
48-
- run: npm install
49-
- run: npm install --save-dev eslint@8
50-
- run: npm test
51-
5241
test-remote:
5342
name: eslint-remote-tester
5443
runs-on: ubuntu-latest
5544
steps:
5645
- uses: actions/checkout@v4
5746
- uses: actions/setup-node@v4
5847
with:
59-
node-version: "lts/*"
48+
node-version: 'lts/*'
6049
- run: npm install
6150
- run: npm run test:remote

README.md

Lines changed: 16 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ An ESLint plugin for linting ESLint plugins. Rules written in CJS, ESM, and Type
66

77
- [Installation](#installation)
88
- [Usage](#usage)
9-
- [**.eslintrc.json**](#eslintrcjson)
10-
- [`eslint.config.js` (requires eslint\>=v8.23.0)](#eslintconfigjs-requires-eslintv8230)
119
- [Rules](#rules)
1210
- [Rules](#rules-1)
1311
- [Tests](#tests)
@@ -42,25 +40,14 @@ Here's an example ESLint configuration that:
4240
- Enables the `recommended` configuration
4341
- Enables an optional/non-recommended rule
4442

45-
Note: you might need to set `sourceType` to `script` (most users) (use `module` for ESM/TypeScript).
46-
47-
### <a name='eslintrc'></a>**[.eslintrc.json](https://eslint.org/docs/latest/use/configure/configuration-files)**
48-
49-
```json
50-
{
51-
"extends": ["plugin:eslint-plugin/recommended"],
52-
"rules": {
53-
"eslint-plugin/require-meta-docs-description": "error"
54-
}
55-
}
56-
```
57-
58-
### <a name='flat'></a>[`eslint.config.js`](https://eslint.org/docs/latest/use/configure/configuration-files-new) (requires eslint>=v8.23.0)
43+
Note: you might need to set `sourceType` to `module` or `script` depending on your codebase.
5944

6045
```js
61-
const eslintPlugin = require('eslint-plugin-eslint-plugin');
62-
module.exports = [
63-
eslintPlugin.configs['flat/recommended'],
46+
// eslint.config.js
47+
import eslintPlugin from 'eslint-plugin-eslint-plugin';
48+
49+
export default [
50+
eslintPlugin.configs.recommended,
6451
{
6552
rules: {
6653
'eslint-plugin/require-meta-docs-description': 'error',
@@ -141,54 +128,29 @@ The list of recommended rules will only change in a major release of this plugin
141128

142129
### <a name='Presetusage'></a>Preset usage
143130

144-
Both flat and eslintrc configs are supported. For example, to enable the `recommended` preset, use:
145-
146-
eslint.config.js
131+
Example of applying the `recommended` config to all files.
147132

148133
```js
149-
const eslintPlugin = require('eslint-plugin-eslint-plugin');
150-
module.exports = [eslintPlugin.configs['flat/recommended']];
151-
```
134+
// eslint.config.js
135+
import eslintPlugin from 'eslint-plugin-eslint-plugin';
152136

153-
.eslintrc.json
154-
155-
```json
156-
{
157-
"extends": ["plugin:eslint-plugin/recommended"]
158-
}
137+
export default [eslintPlugin.configs.recommended];
159138
```
160139

161140
Or to apply linting only to the appropriate rule or test files:
162141

163-
eslint.config.js
164-
165142
```js
166-
const eslintPlugin = require('eslint-plugin-eslint-plugin');
167-
module.exports = [
143+
// eslint.config.js
144+
import eslintPlugin from 'eslint-plugin-eslint-plugin';
145+
146+
export default [
168147
{
169148
files: ['lib/rules/*.{js,ts}'],
170-
...eslintPlugin.configs['flat/rules-recommended'],
149+
...eslintPlugin.configs['rules-recommended'],
171150
},
172151
{
173152
files: ['tests/lib/rules/*.{js,ts}'],
174-
...eslintPlugin.configs['flat/tests-recommended'],
153+
...eslintPlugin.configs['tests-recommended'],
175154
},
176155
];
177156
```
178-
179-
.eslintrc.js
180-
181-
```json
182-
{
183-
"overrides": [
184-
{
185-
"files": ["lib/rules/*.{js,ts}"],
186-
"extends": ["plugin:eslint-plugin/rules-recommended"]
187-
},
188-
{
189-
"files": ["tests/lib/rules/*.{js,ts}"],
190-
"extends": ["plugin:eslint-plugin/tests-recommended"]
191-
}
192-
]
193-
}
194-
```

configs/all-type-checked.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

configs/all.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

configs/recommended.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

configs/rules-recommended.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

configs/rules.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

configs/tests-recommended.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

configs/tests.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)