@ntnyq/eslint-config 4.0.0-beta.10 → 4.0.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -8
- package/dist/{index.d.ts → index.d.mts} +434 -186
- package/dist/{index.js → index.mjs} +398 -511
- package/package.json +21 -24
package/README.md
CHANGED
|
@@ -19,10 +19,22 @@
|
|
|
19
19
|
|
|
20
20
|
## Install
|
|
21
21
|
|
|
22
|
+
```shell
|
|
23
|
+
npm i eslint typescript @ntnyq/eslint-config -D
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
```shell
|
|
27
|
+
yarn add eslint typescript @ntnyq/eslint-config -D
|
|
28
|
+
```
|
|
29
|
+
|
|
22
30
|
```shell
|
|
23
31
|
pnpm add eslint typescript @ntnyq/eslint-config -D
|
|
24
32
|
```
|
|
25
33
|
|
|
34
|
+
```shell
|
|
35
|
+
bun add eslint typescript @ntnyq/eslint-config -D
|
|
36
|
+
```
|
|
37
|
+
|
|
26
38
|
## Usage
|
|
27
39
|
|
|
28
40
|
Highly recommended using **`eslint.config.mjs`** as the config file :
|
|
@@ -40,8 +52,8 @@ Add scripts `lint` in `package.json`:
|
|
|
40
52
|
```json
|
|
41
53
|
{
|
|
42
54
|
"scripts": {
|
|
43
|
-
"lint": "eslint
|
|
44
|
-
"lint:fix": "eslint
|
|
55
|
+
"lint": "eslint",
|
|
56
|
+
"lint:fix": "eslint --fix"
|
|
45
57
|
}
|
|
46
58
|
}
|
|
47
59
|
```
|
|
@@ -55,10 +67,22 @@ Add scripts `lint` in `package.json`:
|
|
|
55
67
|
|
|
56
68
|
Install `prettier` and setup your prettier config:
|
|
57
69
|
|
|
70
|
+
```shell
|
|
71
|
+
npm i prettier @ntnyq/prettier-config -D
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
```shell
|
|
75
|
+
yarn add prettier @ntnyq/prettier-config -D
|
|
76
|
+
```
|
|
77
|
+
|
|
58
78
|
```shell
|
|
59
79
|
pnpm add prettier @ntnyq/prettier-config -D
|
|
60
80
|
```
|
|
61
81
|
|
|
82
|
+
```shell
|
|
83
|
+
bun add prettier @ntnyq/prettier-config -D
|
|
84
|
+
```
|
|
85
|
+
|
|
62
86
|
```js
|
|
63
87
|
// prettier.config.mjs
|
|
64
88
|
// @ts-check
|
|
@@ -132,7 +156,7 @@ pnpm add husky nano-staged -D
|
|
|
132
156
|
"prepare": "husky"
|
|
133
157
|
},
|
|
134
158
|
"nano-staged": {
|
|
135
|
-
"*.{js,ts,cjs,mjs,jsx,tsx,vue,md,svg,
|
|
159
|
+
"*.{js,ts,cjs,mjs,jsx,tsx,vue,md,svg,yml,yaml,toml,json}": "eslint --fix",
|
|
136
160
|
"*.{css,scss,html}": "prettier -uw"
|
|
137
161
|
}
|
|
138
162
|
}
|
|
@@ -156,7 +180,16 @@ Check for detail in:
|
|
|
156
180
|
### Config interface
|
|
157
181
|
|
|
158
182
|
```ts
|
|
159
|
-
export interface ConfigOptions
|
|
183
|
+
export interface ConfigOptions {
|
|
184
|
+
/**
|
|
185
|
+
* Shareable options
|
|
186
|
+
*/
|
|
187
|
+
shareable?: OptionsShareable
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Configs enabled by default
|
|
191
|
+
* @pg
|
|
192
|
+
*/
|
|
160
193
|
command?: ConfigCommandOptions
|
|
161
194
|
eslintComments?: ConfigESLintCommentsOptions
|
|
162
195
|
ignores?: ConfigIgnoresOptions
|
|
@@ -189,13 +222,12 @@ export interface ConfigOptions extends OptionsExtensions {
|
|
|
189
222
|
unocss?: boolean | ConfigUnoCSSOptions
|
|
190
223
|
vue?: boolean | ConfigVueOptions
|
|
191
224
|
yml?: boolean | ConfigYmlOptions
|
|
225
|
+
|
|
192
226
|
/**
|
|
193
|
-
* disabled by default
|
|
227
|
+
* Configs bellow are disabled by default
|
|
194
228
|
*/
|
|
229
|
+
pnpm?: boolean | ConfigPnpmOptions
|
|
195
230
|
svgo?: boolean | ConfigSVGOOptions
|
|
196
|
-
/**
|
|
197
|
-
* disabled by default
|
|
198
|
-
*/
|
|
199
231
|
eslintPlugin?: boolean | ConfigESLintPluginOptions
|
|
200
232
|
}
|
|
201
233
|
```
|