@ntnyq/eslint-config 4.0.0-beta.8 → 4.0.0
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 +48 -9
- package/dist/{index.d.ts → index.d.mts} +476 -243
- package/dist/{index.js → index.mjs} +519 -552
- package/package.json +54 -49
package/README.md
CHANGED
|
@@ -20,7 +20,19 @@
|
|
|
20
20
|
## Install
|
|
21
21
|
|
|
22
22
|
```shell
|
|
23
|
-
|
|
23
|
+
npm i eslint typescript @ntnyq/eslint-config -D
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
```shell
|
|
27
|
+
yarn add eslint typescript @ntnyq/eslint-config -D
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
```shell
|
|
31
|
+
pnpm add eslint typescript @ntnyq/eslint-config -D
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```shell
|
|
35
|
+
bun add eslint typescript @ntnyq/eslint-config -D
|
|
24
36
|
```
|
|
25
37
|
|
|
26
38
|
## Usage
|
|
@@ -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
|
```
|
|
@@ -53,7 +65,26 @@ Add scripts `lint` in `package.json`:
|
|
|
53
65
|
|
|
54
66
|
## Prettier config
|
|
55
67
|
|
|
68
|
+
Install `prettier` and setup your prettier config:
|
|
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
|
+
|
|
78
|
+
```shell
|
|
79
|
+
pnpm add prettier @ntnyq/prettier-config -D
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
```shell
|
|
83
|
+
bun add prettier @ntnyq/prettier-config -D
|
|
84
|
+
```
|
|
85
|
+
|
|
56
86
|
```js
|
|
87
|
+
// prettier.config.mjs
|
|
57
88
|
// @ts-check
|
|
58
89
|
|
|
59
90
|
import { config, defineConfig } from '@ntnyq/prettier-config'
|
|
@@ -125,7 +156,7 @@ pnpm add husky nano-staged -D
|
|
|
125
156
|
"prepare": "husky"
|
|
126
157
|
},
|
|
127
158
|
"nano-staged": {
|
|
128
|
-
"*.{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",
|
|
129
160
|
"*.{css,scss,html}": "prettier -uw"
|
|
130
161
|
}
|
|
131
162
|
}
|
|
@@ -149,7 +180,16 @@ Check for detail in:
|
|
|
149
180
|
### Config interface
|
|
150
181
|
|
|
151
182
|
```ts
|
|
152
|
-
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
|
+
*/
|
|
153
193
|
command?: ConfigCommandOptions
|
|
154
194
|
eslintComments?: ConfigESLintCommentsOptions
|
|
155
195
|
ignores?: ConfigIgnoresOptions
|
|
@@ -182,13 +222,12 @@ export interface ConfigOptions extends OptionsExtensions {
|
|
|
182
222
|
unocss?: boolean | ConfigUnoCSSOptions
|
|
183
223
|
vue?: boolean | ConfigVueOptions
|
|
184
224
|
yml?: boolean | ConfigYmlOptions
|
|
225
|
+
|
|
185
226
|
/**
|
|
186
|
-
* disabled by default
|
|
227
|
+
* Configs bellow are disabled by default
|
|
187
228
|
*/
|
|
229
|
+
pnpm?: boolean | ConfigPnpmOptions
|
|
188
230
|
svgo?: boolean | ConfigSVGOOptions
|
|
189
|
-
/**
|
|
190
|
-
* disabled by default
|
|
191
|
-
*/
|
|
192
231
|
eslintPlugin?: boolean | ConfigESLintPluginOptions
|
|
193
232
|
}
|
|
194
233
|
```
|