6
6
7
7
# eslint-plugin-nimbus-clean
8
8
9
- A comprehensive linting solution that sweeps your code clean. Fly through your codebase with ease and precision!
9
+ A comprehensive linting solution that sweeps your code clean. Combined rules for ESLint helps to produce high quality code by detecting suspicious patterns, bugs. Keep the code clean and consistent.
10
10
11
11
## Table of Contents
12
12
13
13
<!-- toc -->
14
14
15
15
- [ Installation] ( #installation )
16
16
- [ Usage] ( #usage )
17
- * [ Full config] ( #full-config )
18
- * [ Incrementally improvements] ( #incrementally-improvements )
17
+ * [ Legacy config] ( #legacy-config )
18
+ + [ Full config] ( #full-config )
19
+ + [ Incrementally improvements] ( #incrementally-improvements )
20
+ * [ Flat config] ( #flat-config )
21
+ + [ Full config] ( #full-config-1 )
22
+ + [ Incrementally improvements] ( #incrementally-improvements-1 )
19
23
* [ Prettier settings (optional)] ( #prettier-settings-optional )
20
24
- [ License] ( #license )
21
25
- [ Contributions] ( #contributions )
@@ -69,7 +73,11 @@ npx install-peerdeps eslint-plugin-nimbus-clean --pnpm
69
73
70
74
### Usage
71
75
72
- #### Full config
76
+ #### Legacy config
77
+
78
+ Suitable for ESLint version < 9
79
+
80
+ ##### Full config
73
81
74
82
It's recommended for new projects or if you want to see all ESLint errors and warnings for existing projects.
75
83
@@ -111,7 +119,7 @@ Add `nimbus-clean` to the extends or plugins section of your `.eslintrc` configu
111
119
}
112
120
```
113
121
114
- #### Incrementally improvements
122
+ ##### Incrementally improvements
115
123
116
124
If you have existing project big/old/etc. you can apply ` nimbus-clean ` config setting incrementally:
117
125
- ` plugin:nimbus-clean/common `
@@ -137,24 +145,13 @@ If you have existing project big/old/etc. you can apply `nimbus-clean` config se
137
145
" nimbus-clean"
138
146
]
139
147
}
140
- ```
148
+ ```
141
149
142
- #### Prettier settings (optional)
150
+ #### Flat config
143
151
144
- If you don't have a ` .prettierrc ` config, please add it (for example):
145
- ``` prettier
146
- {
147
- "singleQuote": true,
148
- "printWidth": 150,
149
- "useTabs": false,
150
- "tabWidth": 2,
151
- "trailingComma": "all",
152
- "semi": false
153
- }
154
- ```
155
-
156
- ### Flat config
152
+ Suitable for ESLint >= 9
157
153
154
+ ##### Full config
158
155
` eslint.config.js ` from ** javascript** project
159
156
160
157
``` javascript
@@ -184,7 +181,6 @@ export default config;
184
181
185
182
` eslint.config.js ` from ** typescript** project
186
183
187
-
188
184
``` typescript
189
185
import nimbusCleanPlugin from " eslint-plugin-nimbus-clean" ;
190
186
import globals from " globals" ;
@@ -212,6 +208,97 @@ export default tsLint.config(
212
208
);
213
209
```
214
210
211
+ ##### Incrementally improvements
212
+
213
+ If you have existing project big/old/etc. you can apply ` nimbus-clean ` config setting incrementally:
214
+ - ` nimbusCleanPlugin.configs.flat.common `
215
+ - ` nimbusCleanPlugin.configs.flat.prettier `
216
+ - ` nimbusCleanPlugin.configs.flat.import `
217
+ - ` nimbusCleanPlugin.configs.flat.simpleImportSort `
218
+ - ` nimbusCleanPlugin.configs.flat.react `
219
+ - ` nimbusCleanPlugin.configs.flat.reactHooks `
220
+ - ` nimbusCleanPlugin.configs.flat.jsxA11y `
221
+ - ` nimbusCleanPlugin.configs.flat.promise `
222
+ - ` nimbusCleanPlugin.configs.flat.unicorn `
223
+ - ` nimbusCleanPlugin.configs.flat.sonarjs `
224
+ - ` nimbusCleanPlugin.configs.flat.typescript `
225
+ - ` nimbusCleanPlugin.configs.flat.perfectionist `
226
+ - ` nimbusCleanPlugin.configs.flat.testingLibrary `
227
+
228
+ ` eslint.config.js ` from ** javascript** project
229
+
230
+ ``` javascript
231
+ import nimbusCleanPlugin from " eslint-plugin-nimbus-clean" ;
232
+ import globals from " globals" ;
233
+
234
+ const config = [
235
+ ... nimbusCleanPlugin .configs .flat .common ,
236
+ ... nimbusCleanPlugin .configs .flat .prettier ,
237
+ ... ,
238
+
239
+ { ignores: [" dist" ] },
240
+ {
241
+ files: [" **/*.{js,jsx}" ],
242
+ languageOptions: {
243
+ ecmaVersion: 2020 ,
244
+ globals: globals .browser ,
245
+ parserOptions: {
246
+ ecmaFeatures: { jsx: true },
247
+ ecmaVersion: " latest" ,
248
+ sourceType: " module" ,
249
+ },
250
+ },
251
+ },
252
+ ];
253
+
254
+ export default config ;
255
+ ```
256
+
257
+ ` eslint.config.js ` from ** typescript** project
258
+
259
+ ``` typescript
260
+ import nimbusCleanPlugin from " eslint-plugin-nimbus-clean" ;
261
+ import globals from " globals" ;
262
+ import tsLint from " typescript-eslint" ;
263
+
264
+ export default tsLint .config (
265
+ ... nimbusCleanPlugin .configs .flat .common ,
266
+ ... nimbusCleanPlugin .configs .flat .prettier ,
267
+ ... ,
268
+
269
+ { ignores: [" dist" ] },
270
+ {
271
+ files: [" **/*.{ts,tsx}" ],
272
+ languageOptions: {
273
+ ecmaVersion: 2020 ,
274
+ globals: globals .browser ,
275
+ },
276
+ },
277
+ {
278
+ settings: {
279
+ " import/resolver" : {
280
+ node: true ,
281
+ typescript: true ,
282
+ },
283
+ },
284
+ },
285
+ );
286
+ ```
287
+
288
+ #### Prettier settings (optional)
289
+
290
+ If you don't have a ` .prettierrc ` config, please add it (for example):
291
+ ``` prettier
292
+ {
293
+ "singleQuote": true,
294
+ "printWidth": 150,
295
+ "useTabs": false,
296
+ "tabWidth": 2,
297
+ "trailingComma": "all",
298
+ "semi": false
299
+ }
300
+ ```
301
+
215
302
### License
216
303
217
304
This code is licensed under the [ MIT] ( /LICENSE ) License.
0 commit comments