Skip to content

Commit f14f6a5

Browse files
feat!: drop eslint < 8 & Node.js < 18 (#238)
* feat!: drop eslint <8 & node.js < 18 * docs: update readme * Apply suggestions from code review Co-authored-by: Milos Djermanovic <[email protected]> --------- Co-authored-by: Milos Djermanovic <[email protected]>
1 parent a758163 commit f14f6a5

File tree

3 files changed

+16
-37
lines changed

3 files changed

+16
-37
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Checkout
15-
uses: actions/checkout@v3
15+
uses: actions/checkout@v4
1616
- name: Install Node.js
17-
uses: actions/setup-node@v3
17+
uses: actions/setup-node@v4
1818
with:
1919
node-version: lts/*
2020
- name: Install Packages
@@ -30,20 +30,20 @@ jobs:
3030
matrix:
3131
os: [ubuntu-latest]
3232
eslint: [8]
33-
node: [16, 17, 18, 19, 20, 21]
33+
node: [21.x, 20.x, 18.x, "18.18.0"]
3434
include:
3535
- os: windows-latest
3636
eslint: 8
37-
node: 16
37+
node: 20
3838
- os: macOS-latest
3939
eslint: 8
40-
node: 16
40+
node: 20
4141
runs-on: ${{ matrix.os }}
4242
steps:
4343
- name: Checkout
44-
uses: actions/checkout@v3
44+
uses: actions/checkout@v4
4545
- name: Install Node.js ${{ matrix.node }}
46-
uses: actions/setup-node@v3
46+
uses: actions/setup-node@v4
4747
with:
4848
node-version: ${{ matrix.node }}
4949
- name: Install Packages

README.md

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ module.exports = {
119119

120120
Some rules that catch mistakes in regular code are less helpful in documentation.
121121
For example, `no-undef` would flag variables that are declared outside of a code snippet because they aren't relevant to the example.
122-
The `plugin:markdown/recommended` config disables these rules in Markdown files:
122+
The `markdown.configs.recommended` config disables these rules in Markdown files:
123123

124124
- [`no-undef`](https://eslint.org/docs/rules/no-undef)
125125
- [`no-unused-expressions`](https://eslint.org/docs/rules/no-unused-expressions)
@@ -183,37 +183,23 @@ module.exports = {
183183
#### Strict Mode
184184

185185
`"use strict"` directives in every code block would be annoying.
186-
The `plugin:markdown/recommended` config enables the [`impliedStrict` parser option](https://eslint.org/docs/user-guide/configuring#specifying-parser-options) and disables the [`strict` rule](https://eslint.org/docs/rules/strict) in Markdown files.
186+
The `markdown.configs.recommended` config enables the [`impliedStrict` parser option](https://eslint.org/docs/user-guide/configuring#specifying-parser-options) and disables the [`strict` rule](https://eslint.org/docs/rules/strict) in Markdown files.
187187
This opts into strict mode parsing without repeated `"use strict"` directives.
188188

189189
#### Unsatisfiable Rules
190190

191191
Markdown code blocks are not real files, so ESLint's file-format rules do not apply.
192-
The `plugin:markdown/recommended` config disables these rules in Markdown files:
192+
The `markdown.configs.recommended` config disables these rules in Markdown files:
193193

194194
- [`eol-last`](https://eslint.org/docs/rules/eol-last): The Markdown parser trims trailing newlines from code blocks.
195195
- [`unicode-bom`](https://eslint.org/docs/rules/unicode-bom): Markdown code blocks do not have Unicode Byte Order Marks.
196196

197197
### Running
198198

199-
#### ESLint v8+
200-
201199
If you are using an `eslint.config.js` file, then you can run ESLint as usual and it will pick up file patterns in your config file. The `--ext` option is not available when using flat config.
202200

203-
If you are using an `.eslintrc.*` file, then you can run ESLint as usual and it will work as in ESLint v7.x.
204-
205-
#### ESLint v7
206-
207-
You can run ESLint as usual and do not need to use the `--ext` option.
208-
ESLint v7 [automatically lints file extensions specified in `overrides[].files` patterns in config files](https://github.com/eslint/rfcs/blob/0253e3a95511c65d622eaa387eb73f824249b467/designs/2019-additional-lint-targets/README.md).
201+
If you are using an `.eslintrc.*` file, then you can run ESLint as usual and it will pick up file extensions specified in `overrides[].files` patterns in config files.
209202

210-
#### ESLint v6
211-
212-
Use the [`--ext` option](https://eslint.org/docs/user-guide/command-line-interface#ext) to include `.js` and `.md` extensions in ESLint's file search:
213-
214-
```sh
215-
eslint --ext js,md .
216-
```
217203

218204
### Autofixing
219205

@@ -249,8 +235,8 @@ hello();
249235
```
250236

251237
```jsx
252-
// This can be linted too if you add `.jsx` files to `overrides` in ESLint v7
253-
// or pass `--ext jsx` in ESLint v6.
238+
// This can be linted too if you add `.jsx` files to file patterns in the `eslint.config.js`.
239+
// Or `overrides[].files` in `eslintrc.*`.
254240
var div = <div className="jsx"></div>;
255241
```
256242
````
@@ -263,14 +249,7 @@ This is plain text and doesn't get linted.
263249
```
264250
````
265251

266-
Unless a fenced code block's syntax appears as a file extension in `overrides[].files` in ESLint v7, it will be ignored.
267-
If using ESLint v6, you must also include the extension with the `--ext` option.
268-
269-
````markdown
270-
```python
271-
print("This doesn't get linted either.")
272-
```
273-
````
252+
Unless a fenced code block's syntax appears as a file extension in file patterns in your config file, it will be ignored.
274253

275254
## Configuration Comments
276255

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@
4949
"mdast-util-from-markdown": "^0.8.5"
5050
},
5151
"peerDependencies": {
52-
"eslint": "^6.0.0 || ^7.0.0 || ^8.0.0"
52+
"eslint": ">=8"
5353
},
5454
"engines": {
55-
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
55+
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
5656
}
5757
}

0 commit comments

Comments
 (0)