@@ -16,6 +16,17 @@ migrate some React patterns to Solid code.
1616It's approaching a ` 1.0.0 ` release, and it's well tested and should be helpful in Solid projects
1717today.
1818
19+ <!-- AUTO-GENERATED-CONTENT:START (TOC) -->
20+ - [ Installation] ( #installation )
21+ - [ Configuration] ( #configuration )
22+ - [ TypeScript] ( #typescript )
23+ - [ Manual Configuration] ( #manual-configuration )
24+ - [ Flat Configuration] ( #flat-configuration )
25+ - [ Rules] ( #rules )
26+ - [ Troubleshooting] ( #troubleshooting )
27+ - [ Versioning] ( #versioning )
28+ <!-- AUTO-GENERATED-CONTENT:END -->
29+
1930## Installation
2031
2132Install ` eslint ` and ` eslint-plugin-solid ` locally.
@@ -100,6 +111,54 @@ options you can set.
100111}
101112```
102113
114+ ### Flat Configuration
115+
116+ ESLint's new configuration system, [ Flat
117+ Configuration] ( https://eslint.org/docs/latest/use/configure/configuration-files-new#using-configurations-included-in-plugins ) ,
118+ is available starting in ESLint [ v8.23.0] ( https://github.com/eslint/eslint/releases/tag/v8.23.0 ) . To
119+ use it, create an ` eslint.config.js ` file at the root of your project, instead of ` .eslintrc.* `
120+ and/or ` .eslintignore ` .
121+
122+ ``` js
123+ import js from " @eslint/js" ;
124+ import solid from " eslint-plugin-solid/configs/recommended" ;
125+
126+ export default [
127+ js .configs .recommended , // replaces eslint:recommended
128+ solid,
129+ ];
130+ ```
131+
132+ For TypeScript:
133+
134+ ``` js
135+ import js from " @eslint/js" ;
136+ import solid from ' eslint-plugin-solid/configs/typescript' ;
137+ import * as tsParser from " @typescript-eslint/parser" ,
138+
139+ export default [
140+ js .configs .recommended ,
141+ {
142+ files: [" **/*.{ts,tsx}" ],
143+ ... solid,
144+ languageOptions: {
145+ parser: tsParser,
146+ parserOptions: {
147+ project: ' tsconfig.json' ,
148+ },
149+ },
150+ },
151+ ]
152+ ```
153+
154+ These configurations do not configure global variables in ESLint. You can do this yourself manually
155+ or with a package like [ globals] ( https://www.npmjs.com/package/globals ) by creating a configuration
156+ with a ` languageOptions.globals ` object. We recommend setting up global variables for Browser APIs
157+ as well as at least ES2015.
158+
159+ Note for the ESLint VSCode Extension: Enable the "Use Flat Config" setting for your workspace to
160+ enable Flat Config support.
161+
103162## Rules
104163
105164✔: Enabled in the ` recommended ` configuration.
@@ -134,7 +193,7 @@ options you can set.
134193## Troubleshooting
135194
136195The rules in this plugin provide sensible guidelines as well as possible, but there may be times
137- where the you better than the rule and want to ignore a warning. Just [ add a
196+ where you know better than the rule and want to ignore a warning. To do that, [ add a
138197comment] ( https://eslint.org/docs/latest/user-guide/configuring/rules#disabling-rules ) like the
139198following:
140199
@@ -143,10 +202,13 @@ following:
143202const [editedValue , setEditedValue ] = createSignal (props .value );
144203```
145204
146- _ However _ , there may also be times where a rule correctly warns about a subtle problem,
205+ _ Please note _ : there may also be times where a rule correctly warns about a subtle problem,
147206even if it looks like a false positive at first. With ` solid/reactivity ` , please look at the
148207[ reactivity docs] ( ./docs/reactivity.md#troubleshooting ) before deciding to disable the rule.
149208
209+ When in doubt, feel free to [ file an
210+ issue] ( https://github.com/solidjs-community/eslint-plugin-solid/issues/new/choose ) .
211+
150212## Versioning
151213
152214Pre-1.0.0, the rules and the ` recommended ` and ` typescript ` configuations will be
0 commit comments