@ntnyq/eslint-config 7.0.0-beta.17 → 7.0.0-beta.19
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 +26 -26
- package/dist/index.d.mts +422 -353
- package/dist/index.mjs +4 -0
- package/package.json +25 -25
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
[](https://www.npmjs.com/package/@ntnyq/eslint-config)
|
|
9
9
|
[](https://github.com/ntnyq/eslint-config/blob/main/LICENSE)
|
|
10
10
|
|
|
11
|
-
## Requirements
|
|
11
|
+
## 📋 Requirements
|
|
12
12
|
|
|
13
13
|
- Node.js ^22.23.0 || >=24.15.0
|
|
14
14
|
- ESLint ^10.4.0
|
|
@@ -20,15 +20,15 @@
|
|
|
20
20
|
> - Node.js < 20.19.0: use [v5](https://github.com/ntnyq/eslint-config/tree/v5)
|
|
21
21
|
> - Node.js < 22.23.0: use [v6](https://github.com/ntnyq/eslint-config/tree/v6)
|
|
22
22
|
|
|
23
|
-
##
|
|
23
|
+
## ✨ Features
|
|
24
24
|
|
|
25
|
-
- Works out of the box with ESLint flat config.
|
|
26
|
-
- Auto-detects and enables configs by your dependencies and file types.
|
|
27
|
-
- Covers common frontend files: TS, Vue SFC, JSON, Markdown, YAML, TOML.
|
|
28
|
-
- Keeps formatting tool friendly (Prettier or oxfmt).
|
|
29
|
-
- Supports scaling from single apps to monorepos.
|
|
25
|
+
- 🚀 Works out of the box with ESLint flat config.
|
|
26
|
+
- 🔍 Auto-detects and enables configs by your dependencies and file types.
|
|
27
|
+
- 🧩 Covers common frontend files: TS, Vue SFC, JSON, Markdown, YAML, TOML.
|
|
28
|
+
- 🎨 Keeps formatting tool friendly (Prettier or oxfmt).
|
|
29
|
+
- 📈 Supports scaling from single apps to monorepos.
|
|
30
30
|
|
|
31
|
-
## Install
|
|
31
|
+
## 📦 Install
|
|
32
32
|
|
|
33
33
|
```shell
|
|
34
34
|
# pnpm
|
|
@@ -44,7 +44,7 @@ yarn add -D eslint typescript @ntnyq/eslint-config
|
|
|
44
44
|
bun add -D eslint typescript @ntnyq/eslint-config
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
##
|
|
47
|
+
## ⚡ Quick start
|
|
48
48
|
|
|
49
49
|
1. Create `eslint.config.mjs` in project root.
|
|
50
50
|
2. Add npm scripts.
|
|
@@ -72,9 +72,9 @@ export default defineESLintConfig()
|
|
|
72
72
|
pnpm lint
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
-
## Common Frontend Setups
|
|
75
|
+
## 🧰 Common Frontend Setups
|
|
76
76
|
|
|
77
|
-
### Vite + Vue 3 + TypeScript
|
|
77
|
+
### 💚 Vite + Vue 3 + TypeScript
|
|
78
78
|
|
|
79
79
|
```js
|
|
80
80
|
// eslint.config.mjs
|
|
@@ -88,7 +88,7 @@ export default defineESLintConfig({
|
|
|
88
88
|
})
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
-
### Vite + React + TypeScript
|
|
91
|
+
### ⚛️ Vite + React + TypeScript
|
|
92
92
|
|
|
93
93
|
```js
|
|
94
94
|
// eslint.config.mjs
|
|
@@ -102,7 +102,7 @@ export default defineESLintConfig({
|
|
|
102
102
|
})
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
### Monorepo (apps + packages)
|
|
105
|
+
### 🏗️ Monorepo (apps + packages)
|
|
106
106
|
|
|
107
107
|
```js
|
|
108
108
|
// eslint.config.mjs
|
|
@@ -130,9 +130,9 @@ export default defineESLintConfig(
|
|
|
130
130
|
)
|
|
131
131
|
```
|
|
132
132
|
|
|
133
|
-
## Configuration Patterns
|
|
133
|
+
## ⚙️ Configuration Patterns
|
|
134
134
|
|
|
135
|
-
### Enable or disable modules
|
|
135
|
+
### 🎛️ Enable or disable modules
|
|
136
136
|
|
|
137
137
|
```js
|
|
138
138
|
import { defineESLintConfig } from '@ntnyq/eslint-config'
|
|
@@ -145,7 +145,7 @@ export default defineESLintConfig({
|
|
|
145
145
|
})
|
|
146
146
|
```
|
|
147
147
|
|
|
148
|
-
### Override built-in rules
|
|
148
|
+
### 🛠️ Override built-in rules
|
|
149
149
|
|
|
150
150
|
```js
|
|
151
151
|
import { defineESLintConfig } from '@ntnyq/eslint-config'
|
|
@@ -164,7 +164,7 @@ export default defineESLintConfig({
|
|
|
164
164
|
})
|
|
165
165
|
```
|
|
166
166
|
|
|
167
|
-
### Add project-specific flat config blocks
|
|
167
|
+
### 🧱 Add project-specific flat config blocks
|
|
168
168
|
|
|
169
169
|
```js
|
|
170
170
|
import { defineESLintConfig } from '@ntnyq/eslint-config'
|
|
@@ -179,14 +179,14 @@ export default defineESLintConfig({}, [
|
|
|
179
179
|
])
|
|
180
180
|
```
|
|
181
181
|
|
|
182
|
-
## Formatter Integration
|
|
182
|
+
## 🎨 Formatter Integration
|
|
183
183
|
|
|
184
184
|
Use one formatter strategy in a project:
|
|
185
185
|
|
|
186
186
|
- Prettier path: install `prettier` and optional `@ntnyq/prettier-config`
|
|
187
187
|
- Oxfmt path: install `oxfmt`
|
|
188
188
|
|
|
189
|
-
### Prettier example
|
|
189
|
+
### 💅 Prettier example
|
|
190
190
|
|
|
191
191
|
```shell
|
|
192
192
|
pnpm add -D prettier @ntnyq/prettier-config
|
|
@@ -201,7 +201,7 @@ import { defineConfig } from '@ntnyq/prettier-config'
|
|
|
201
201
|
export default defineConfig()
|
|
202
202
|
```
|
|
203
203
|
|
|
204
|
-
### VS Code example
|
|
204
|
+
### 🧑💻 VS Code example
|
|
205
205
|
|
|
206
206
|
```json
|
|
207
207
|
{
|
|
@@ -214,7 +214,7 @@ export default defineConfig()
|
|
|
214
214
|
}
|
|
215
215
|
```
|
|
216
216
|
|
|
217
|
-
## Optional Configs (Disabled by Default)
|
|
217
|
+
## 🧩 Optional Configs (Disabled by Default)
|
|
218
218
|
|
|
219
219
|
- `astro`
|
|
220
220
|
- `eslintPlugin`
|
|
@@ -226,28 +226,28 @@ export default defineConfig()
|
|
|
226
226
|
|
|
227
227
|
Enable them explicitly in `defineESLintConfig({ ... })` when needed.
|
|
228
228
|
|
|
229
|
-
## Inspect Final Rules
|
|
229
|
+
## 🔎 Inspect Final Rules
|
|
230
230
|
|
|
231
231
|
- Online inspector: [eslint-config-inspector.ntnyq.com](https://eslint-config-inspector.ntnyq.com/)
|
|
232
232
|
- Local inspect: `npx eslint --inspect-config path/to/file.ts`
|
|
233
233
|
|
|
234
|
-
## Advanced API
|
|
234
|
+
## 🧠 Advanced API
|
|
235
235
|
|
|
236
236
|
- [Config options type](./src/types/config.ts)
|
|
237
237
|
- [Factory implementation](./src/core.ts)
|
|
238
238
|
|
|
239
|
-
## Versioning Policy
|
|
239
|
+
## 🏷️ Versioning Policy
|
|
240
240
|
|
|
241
241
|
This project follows Semantic Versioning with opinionated lint rules:
|
|
242
242
|
|
|
243
243
|
- Treated as breaking: Node.js engine changes, major plugin incompatibility, broad refactors.
|
|
244
244
|
- Treated as non-breaking: enabling/disabling rules, rule option tuning, dependency bumps.
|
|
245
245
|
|
|
246
|
-
## Credits
|
|
246
|
+
## 🙏 Credits
|
|
247
247
|
|
|
248
248
|
- [@sxzz/eslint-config](https://github.com/sxzz/eslint-config)
|
|
249
249
|
- [@antfu/eslint-config](https://github.com/antfu/eslint-config)
|
|
250
250
|
|
|
251
|
-
## License
|
|
251
|
+
## 📄 License
|
|
252
252
|
|
|
253
253
|
[MIT](./LICENSE) License © 2023-PRESENT [ntnyq](https://github.com/ntnyq)
|