Skip to content

Commit 08ccfac

Browse files
committedNov 18, 2024·
docs: 📝 update README.md
1 parent 662d6a3 commit 08ccfac

File tree

1 file changed

+108
-21
lines changed

1 file changed

+108
-21
lines changed
 

‎README.md

+108-21
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,20 @@
66

77
# eslint-plugin-nimbus-clean
88

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.
1010

1111
## Table of Contents
1212

1313
<!-- toc -->
1414

1515
- [Installation](#installation)
1616
- [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)
1923
* [Prettier settings (optional)](#prettier-settings-optional)
2024
- [License](#license)
2125
- [Contributions](#contributions)
@@ -69,7 +73,11 @@ npx install-peerdeps eslint-plugin-nimbus-clean --pnpm
6973

7074
### Usage
7175

72-
#### Full config
76+
#### Legacy config
77+
78+
Suitable for ESLint version < 9
79+
80+
##### Full config
7381

7482
It's recommended for new projects or if you want to see all ESLint errors and warnings for existing projects.
7583

@@ -111,7 +119,7 @@ Add `nimbus-clean` to the extends or plugins section of your `.eslintrc` configu
111119
}
112120
```
113121

114-
#### Incrementally improvements
122+
##### Incrementally improvements
115123

116124
If you have existing project big/old/etc. you can apply `nimbus-clean` config setting incrementally:
117125
- `plugin:nimbus-clean/common`
@@ -137,24 +145,13 @@ If you have existing project big/old/etc. you can apply `nimbus-clean` config se
137145
"nimbus-clean"
138146
]
139147
}
140-
```
148+
```
141149

142-
#### Prettier settings (optional)
150+
#### Flat config
143151

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
157153

154+
##### Full config
158155
`eslint.config.js` from **javascript** project
159156

160157
```javascript
@@ -184,7 +181,6 @@ export default config;
184181

185182
`eslint.config.js` from **typescript** project
186183

187-
188184
```typescript
189185
import nimbusCleanPlugin from "eslint-plugin-nimbus-clean";
190186
import globals from "globals";
@@ -212,6 +208,97 @@ export default tsLint.config(
212208
);
213209
```
214210

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+
215302
### License
216303

217304
This code is licensed under the [MIT](/LICENSE) License.

0 commit comments

Comments
 (0)
Please sign in to comment.