@chanyuxi/eslint-waltz 1.2.0 → 1.3.1
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 +57 -8
- package/dist/index.d.ts +3 -10633
- package/dist/index.js +249 -134
- package/dist/typegen.d.ts +8599 -0
- package/dist/types.d.ts +237 -0
- package/package.json +151 -151
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @chanyuxi/eslint-waltz
|
|
2
2
|
|
|
3
|
-
Composable ESLint flat config for JavaScript, TypeScript, JSONC, React, Tailwind CSS, Perfectionist, and Vitest.
|
|
3
|
+
Composable ESLint flat config for JavaScript, TypeScript, JSONC, React, Tailwind CSS, Perfectionist, and Vitest.
|
|
4
4
|
|
|
5
5
|
Requires Node.js `>=20.19.0`.
|
|
6
6
|
|
|
@@ -26,12 +26,12 @@ pnpm add -D eslint-plugin-react-x eslint-plugin-react-debug eslint-plugin-react-
|
|
|
26
26
|
# Tailwind CSS
|
|
27
27
|
pnpm add -D eslint-plugin-tailwindcss tailwindcss
|
|
28
28
|
|
|
29
|
-
# .gitignore support
|
|
30
|
-
pnpm add -D eslint-config-flat-gitignore
|
|
31
|
-
|
|
32
|
-
# Vitest
|
|
33
|
-
pnpm add -D @vitest/eslint-plugin vitest
|
|
34
|
-
```
|
|
29
|
+
# .gitignore support
|
|
30
|
+
pnpm add -D eslint-config-flat-gitignore
|
|
31
|
+
|
|
32
|
+
# Vitest
|
|
33
|
+
pnpm add -D @vitest/eslint-plugin vitest
|
|
34
|
+
```
|
|
35
35
|
|
|
36
36
|
## Usage
|
|
37
37
|
|
|
@@ -52,6 +52,55 @@ Enabled by default:
|
|
|
52
52
|
- import validation
|
|
53
53
|
- Perfectionist with `recommended-alphabetical`
|
|
54
54
|
|
|
55
|
-
Optional: `ts`, `react`, `tailwindcss`, `gitignore`, and `vitest`.
|
|
55
|
+
Optional: `ts`, `react`, `tailwindcss`, `gitignore`, and `vitest`.
|
|
56
56
|
|
|
57
57
|
More options are documented in the exported TypeScript types.
|
|
58
|
+
|
|
59
|
+
The potentially expensive module-resolution rules are disabled by default. Enable
|
|
60
|
+
them explicitly when your project needs them:
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
export default waltz({
|
|
64
|
+
imports: {
|
|
65
|
+
overrides: {
|
|
66
|
+
'imports/named': 'error',
|
|
67
|
+
'imports/namespace': 'error',
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
})
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## TypeScript file scope
|
|
74
|
+
|
|
75
|
+
When `ts.files` is provided, it is the maximum TypeScript scope used by the
|
|
76
|
+
other modules that automatically include TypeScript files. JavaScript files
|
|
77
|
+
keep their normal scope, and a module's own `files` option can override this
|
|
78
|
+
limit. Vitest additionally intersects its test-file patterns with this scope.
|
|
79
|
+
|
|
80
|
+
```ts
|
|
81
|
+
export default waltz({
|
|
82
|
+
ts: { files: ['src/**/*.ts'] },
|
|
83
|
+
react: true,
|
|
84
|
+
})
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## VS Code synchronization
|
|
88
|
+
|
|
89
|
+
Run this command from your project root to enable ESLint fix-on-save settings
|
|
90
|
+
while preserving existing `.vscode/settings.json` values and comments:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
npx eslint-waltz sync-vscode
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
React plugin settings can be customized when needed:
|
|
97
|
+
|
|
98
|
+
```ts
|
|
99
|
+
export default waltz({
|
|
100
|
+
react: {
|
|
101
|
+
settings: {
|
|
102
|
+
'react-x': { importSource: 'preact' },
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
})
|
|
106
|
+
```
|