Skip to content

Commit 11be432

Browse files
committed
📝 Add defineConfig() to flat config usage demonstration
1 parent 38a56fa commit 11be432

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,30 @@ pnpm add --save-dev eslint-plugin-react-no-manual-memo
5050

5151
### Flat Config (ESLint 9+)
5252

53-
Use the recommended config:
53+
Use the recommended config inside `defineConfig()`:
5454

5555
```js
56+
import { defineConfig } from "eslint/config";
5657
import reactNoManualMemo from 'eslint-plugin-react-no-manual-memo';
5758

58-
export default [
59+
export default defineConfig([
5960
reactNoManualMemo.configs['flat/recommended'],
60-
];
61+
]);
6162
```
6263

64+
> [!NOTE]
65+
> ESLint will throw an error if you try to use the flat config without wrapping your config in `defineConfig()`.
66+
>
67+
> See the [docs section](https://eslint.org/docs/latest/use/configure/combine-configs#apply-a-config-array) about using third-party configs for more information.
68+
6369
<details>
6470
<summary>Or configure it manually:</summary>
6571

6672
```js
73+
import { defineConfig } from "eslint/config";
6774
import reactNoManualMemo from 'eslint-plugin-react-no-manual-memo';
6875

69-
export default [
76+
export default defineConfig([
7077
{
7178
plugins: {
7279
'react-no-manual-memo': reactNoManualMemo,
@@ -76,7 +83,7 @@ export default [
7683
// ...and any other rules you want to enable
7784
},
7885
},
79-
];
86+
]);
8087
```
8188

8289
</details>

0 commit comments

Comments
 (0)