@@ -12,28 +12,31 @@ Install the config along with its peer dependencies, `eslint` and `prettier`:
12
12
npm install -D eslint-config-scratch eslint@^9 prettier@^3
13
13
```
14
14
15
- Add ` eslint.config.mjs ` to your project root and, optionally, configure parser options for rules that require type
16
- information:
15
+ Add ` eslint.config.mjs ` to your project root.
16
+
17
+ For a TypeScript project, you can add ` languageOptions ` to enable type checking:
17
18
18
19
``` js
19
20
// myProjectRoot/eslint.config.mjs
20
21
import { eslintConfigScratch } from ' eslint-config-scratch'
21
22
22
- // for plain JavaScript:
23
- export default eslintConfigScratch .recommended
24
-
25
- // for a TypeScript project:
26
- export default eslintConfigScratch .config (
27
- eslintConfigScratch .recommended ,
28
- {
29
- languageOptions: {
30
- parserOptions: {
31
- projectService: true ,
32
- tsconfigRootDir: import .meta.dirname,
33
- },
34
- }
23
+ export default eslintConfigScratch .config (eslintConfigScratch .recommended , {
24
+ languageOptions: {
25
+ parserOptions: {
26
+ projectService: true ,
27
+ tsconfigRootDir: import .meta.dirname,
28
+ },
35
29
},
36
- )
30
+ })
31
+ ```
32
+
33
+ For a JavaScript project, it might look like this:
34
+
35
+ ``` js
36
+ // myProjectRoot/eslint.config.mjs
37
+ import { eslintConfigScratch } from ' eslint-config-scratch'
38
+
39
+ export default eslintConfigScratch .recommended
37
40
```
38
41
39
42
The function ` eslintConfigScratch.config ` is a re-export of the ` config ` function from ` typescript-eslint ` , and helps
0 commit comments