Skip to content

Commit 9594a20

Browse files
committed
Add flat config example to README (fixes #31)
1 parent f55d0d2 commit 9594a20

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

+18
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,24 @@ npm i -D eslint-plugin-react-refresh
3030
}
3131
```
3232

33+
### Flat config
34+
35+
```js
36+
import reactRefresh from "eslint-plugin-react-refresh";
37+
38+
export default [
39+
{
40+
// in main config for TSX/JSX source files
41+
plugins: {
42+
"react-refresh": reactRefresh,
43+
},
44+
rules: {
45+
"react-refresh/only-export-components": "warn",
46+
},
47+
},
48+
];
49+
```
50+
3351
## Fail
3452

3553
```jsx

0 commit comments

Comments
 (0)