Skip to content

Commit

Permalink
docs: add install instructions for ESLint 9
Browse files Browse the repository at this point in the history
  • Loading branch information
edvardchen committed Sep 13, 2024
1 parent 1b27e2b commit 88747c4
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,22 @@ npm install eslint-plugin-i18next --save-dev

## Usage

Add `i18next` to the plugins section of your `.eslintrc` configuration file.
For ESLint 9 flat configuration,

```json
{
"plugins": ["i18next"]
}
```

Then configure the rules you want to use under the rules section.
```js
// eslint.config.mjs
import i18next from 'eslint-plugin-i18next';

```json
{
"rules": {
"i18next/no-literal-string": 2
}
}
export default [
// your other configs
i18next.configs?.['flat/recommended'],
];
```
or
For ESLint 8 and below,
```json
// .eslintrc
{
"extends": ["plugin:i18next/recommended"]
}
Expand Down

0 comments on commit 88747c4

Please sign in to comment.