@chanyuxi/eslint-waltz 1.5.0 → 1.5.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 CHANGED
@@ -1,95 +1,99 @@
1
- # @chanyuxi/eslint-waltz
2
-
3
- Composable ESLint flat config for JavaScript, TypeScript, JSONC, imports, React, Tailwind CSS, Perfectionist, and Vitest.
4
-
5
- Requires Node.js `>=20.19.0`.
6
-
7
- ## Quick start
8
-
9
- Run the interactive initializer from your project root:
10
-
11
- ```bash
12
- pnpm dlx @chanyuxi/eslint-waltz init
13
- ```
14
-
15
- The initializer detects your package manager and existing dependencies, creates
16
- `eslint.config.ts`, installs missing dependencies for the selected features,
17
- and can configure ESLint fix-on-save in VS Code while preserving existing
18
- settings and comments.
19
-
20
- If the package is already installed, use its local binary:
21
-
22
- ```bash
23
- pnpm exec eslint-waltz init
24
- ```
25
-
26
- ## Configuration
27
-
28
- ```ts
29
- // eslint.config.ts
30
- import waltz from '@chanyuxi/eslint-waltz'
31
-
32
- export default waltz({
33
- ts: true,
34
- react: true,
35
- })
36
- ```
37
-
38
- The default configuration includes JavaScript, stylistic rules, JSONC,
39
- import validation, and Perfectionist's `recommended-alphabetical` preset.
40
- Optional modules are enabled with `ts`, `react`, `tailwindcss`, `gitignore`,
41
- and `vitest`. All options are fully typed.
42
-
43
- ## CLI
44
-
45
- ```bash
46
- eslint-waltz init # create or update eslint.config.ts
47
- eslint-waltz version # print the installed version
48
- ```
49
-
50
- Use `eslint-waltz --help` to see the available commands. VS Code
51
- fix-on-save synchronization is part of `init`.
52
-
53
- ## Advanced options
54
-
55
- ### TypeScript scope
56
-
57
- `ts.files` limits the TypeScript files included by modules that automatically
58
- support TypeScript. JavaScript files keep their normal scope, and a module's
59
- own `files` option can narrow or override it. Vitest also intersects its test
60
- patterns with this scope.
61
-
62
- ```ts
63
- export default waltz({
64
- ts: { files: ['src/**/*.ts'] },
65
- react: true,
66
- })
67
- ```
68
-
69
- ### Module resolution
70
-
71
- Potentially expensive module-resolution rules are disabled by default. Enable
72
- only the rules you need:
73
-
74
- ```ts
75
- export default waltz({
76
- imports: {
77
- overrides: {
78
- 'imports/named': 'error',
79
- 'imports/namespace': 'error',
80
- },
81
- },
82
- })
83
- ```
84
-
85
- ### React settings
86
-
87
- ```ts
88
- export default waltz({
89
- react: {
90
- settings: {
91
- 'react-x': { importSource: 'preact' },
92
- },
93
- },
94
- })
95
- ```
1
+ <p align="center">
2
+ <img src="./assets/images/github_banner_image.png" alt="@chanyuxi/eslint-waltz" width="100%" />
3
+ </p>
4
+
5
+ # @chanyuxi/eslint-waltz
6
+
7
+ Composable ESLint flat config for JavaScript, TypeScript, JSONC, imports, React, Tailwind CSS, Perfectionist, and Vitest.
8
+
9
+ Requires Node.js `>=20.19.0`.
10
+
11
+ ## Quick start
12
+
13
+ Run the interactive initializer from your project root:
14
+
15
+ ```bash
16
+ pnpm dlx @chanyuxi/eslint-waltz init
17
+ ```
18
+
19
+ The initializer detects your package manager and existing dependencies, creates
20
+ `eslint.config.ts`, installs missing dependencies for the selected features,
21
+ and can configure ESLint fix-on-save in VS Code while preserving existing
22
+ settings and comments.
23
+
24
+ If the package is already installed, use its local binary:
25
+
26
+ ```bash
27
+ pnpm exec eslint-waltz init
28
+ ```
29
+
30
+ ## Configuration
31
+
32
+ ```ts
33
+ // eslint.config.ts
34
+ import waltz from '@chanyuxi/eslint-waltz'
35
+
36
+ export default waltz({
37
+ ts: true,
38
+ react: true,
39
+ })
40
+ ```
41
+
42
+ The default configuration includes JavaScript, stylistic rules, JSONC,
43
+ import validation, and Perfectionist's `recommended-alphabetical` preset.
44
+ Optional modules are enabled with `ts`, `react`, `tailwindcss`, `gitignore`,
45
+ and `vitest`. All options are fully typed.
46
+
47
+ ## CLI
48
+
49
+ ```bash
50
+ eslint-waltz init # create or update eslint.config.ts
51
+ eslint-waltz version # print the installed version
52
+ ```
53
+
54
+ Use `eslint-waltz --help` to see the available commands. VS Code
55
+ fix-on-save synchronization is part of `init`.
56
+
57
+ ## Advanced options
58
+
59
+ ### TypeScript scope
60
+
61
+ `ts.files` limits the TypeScript files included by modules that automatically
62
+ support TypeScript. JavaScript files keep their normal scope, and a module's
63
+ own `files` option can narrow or override it. Vitest also intersects its test
64
+ patterns with this scope.
65
+
66
+ ```ts
67
+ export default waltz({
68
+ ts: { files: ['src/**/*.ts'] },
69
+ react: true,
70
+ })
71
+ ```
72
+
73
+ ### Module resolution
74
+
75
+ Potentially expensive module-resolution rules are disabled by default. Enable
76
+ only the rules you need:
77
+
78
+ ```ts
79
+ export default waltz({
80
+ imports: {
81
+ overrides: {
82
+ 'imports/named': 'error',
83
+ 'imports/namespace': 'error',
84
+ },
85
+ },
86
+ })
87
+ ```
88
+
89
+ ### React settings
90
+
91
+ ```ts
92
+ export default waltz({
93
+ react: {
94
+ settings: {
95
+ 'react-x': { importSource: 'preact' },
96
+ },
97
+ },
98
+ })
99
+ ```
package/dist/cli.js CHANGED
@@ -1923,11 +1923,11 @@ async function runCli(args, runtime = {}) {
1923
1923
  return 1;
1924
1924
  }
