Skip to content

Commit f11a10d

Browse files
docs: add flat config usage (#204)
1 parent 59eb2c7 commit f11a10d

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

README.md

+20-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,26 @@ See [eslint-plugin-jsonc] for details.
2222
npm i --save-dev jsonc-eslint-parser
2323
```
2424

25-
## :book: Usage
25+
## :book: Usage (Flat Config)
26+
27+
In your ESLint configuration file, set the `parser` property:
28+
29+
```js
30+
import jsoncParser from "jsonc-eslint-parser";
31+
32+
export default [
33+
{
34+
// ...
35+
// Add the following settings.
36+
files: ["*.json", "*.json5"], // Specify the extension or pattern you want to parse as JSON.
37+
languageOptions: {
38+
parser: jsoncParser, // Set this parser.
39+
}
40+
},
41+
];
42+
```
43+
44+
## :book: Usage (Legacy Config)
2645

2746
In your ESLint configuration file, set the `overrides` > `parser` property:
2847

0 commit comments

Comments
 (0)