Skip to content

Commit

Permalink
docs: add flat config usage (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg authored Feb 22, 2024
1 parent 59eb2c7 commit f11a10d
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,26 @@ See [eslint-plugin-jsonc] for details.
npm i --save-dev jsonc-eslint-parser
```

## :book: Usage
## :book: Usage (Flat Config)

In your ESLint configuration file, set the `parser` property:

```js
import jsoncParser from "jsonc-eslint-parser";

export default [
{
// ...
// Add the following settings.
files: ["*.json", "*.json5"], // Specify the extension or pattern you want to parse as JSON.
languageOptions: {
parser: jsoncParser, // Set this parser.
}
},
];
```

## :book: Usage (Legacy Config)

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

Expand Down

0 comments on commit f11a10d

Please sign in to comment.