1925
1925
  function printHelp(output) {
1926
- output.write(`Usage: eslint-waltz <command>
1927
-
1928
- Commands:
1929
- version Display the installed eslint-waltz version
1930
- init Interactively create eslint.config.ts
1926
+ output.write(`Usage: eslint-waltz <command>
1927
+
1928
+ Commands:
1929
+ version Display the installed eslint-waltz version
1930
+ init Interactively create eslint.config.ts
1931
1931
  `);
1932
1932
  }
1933
1933
 
package/dist/index.js CHANGED
@@ -849,8 +849,9 @@ async function stylisticConfig(options = {}, scriptScope) {
849
849
  '@stylistic/jsx-curly-newline': 'error',
850
850
  '@stylistic/jsx-curly-spacing': ['error', 'never'],
851
851
  '@stylistic/jsx-equals-spacing': 'error',
852
- '@stylistic/jsx-first-prop-new-line': 'error',
853
- '@stylistic/jsx-function-call-newline': ['error', 'multiline'],
852
+ // My style is to place each attribute in JSX on its own line, which makes it easier to read.
853
+ '@stylistic/jsx-first-prop-new-line': ['error', 'multiprop'],
854
+ '@stylistic/jsx-function-call-newline': ['error', 'always'],
854
855
  '@stylistic/jsx-indent-props': ['error', 2],
855
856
  '@stylistic/jsx-max-props-per-line': [
856
857
  'error',
package/package.json CHANGED
@@ -1,152 +1,152 @@
1
- {
2
- "name": "@chanyuxi/eslint-waltz",
3
- "type": "module",
4
- "version": "1.5.0",
5
- "packageManager": "pnpm@10.4.1",
6
- "description": "A composable ESLint flat config for JavaScript, TypeScript, JSONC, imports, React, Tailwind CSS, Perfectionist, and Vitest.",
7
- "author": "chanyuxi <2438149743@qq.com> (https://github.com/chanyuxi)",
8
- "license": "ISC",
9
- "homepage": "https://github.com/chanyuxi/eslint-waltz",
10
- "repository": {
11
- "type": "git",
12
- "url": "git+https://github.com/chanyuxi/eslint-waltz.git"
13
- },
14
- "bugs": {
15
- "url": "https://github.com/chanyuxi/eslint-waltz/issues"
16
- },
17
- "publishConfig": {
18
- "access": "public"
19
- },
20
- "keywords": [
21
- "chanyuxi",
22
- "eslint",
23
- "config",
24
- "integration"
25
- ],
26
- "exports": {
27
- ".": {
28
- "types": "./dist/index.d.ts",
29
- "import": "./dist/index.js",
30
- "default": "./dist/index.js"
31
- }
32
- },
33
- "bin": {
34
- "eslint-waltz": "dist/cli.js"
35
- },
36
- "files": [
37
- "dist"
38
- ],
39
- "engines": {
40
- "node": ">=20.19.0"
41
- },
42
- "scripts": {
43
- "build": "rimraf ./dist && pnpm gen && rollup -c rollup.config.ts --configPlugin @rollup/plugin-typescript",
44
- "gen": "tsx scripts/typegen.ts",
45
- "lint": "eslint .",
46
- "lint:fix": "eslint . --fix",
47
- "typeCheck": "pnpm gen && tsc --noEmit -p tsconfig.test.json",
48
- "test": "vitest run",
49
- "check": "pnpm run typeCheck && pnpm run lint && pnpm run test",
50
- "changeset": "changeset",
51
- "version": "changeset version && pnpm install --lockfile-only",
52
- "release": "changeset publish",
53
- "prepack": "pnpm build",
54
- "prepare": "husky"
55
- },
56
- "peerDependencies": {
57
- "@vitest/eslint-plugin": "^1.6.27",
58
- "eslint": "^10.10.0",
59
- "eslint-config-flat-gitignore": "^2.4.0",
60
- "eslint-plugin-import-x": "^4.17.1",
61
- "eslint-plugin-jsonc": "^3.4.2",
62
- "eslint-plugin-perfectionist": "^5.11.0",
63
- "eslint-plugin-react-debug": "^5.19.0",
64
- "eslint-plugin-react-dom": "^5.19.0",
65
- "eslint-plugin-react-hooks-extra": "^2.13.0",
66
- "eslint-plugin-react-naming-convention": "^5.19.0",
67
- "eslint-plugin-react-web-api": "^5.19.0",
68
- "eslint-plugin-react-x": "^5.19.0",
69
- "eslint-plugin-tailwindcss": "^4.4.0",
70
- "jsonc-eslint-parser": "^3.3.0",
71
- "tailwindcss": "^4.0.0",
72
- "typescript-eslint": "^8.70.0"
73
- },
74
- "peerDependenciesMeta": {
75
- "@vitest/eslint-plugin": {
76
- "optional": true
77
- },
78
- "eslint-config-flat-gitignore": {
79
- "optional": true
80
- },
81
- "eslint-plugin-react-debug": {
82
- "optional": true
83
- },
84
- "eslint-plugin-react-dom": {
85
- "optional": true
86
- },
87
- "eslint-plugin-react-hooks-extra": {
88
- "optional": true
89
- },
90
- "eslint-plugin-react-naming-convention": {
91
- "optional": true
92
- },
93
- "eslint-plugin-react-web-api": {
94
- "optional": true
95
- },
96
- "eslint-plugin-react-x": {
97
- "optional": true
98
- },
99
- "eslint-plugin-tailwindcss": {
100
- "optional": true
101
- },
102
- "tailwindcss": {
103
- "optional": true
104
- },
105
- "typescript-eslint": {
106
- "optional": true
107
- }
108
- },
109
- "dependencies": {
110
- "@clack/prompts": "^1.8.1",
111
- "@eslint/js": "^10.0.1",
112
- "@stylistic/eslint-plugin": "^5.10.0",
113
- "globals": "^17.12.0",
114
- "jsonc-parser": "^3.3.1"
115
- },
116
- "devDependencies": {
117
- "@changesets/cli": "^3.0.2",
118
- "@commitlint/cli": "^19.8.1",
119
- "@commitlint/config-conventional": "^19.8.1",
120
- "@commitlint/types": "^19.8.1",
121
- "@rollup/plugin-commonjs": "^28.0.6",
122
- "@rollup/plugin-node-resolve": "^16.0.1",
123
- "@rollup/plugin-typescript": "^12.1.4",
124
- "@types/node": "^24.1.0",
125
- "@vitest/eslint-plugin": "^1.6.27",
126
- "eslint": "^10.10.0",
127
- "eslint-config-flat-gitignore": "^2.4.0",
128
- "eslint-plugin-import-x": "^4.17.1",
129
- "eslint-plugin-jsonc": "^3.4.2",
130
- "eslint-plugin-perfectionist": "^5.11.0",
131
- "eslint-plugin-react-debug": "^5.19.0",
132
- "eslint-plugin-react-dom": "^5.19.0",
133
- "eslint-plugin-react-hooks-extra": "^2.13.0",
134
- "eslint-plugin-react-naming-convention": "^5.19.0",
135
- "eslint-plugin-react-web-api": "^5.19.0",
136
- "eslint-plugin-react-x": "^5.19.0",
137
- "eslint-plugin-tailwindcss": "^4.4.0",
138
- "eslint-typegen": "^2.3.1",
139
- "husky": "^9.1.7",
140
- "jiti": "^2.7.0",
141
- "jsonc-eslint-parser": "^3.3.0",
142
- "rimraf": "^6.0.1",
143
- "rollup": "^4.46.2",
144
- "rollup-plugin-dts": "^6.2.1",
145
- "tailwindcss": "^4.3.3",
146
- "tslib": "^2.8.1",
147
- "tsx": "^4.20.3",
148
- "typescript": "^5.8.3",
149
- "typescript-eslint": "^8.70.0",
150
- "vitest": "^4.0.18"
151
- }
152
- }
1
+ {
2
+ "name": "@chanyuxi/eslint-waltz",
3
+ "type": "module",
4
+ "version": "1.5.1",
5
+ "packageManager": "pnpm@10.4.1",
6
+ "description": "A composable ESLint flat config for JavaScript, TypeScript, JSONC, imports, React, Tailwind CSS, Perfectionist, and Vitest.",
7
+ "author": "chanyuxi <2438149743@qq.com> (https://github.com/chanyuxi)",
8
+ "license": "ISC",
9
+ "homepage": "https://github.com/chanyuxi/eslint-waltz",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/chanyuxi/eslint-waltz.git"
13
+ },
14
+ "bugs": {
15
+ "url": "https://github.com/chanyuxi/eslint-waltz/issues"
16
+ },
17
+ "publishConfig": {
18
+ "access": "public"
19
+ },
20
+ "keywords": [
21
+ "chanyuxi",
22
+ "eslint",
23
+ "config",
24
+ "integration"
25
+ ],
26
+ "exports": {
27
+ ".": {
28
+ "types": "./dist/index.d.ts",
29
+ "import": "./dist/index.js",
30
+ "default": "./dist/index.js"
31
+ }
32
+ },
33
+ "bin": {
34
+ "eslint-waltz": "dist/cli.js"
35
+ },
36
+ "files": [
37
+ "dist"
38
+ ],
39
+ "engines": {
40
+ "node": ">=20.19.0"
41
+ },
42
+ "scripts": {
43
+ "build": "rimraf ./dist && pnpm gen && rollup -c rollup.config.ts --configPlugin @rollup/plugin-typescript",
44
+ "gen": "tsx scripts/typegen.ts",
45
+ "lint": "eslint .",
46
+ "lint:fix": "eslint . --fix",
47
+ "typeCheck": "pnpm gen && tsc --noEmit -p tsconfig.test.json",
48
+ "test": "vitest run",
49
+ "check": "pnpm run typeCheck && pnpm run lint && pnpm run test",
50
+ "changeset": "changeset",
51
+ "version": "changeset version && pnpm install --lockfile-only",
52
+ "release": "changeset publish",
53
+ "prepack": "pnpm build",
54
+ "prepare": "husky"
55
+ },
56
+ "peerDependencies": {
57
+ "@vitest/eslint-plugin": "^1.6.27",
58
+ "eslint": "^10.10.0",
59
+ "eslint-config-flat-gitignore": "^2.4.0",
60
+ "eslint-plugin-import-x": "^4.17.1",
61
+ "eslint-plugin-jsonc": "^3.4.2",
62
+ "eslint-plugin-perfectionist": "^5.11.0",
63
+ "eslint-plugin-react-debug": "^5.19.0",
64
+ "eslint-plugin-react-dom": "^5.19.0",
65
+ "eslint-plugin-react-hooks-extra": "^2.13.0",
66
+ "eslint-plugin-react-naming-convention": "^5.19.0",
67
+ "eslint-plugin-react-web-api": "^5.19.0",
68
+ "eslint-plugin-react-x": "^5.19.0",
69
+ "eslint-plugin-tailwindcss": "^4.4.0",
70
+ "jsonc-eslint-parser": "^3.3.0",
71
+ "tailwindcss": "^4.0.0",
72
+ "typescript-eslint": "^8.70.0"
73
+ },
74
+ "peerDependenciesMeta": {
75
+ "@vitest/eslint-plugin": {
76
+ "optional": true
77
+ },
78
+ "eslint-config-flat-gitignore": {
79
+ "optional": true
80
+ },
81
+ "eslint-plugin-react-debug": {
82
+ "optional": true
83
+ },
84
+ "eslint-plugin-react-dom": {
85
+ "optional": true
86
+ },
87
+ "eslint-plugin-react-hooks-extra": {
88
+ "optional": true
89
+ },
90
+ "eslint-plugin-react-naming-convention": {
91
+ "optional": true
92
+ },
93
+ "eslint-plugin-react-web-api": {
94
+ "optional": true
95
+ },
96
+ "eslint-plugin-react-x": {
97
+ "optional": true
98
+ },
99
+ "eslint-plugin-tailwindcss": {
100
+ "optional": true
101
+ },
102
+ "tailwindcss": {
103
+ "optional": true
104
+ },
105
+ "typescript-eslint": {
106
+ "optional": true
107
+ }
108
+ },
109
+ "dependencies": {
110
+ "@clack/prompts": "^1.8.1",
111
+ "@eslint/js": "^10.0.1",
112
+ "@stylistic/eslint-plugin": "^5.10.0",
113
+ "globals": "^17.12.0",
114
+ "jsonc-parser": "^3.3.1"
115
+ },
116
+ "devDependencies": {
117
+ "@changesets/cli": "^3.0.2",
118
+ "@commitlint/cli": "^19.8.1",
119
+ "@commitlint/config-conventional": "^19.8.1",
120
+ "@commitlint/types": "^19.8.1",
121
+ "@rollup/plugin-commonjs": "^28.0.6",
122
+ "@rollup/plugin-node-resolve": "^16.0.1",
123
+ "@rollup/plugin-typescript": "^12.1.4",
124
+ "@types/node": "^24.1.0",
125
+ "@vitest/eslint-plugin": "^1.6.27",
126
+ "eslint": "^10.10.0",
127
+ "eslint-config-flat-gitignore": "^2.4.0",
128
+ "eslint-plugin-import-x": "^4.17.1",
129
+ "eslint-plugin-jsonc": "^3.4.2",
130
+ "eslint-plugin-perfectionist": "^5.11.0",
131
+ "eslint-plugin-react-debug": "^5.19.0",
132
+ "eslint-plugin-react-dom": "^5.19.0",
133
+ "eslint-plugin-react-hooks-extra": "^2.13.0",
134
+ "eslint-plugin-react-naming-convention": "^5.19.0",
135
+ "eslint-plugin-react-web-api": "^5.19.0",
136
+ "eslint-plugin-react-x": "^5.19.0",
137
+ "eslint-plugin-tailwindcss": "^4.4.0",
138
+ "eslint-typegen": "^2.3.1",
139
+ "husky": "^9.1.7",
140
+ "jiti": "^2.7.0",
141
+ "jsonc-eslint-parser": "^3.3.0",
142
+ "rimraf": "^6.0.1",
143
+ "rollup": "^4.46.2",
144
+ "rollup-plugin-dts": "^6.2.1",
145
+ "tailwindcss": "^4.3.3",
146
+ "tslib": "^2.8.1",
147
+ "tsx": "^4.20.3",
148
+ "typescript": "^5.8.3",
149
+ "typescript-eslint": "^8.70.0",
150
+ "vitest": "^4.0.18"
151
+ }
152
+ }