@ntnyq/eslint-config 4.0.0-beta.1 → 4.0.0-beta.10
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 +15 -10
- package/dist/index.d.ts +15451 -14302
- package/dist/index.js +1443 -1152
- package/package.json +56 -42
package/README.md
CHANGED
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
- Out-of-box support for TypeScript, Vue, JSON, Markdown, YAML, TOML, SVG and etc
|
|
16
16
|
- Strict but provides useful rules to guard your codebase
|
|
17
17
|
- Custom ESLint commands for [eslint-plugin-command](https://github.com/antfu/eslint-plugin-command)
|
|
18
|
-
- [ESLint flat config](https://eslint.org/docs/latest/use/configure/configuration-files) for ESLint v9.
|
|
18
|
+
- [ESLint flat config](https://eslint.org/docs/latest/use/configure/configuration-files) for ESLint v9.20.0+
|
|
19
19
|
|
|
20
20
|
## Install
|
|
21
21
|
|
|
22
22
|
```shell
|
|
23
|
-
pnpm add eslint
|
|
23
|
+
pnpm add eslint typescript @ntnyq/eslint-config -D
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
## Usage
|
|
@@ -53,7 +53,14 @@ Add scripts `lint` in `package.json`:
|
|
|
53
53
|
|
|
54
54
|
## Prettier config
|
|
55
55
|
|
|
56
|
+
Install `prettier` and setup your prettier config:
|
|
57
|
+
|
|
58
|
+
```shell
|
|
59
|
+
pnpm add prettier @ntnyq/prettier-config -D
|
|
60
|
+
```
|
|
61
|
+
|
|
56
62
|
```js
|
|
63
|
+
// prettier.config.mjs
|
|
57
64
|
// @ts-check
|
|
58
65
|
|
|
59
66
|
import { config, defineConfig } from '@ntnyq/prettier-config'
|
|
@@ -86,12 +93,13 @@ export default defineConfig({
|
|
|
86
93
|
"eslint.enable": true,
|
|
87
94
|
"prettier.enable": true,
|
|
88
95
|
"editor.formatOnSave": true,
|
|
96
|
+
"prettier.configPath": "./prettier.config.mjs",
|
|
97
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
89
98
|
"editor.codeActionsOnSave": {
|
|
90
99
|
"source.fixAll.eslint": "explicit",
|
|
91
100
|
"source.organizeImports": "never",
|
|
92
101
|
"source.sortImports": "never"
|
|
93
102
|
},
|
|
94
|
-
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
95
103
|
"eslint.validate": [
|
|
96
104
|
"vue",
|
|
97
105
|
"yaml",
|
|
@@ -148,9 +156,9 @@ Check for detail in:
|
|
|
148
156
|
### Config interface
|
|
149
157
|
|
|
150
158
|
```ts
|
|
151
|
-
export interface ConfigOptions extends
|
|
159
|
+
export interface ConfigOptions extends OptionsExtensions {
|
|
152
160
|
command?: ConfigCommandOptions
|
|
153
|
-
|
|
161
|
+
eslintComments?: ConfigESLintCommentsOptions
|
|
154
162
|
ignores?: ConfigIgnoresOptions
|
|
155
163
|
importX?: ConfigImportXOptions
|
|
156
164
|
javascript?: ConfigJavaScriptOptions
|
|
@@ -159,9 +167,10 @@ export interface ConfigOptions extends ConfigOptionsInternal, OptionsExtensions
|
|
|
159
167
|
specials?: ConfigSpecialsOptions
|
|
160
168
|
|
|
161
169
|
/**
|
|
162
|
-
* bellow can be disabled
|
|
170
|
+
* Configs bellow can be disabled
|
|
163
171
|
*/
|
|
164
172
|
antfu?: boolean | ConfigAntfuOptions
|
|
173
|
+
deMorgan?: boolean | ConfigDeMorganOptions
|
|
165
174
|
depend?: boolean | ConfigDependOptions
|
|
166
175
|
githubAction?: boolean | ConfigGitHubActionOptions
|
|
167
176
|
gitignore?: boolean | ConfigGitIgnoreOptions
|
|
@@ -180,16 +189,12 @@ export interface ConfigOptions extends ConfigOptionsInternal, OptionsExtensions
|
|
|
180
189
|
unocss?: boolean | ConfigUnoCSSOptions
|
|
181
190
|
vue?: boolean | ConfigVueOptions
|
|
182
191
|
yml?: boolean | ConfigYmlOptions
|
|
183
|
-
|
|
184
192
|
/**
|
|
185
193
|
* disabled by default
|
|
186
194
|
*/
|
|
187
195
|
svgo?: boolean | ConfigSVGOOptions
|
|
188
|
-
|
|
189
196
|
/**
|
|
190
197
|
* disabled by default
|
|
191
|
-
*
|
|
192
|
-
* require `eslint-plugin-eslint-plugin` installed mannally
|
|
193
198
|
*/
|
|
194
199
|
eslintPlugin?: boolean | ConfigESLintPluginOptions
|
|
195
200
|
}
|