You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`"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.
187
187
This opts into strict mode parsing without repeated `"use strict"` directives.
188
188
189
189
#### Unsatisfiable Rules
190
190
191
191
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:
193
193
194
194
-[`eol-last`](https://eslint.org/docs/rules/eol-last): The Markdown parser trims trailing newlines from code blocks.
195
195
-[`unicode-bom`](https://eslint.org/docs/rules/unicode-bom): Markdown code blocks do not have Unicode Byte Order Marks.
196
196
197
197
### Running
198
198
199
-
#### ESLint v8+
200
-
201
199
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.
202
200
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.
209
202
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
-
```
217
203
218
204
### Autofixing
219
205
@@ -249,8 +235,8 @@ hello();
249
235
```
250
236
251
237
```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.*`.
254
240
var div = <div className="jsx"></div>;
255
241
```
256
242
````
@@ -263,14 +249,7 @@ This is plain text and doesn't get linted.
263
249
```
264
250
````
265
251
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.
0 commit comments