1
1
![ GitHub CI] ( https://github.com/dipiash/eslint-plugin-nimbus-clean/actions/workflows/ci.yml/badge.svg )
2
2
[ ![ npm version] ( https://badge.fury.io/js/eslint-plugin-nimbus-clean.svg?v=0.2.4 )] ( https://badge.fury.io/js/eslint-plugin-nimbus-clean )
3
- [ ![ HitCount] ( https://hits.dwyl.com/dipiash/eslint-plugin-nimbus-clean.svg?style=flat-square )] ( http://hits.dwyl.com/dipiash/eslint-plugin-nimbus-clean )
4
-
5
- ` README.md ` : [ EN] ( /README.md ) | [ 日本語] ( /docs/ja/README.md ) | [ 繁體中文] ( /docs/zh-tw/README.md ) | [ हिंदी] ( /docs/hi/README.md )
3
+ [ ![ Hits] ( https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.heygears.com%2Fdipiash%2Feslint-plugin-nimbus-clean&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false )] ( https://hits.seeyoufarm.com )
6
4
7
5
# eslint-plugin-nimbus-clean
8
6
@@ -14,12 +12,8 @@ A comprehensive linting solution that sweeps your code clean. Combined rules for
14
12
15
13
- [ Installation] ( #installation )
16
14
- [ Usage] ( #usage )
17
- * [ Legacy config] ( #legacy-config )
18
- + [ Full config] ( #full-config )
15
+ * [ Config] ( #config )
19
16
+ [ Incrementally improvements] ( #incrementally-improvements )
20
- * [ Flat config] ( #flat-config )
21
- + [ Full config] ( #full-config-1 )
22
- + [ Incrementally improvements] ( #incrementally-improvements-1 )
23
17
+ [ Separate rules] ( #separate-rules )
24
18
* [ Prettier settings (optional)] ( #prettier-settings-optional )
25
19
- [ License] ( #license )
@@ -31,6 +25,8 @@ A comprehensive linting solution that sweeps your code clean. Combined rules for
31
25
32
26
### Installation
33
27
28
+ ** Requires ESLint ` >=9.20.0 ` , [ flat config] ( https://eslint.org/docs/latest/use/configure/configuration-files ) , and [ ESM] ( https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-make-my-typescript-project-output-esm ) .**
29
+
34
30
Here you can find instructions how to install it via: ` npm ` , ` yarn ` , ` pnpm ` .
35
31
36
32
You'll first need to install [ ESLint] ( https://eslint.org/ ) and TypeScript:
@@ -74,93 +70,18 @@ npx install-peerdeps eslint-plugin-nimbus-clean --pnpm
74
70
75
71
### Usage
76
72
77
- #### Legacy config
78
-
79
- Suitable for ESLint version < 9
80
-
81
- ##### Full config
82
-
83
- It's recommended for new projects or if you want to see all ESLint errors and warnings for existing projects.
84
-
85
- Add ` nimbus-clean ` to the extends or plugins section of your ` .eslintrc ` configuration file. You can omit the ` eslint-plugin- ` prefix:
86
- ``` json
87
- {
88
- "parser" : " @typescript-eslint/parser" ,
89
- "parserOptions" : {
90
- "ecmaVersion" : 13 ,
91
- "sourceType" : " module" ,
92
- "ecmaFeatures" : {
93
- "jsx" : true ,
94
- "modules" : true ,
95
- "experimentalObjectRestSpread" : true
96
- }
97
- },
98
- "ignorePatterns" : [
99
- " **/*" ,
100
- " node_modules"
101
- ],
102
- "settings" : {
103
- "react" : {
104
- "pragma" : " React" ,
105
- "fragment" : " Fragment" ,
106
- "version" : " detect"
107
- },
108
- "import/resolver" : {
109
- "typescript" : {
110
- "alwaysTryTypes" : true
111
- }
112
- }
113
- },
114
- "extends" : [
115
- " plugin:nimbus-clean/recommended"
116
- ],
117
- "plugins" : [
118
- " nimbus-clean"
119
- ]
120
- }
121
- ```
122
-
123
- ##### Incrementally improvements
124
-
125
- If you have existing project big/old/etc. you can apply ` nimbus-clean ` config setting incrementally:
126
- - ` plugin:nimbus-clean/common `
127
- - ` plugin:nimbus-clean/prettier `
128
- - ` plugin:nimbus-clean/import `
129
- - ` plugin:nimbus-clean/simpleImportSort `
130
- - ` plugin:nimbus-clean/react `
131
- - ` plugin:nimbus-clean/promise `
132
- - ` plugin:nimbus-clean/unicorn `
133
- - ` plugin:nimbus-clean/sonarjs `
134
- - ` plugin:nimbus-clean/typescript `
135
- - ` plugin:nimbus-clean/perfectionist `
136
-
137
- ``` json
138
- {
139
- ...
140
- "extends" : [
141
- " plugin:nimbus-clean/common" ,
142
- " plugin:nimbus-clean/prettier" ,
143
- ...
144
- ],
145
- "plugins" : [
146
- " nimbus-clean"
147
- ]
148
- }
149
- ```
150
-
151
- #### Flat config
73
+ #### Config
152
74
153
75
Suitable for ESLint >= 9
154
76
155
- ##### Full config
156
- ` eslint.config.js ` from ** javascript** project
77
+ ` eslint.config.mjs ` from ** javascript** project
157
78
158
79
``` javascript
159
80
import nimbusCleanPlugin from " eslint-plugin-nimbus-clean" ;
160
81
import globals from " globals" ;
161
82
162
83
const config = [
163
- ... nimbusCleanPlugin .configs .flat . recommended ,
84
+ ... nimbusCleanPlugin .configs .recommended ,
164
85
// Other configs
165
86
166
87
{ ignores: [" dist" ] },
@@ -181,15 +102,15 @@ const config = [
181
102
export default config ;
182
103
```
183
104
184
- ` eslint.config.js ` from ** typescript** project
105
+ ` eslint.config.mjs ` from ** typescript** project
185
106
186
107
``` typescript
187
108
import nimbusCleanPlugin from " eslint-plugin-nimbus-clean" ;
188
109
import globals from " globals" ;
189
110
import tsLint from " typescript-eslint" ;
190
111
191
112
export default tsLint .config (
192
- ... nimbusCleanPlugin .configs .flat . recommended ,
113
+ ... nimbusCleanPlugin .configs .recommended ,
193
114
// Other configs
194
115
195
116
{ ignores: [" dist" ] },
@@ -214,29 +135,29 @@ export default tsLint.config(
214
135
##### Incrementally improvements
215
136
216
137
If you have existing project big/old/etc. you can apply ` nimbus-clean ` config setting incrementally:
217
- - ` nimbusCleanPlugin.configs.flat. common `
218
- - ` nimbusCleanPlugin.configs.flat. prettier `
219
- - ` nimbusCleanPlugin.configs.flat. import `
220
- - ` nimbusCleanPlugin.configs.flat. simpleImportSort `
221
- - ` nimbusCleanPlugin.configs.flat. react `
222
- - ` nimbusCleanPlugin.configs.flat. reactHooks `
223
- - ` nimbusCleanPlugin.configs.flat. jsxA11y `
224
- - ` nimbusCleanPlugin.configs.flat. promise `
225
- - ` nimbusCleanPlugin.configs.flat. unicorn `
226
- - ` nimbusCleanPlugin.configs.flat. sonarjs `
227
- - ` nimbusCleanPlugin.configs.flat. typescript `
228
- - ` nimbusCleanPlugin.configs.flat. perfectionist `
229
- - ` nimbusCleanPlugin.configs.flat. testingLibrary `
230
-
231
- ` eslint.config.js ` from ** javascript** project
138
+ - ` nimbusCleanPlugin.configs.common `
139
+ - ` nimbusCleanPlugin.configs.prettier `
140
+ - ` nimbusCleanPlugin.configs.import `
141
+ - ` nimbusCleanPlugin.configs.simpleImportSort `
142
+ - ` nimbusCleanPlugin.configs.react `
143
+ - ` nimbusCleanPlugin.configs.reactHooks `
144
+ - ` nimbusCleanPlugin.configs.jsxA11y `
145
+ - ` nimbusCleanPlugin.configs.promise `
146
+ - ` nimbusCleanPlugin.configs.unicorn `
147
+ - ` nimbusCleanPlugin.configs.sonarjs `
148
+ - ` nimbusCleanPlugin.configs.typescript `
149
+ - ` nimbusCleanPlugin.configs.perfectionist `
150
+ - ` nimbusCleanPlugin.configs.testingLibrary `
151
+
152
+ ` eslint.config.mjs ` from ** javascript** project
232
153
233
154
``` javascript
234
155
import nimbusCleanPlugin from " eslint-plugin-nimbus-clean" ;
235
156
import globals from " globals" ;
236
157
237
158
const config = [
238
- ... nimbusCleanPlugin .configs .flat . common ,
239
- ... nimbusCleanPlugin .configs .flat . prettier ,
159
+ ... nimbusCleanPlugin .configs .common ,
160
+ ... nimbusCleanPlugin .configs .prettier ,
240
161
// Other configs
241
162
242
163
{ ignores: [" dist" ] },
@@ -257,16 +178,16 @@ const config = [
257
178
export default config ;
258
179
```
259
180
260
- ` eslint.config.js ` from ** typescript** project
181
+ ` eslint.config.mjs ` from ** typescript** project
261
182
262
183
``` typescript
263
184
import nimbusCleanPlugin from " eslint-plugin-nimbus-clean" ;
264
185
import globals from " globals" ;
265
186
import tsLint from " typescript-eslint" ;
266
187
267
188
export default tsLint .config (
268
- ... nimbusCleanPlugin .configs .flat . common ,
269
- ... nimbusCleanPlugin .configs .flat . prettier ,
189
+ ... nimbusCleanPlugin .configs .common ,
190
+ ... nimbusCleanPlugin .configs .prettier ,
270
191
// Other configs
271
192
272
193
{ ignores: [" dist" ] },
@@ -304,21 +225,21 @@ For flexible customization you can also use separate rules in your configs:
304
225
- ` nimbusCleanPlugin.rules.perfectionist `
305
226
- ` nimbusCleanPlugin.rules.typescriptRules `
306
227
307
- ` eslint.config.js ` from ** javascript** project
228
+ ` eslint.config.mjs ` from ** javascript** project
308
229
309
230
``` javascript
310
231
import nimbusCleanPlugin from " eslint-plugin-nimbus-clean" ;
311
232
import globals from " globals" ;
312
233
313
234
const config = [
314
235
... ({
315
- ... nimbusCleanPlugin .configs .flat . common ,
236
+ ... nimbusCleanPlugin .configs .common ,
316
237
rules: {
317
238
... nimbusCleanPlugin .rules .common ,
318
239
// Your rules
319
240
}
320
241
}),
321
- ... nimbusCleanPlugin .configs .flat . prettier ,
242
+ ... nimbusCleanPlugin .configs .prettier ,
322
243
// Other configs
323
244
324
245
{ ignores: [" dist" ] },
@@ -339,7 +260,7 @@ const config = [
339
260
export default config ;
340
261
```
341
262
342
- ` eslint.config.js ` from ** typescript** project
263
+ ` eslint.config.mjs ` from ** typescript** project
343
264
344
265
``` typescript
345
266
import nimbusCleanPlugin from " eslint-plugin-nimbus-clean" ;
@@ -348,7 +269,7 @@ import tsLint from "typescript-eslint";
348
269
349
270
export default tsLint .config (
350
271
... ({
351
- ... nimbusCleanPlugin .configs .flat . common ,
272
+ ... nimbusCleanPlugin .configs .common ,
352
273
rules: {
353
274
... nimbusCleanPlugin .rules .common ,
354
275
// Your rules
@@ -357,7 +278,7 @@ export default tsLint.config(
357
278
// OR
358
279
{
359
280
rules: {
360
- ... nimbusClean .rules .flat . typescript ,
281
+ ... nimbusClean .rules .typescript ,
361
282
},
362
283
},
363
284
// Other configs
0 commit comments