@syntopica/eslint-config 0.8.0 → 0.9.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 +9 -6
- package/package.json +28 -41
- package/src/nextjs.ts +9 -0
- package/src/vite-react.ts +8 -0
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ Tailwind, accessibility, and code-quality (including
|
|
|
7
7
|
|
|
8
8
|
- **Public API (semver):** see [PUBLIC_API.md](./PUBLIC_API.md).
|
|
9
9
|
- **Platform decisions:**
|
|
10
|
-
[engineering-baseline/docs/platform-decisions.md](https://github.com/
|
|
10
|
+
[engineering-baseline/docs/platform-decisions.md](https://github.com/syntopica/codeality/blob/main/docs/platform-decisions.md).
|
|
11
11
|
|
|
12
12
|
## Requirements
|
|
13
13
|
|
|
@@ -41,7 +41,7 @@ framework-specific plugins remain peers.
|
|
|
41
41
|
2. Add `eslint.config.ts` (or `.mjs`) using `jiti` / `tsx` / Node 22+ TypeScript
|
|
42
42
|
support as needed.
|
|
43
43
|
3. Follow
|
|
44
|
-
[docs/adoption/new-repo.md](https://github.com/
|
|
44
|
+
[docs/adoption/new-repo.md](https://github.com/syntopica/codeality/blob/main/docs/adoption/new-repo.md).
|
|
45
45
|
|
|
46
46
|
Minimal `eslint.config.ts` (Node / library):
|
|
47
47
|
|
|
@@ -54,14 +54,14 @@ export default createBaseConfig({ tsconfigRootDir: import.meta.dirname })
|
|
|
54
54
|
Next.js App Router: import `createNextjsConfig` from
|
|
55
55
|
`@syntopica/eslint-config/nextjs` and compose with `createBaseConfig` as in the
|
|
56
56
|
the Next.js template in
|
|
57
|
-
[engineering-baseline](https://github.com/
|
|
57
|
+
[engineering-baseline](https://github.com/syntopica/codeality/tree/main/templates/nextjs-app).
|
|
58
58
|
|
|
59
59
|
## Existing project
|
|
60
60
|
|
|
61
61
|
See
|
|
62
|
-
[docs/adoption/existing-repo.md](https://github.com/
|
|
62
|
+
[docs/adoption/existing-repo.md](https://github.com/syntopica/codeality/blob/main/docs/adoption/existing-repo.md)
|
|
63
63
|
and
|
|
64
|
-
[docs/migration.md](https://github.com/
|
|
64
|
+
[docs/migration.md](https://github.com/syntopica/codeality/blob/main/docs/migration.md).
|
|
65
65
|
Migrate to flat config first, then layer `@syntopica/eslint-config`.
|
|
66
66
|
|
|
67
67
|
## Stacks
|
|
@@ -87,7 +87,10 @@ The list is transitive: `/code-quality` also pulls in what `/testing` needs, and
|
|
|
87
87
|
|
|
88
88
|
`/code-quality` composes `/testing` unconditionally, so
|
|
89
89
|
`eslint-plugin-testing-library` is required there even in a project with no
|
|
90
|
-
tests.
|
|
90
|
+
tests. Its four peers are therefore declared as required rather than optional:
|
|
91
|
+
with `auto-install-peers=true` (the templates' `.npmrc`) pnpm installs them, and
|
|
92
|
+
without it the install warns, instead of ESLint dying at config load with
|
|
93
|
+
`Cannot find module '@vitest/eslint-plugin'`.
|
|
91
94
|
|
|
92
95
|
## CLI helper
|
|
93
96
|
|
package/package.json
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syntopica/eslint-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"private": false,
|
|
5
|
-
"packageManager": "pnpm@11.25.0",
|
|
6
5
|
"license": "MIT",
|
|
7
6
|
"description": "Shared ESLint configuration baseline",
|
|
8
7
|
"repository": {
|
|
9
8
|
"type": "git",
|
|
10
|
-
"url": "git+https://github.com/
|
|
9
|
+
"url": "git+https://github.com/syntopica/codeality.git",
|
|
11
10
|
"directory": "packages/eslint-config"
|
|
12
11
|
},
|
|
13
|
-
"homepage": "https://github.com/
|
|
12
|
+
"homepage": "https://github.com/syntopica/codeality/tree/main/packages/eslint-config#readme",
|
|
14
13
|
"bugs": {
|
|
15
|
-
"url": "https://github.com/
|
|
14
|
+
"url": "https://github.com/syntopica/codeality/issues"
|
|
16
15
|
},
|
|
17
16
|
"publishConfig": {
|
|
18
17
|
"access": "public"
|
|
@@ -44,24 +43,15 @@
|
|
|
44
43
|
"./testing": "./src/testing.ts",
|
|
45
44
|
"./data-files": "./src/data-files.ts"
|
|
46
45
|
},
|
|
47
|
-
"scripts": {
|
|
48
|
-
"fix": "pnpm run lint:fix",
|
|
49
|
-
"lint": "eslint src --max-warnings 0",
|
|
50
|
-
"lint:fix": "eslint src --fix",
|
|
51
|
-
"lint:suppress": "eslint src --suppress-all",
|
|
52
|
-
"lint:prune": "eslint src --prune-suppressions",
|
|
53
|
-
"type-check": "tsc --noEmit -p tsconfig.json",
|
|
54
|
-
"publish:check": "baseline-licenses && publint --strict && attw --pack . --profile node16 --ignore-rules cjs-resolves-to-esm internal-resolution-error"
|
|
55
|
-
},
|
|
56
46
|
"dependencies": {
|
|
57
47
|
"@eslint/js": "^10.0.1",
|
|
58
48
|
"eslint-config-prettier": "^10.1.8",
|
|
59
49
|
"eslint-import-resolver-typescript": "^4.4.5",
|
|
60
50
|
"eslint-plugin-import": "^2.32.0",
|
|
61
51
|
"eslint-plugin-promise": "^7.3.0",
|
|
62
|
-
"eslint-plugin-security": "^4.0
|
|
52
|
+
"eslint-plugin-security": "^4.2.0",
|
|
63
53
|
"eslint-plugin-unused-imports": "^4.4.1",
|
|
64
|
-
"typescript-eslint": "^8.
|
|
54
|
+
"typescript-eslint": "^8.71.0"
|
|
65
55
|
},
|
|
66
56
|
"peerDependencies": {
|
|
67
57
|
"@eslint/markdown": ">=8.0.0",
|
|
@@ -93,9 +83,6 @@
|
|
|
93
83
|
"@next/eslint-plugin-next": {
|
|
94
84
|
"optional": true
|
|
95
85
|
},
|
|
96
|
-
"@vitest/eslint-plugin": {
|
|
97
|
-
"optional": true
|
|
98
|
-
},
|
|
99
86
|
"eslint-config-next": {
|
|
100
87
|
"optional": true
|
|
101
88
|
},
|
|
@@ -105,9 +92,6 @@
|
|
|
105
92
|
"eslint-plugin-boundaries": {
|
|
106
93
|
"optional": true
|
|
107
94
|
},
|
|
108
|
-
"eslint-plugin-code-policy": {
|
|
109
|
-
"optional": true
|
|
110
|
-
},
|
|
111
95
|
"eslint-plugin-jsx-a11y": {
|
|
112
96
|
"optional": true
|
|
113
97
|
},
|
|
@@ -120,15 +104,9 @@
|
|
|
120
104
|
"eslint-plugin-react-refresh": {
|
|
121
105
|
"optional": true
|
|
122
106
|
},
|
|
123
|
-
"eslint-plugin-sonarjs": {
|
|
124
|
-
"optional": true
|
|
125
|
-
},
|
|
126
107
|
"eslint-plugin-tailwindcss": {
|
|
127
108
|
"optional": true
|
|
128
109
|
},
|
|
129
|
-
"eslint-plugin-testing-library": {
|
|
130
|
-
"optional": true
|
|
131
|
-
},
|
|
132
110
|
"eslint-plugin-unicorn": {
|
|
133
111
|
"optional": true
|
|
134
112
|
},
|
|
@@ -157,30 +135,39 @@
|
|
|
157
135
|
"devDependencies": {
|
|
158
136
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
159
137
|
"@eslint/markdown": "^8.0.3",
|
|
160
|
-
"@next/eslint-plugin-next": "^16.
|
|
161
|
-
"@types/node": "^26.4
|
|
138
|
+
"@next/eslint-plugin-next": "^16.4.0",
|
|
139
|
+
"@types/node": "^26.6.4",
|
|
162
140
|
"@vitest/eslint-plugin": "^1.6.27",
|
|
163
|
-
"eslint": "^10.
|
|
164
|
-
"eslint-plugin-astro": "^3.1
|
|
141
|
+
"eslint": "^10.12.0",
|
|
142
|
+
"eslint-plugin-astro": "^3.2.1",
|
|
165
143
|
"eslint-plugin-boundaries": "^7.2.0",
|
|
166
|
-
"eslint-plugin-code-policy": "
|
|
144
|
+
"eslint-plugin-code-policy": "0.8.0",
|
|
167
145
|
"eslint-plugin-jsonc": "^3.4.2",
|
|
168
146
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
169
147
|
"eslint-plugin-react": "^7.37.5",
|
|
170
148
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
171
|
-
"eslint-plugin-react-refresh": "^0.5.
|
|
172
|
-
"eslint-plugin-regexp": "^3.
|
|
173
|
-
"eslint-plugin-sonarjs": "^4.2.
|
|
149
|
+
"eslint-plugin-react-refresh": "^0.5.7",
|
|
150
|
+
"eslint-plugin-regexp": "^3.3.1",
|
|
151
|
+
"eslint-plugin-sonarjs": "^4.2.2",
|
|
174
152
|
"eslint-plugin-tailwindcss": "^4.4.0",
|
|
175
153
|
"eslint-plugin-testing-library": "^7.16.2",
|
|
176
|
-
"eslint-plugin-unicorn": "^
|
|
177
|
-
"eslint-plugin-vue": "^10.
|
|
154
|
+
"eslint-plugin-unicorn": "^77.0.0",
|
|
155
|
+
"eslint-plugin-vue": "^10.11.1",
|
|
178
156
|
"eslint-plugin-vuejs-accessibility": "^2.6.0",
|
|
179
157
|
"eslint-plugin-yml": "^3.8.1",
|
|
180
|
-
"globals": "^17.
|
|
158
|
+
"globals": "^17.13.0",
|
|
181
159
|
"jiti": "^2.7.0",
|
|
182
|
-
"publint": "^0.3.
|
|
160
|
+
"publint": "^0.3.25",
|
|
183
161
|
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
184
162
|
"vue-eslint-parser": "^10.4.1"
|
|
163
|
+
},
|
|
164
|
+
"scripts": {
|
|
165
|
+
"fix": "pnpm run lint:fix",
|
|
166
|
+
"lint": "eslint src --max-warnings 0",
|
|
167
|
+
"lint:fix": "eslint src --fix",
|
|
168
|
+
"lint:suppress": "eslint src --suppress-all",
|
|
169
|
+
"lint:prune": "eslint src --prune-suppressions",
|
|
170
|
+
"type-check": "tsc --noEmit -p tsconfig.json",
|
|
171
|
+
"publish:check": "baseline-licenses && publint --strict && attw --pack . --profile node16 --ignore-rules cjs-resolves-to-esm internal-resolution-error"
|
|
185
172
|
}
|
|
186
|
-
}
|
|
173
|
+
}
|
package/src/nextjs.ts
CHANGED
|
@@ -56,6 +56,15 @@ export const createNextjsConfig = (options: NextjsConfigOptions = {}) => {
|
|
|
56
56
|
},
|
|
57
57
|
},
|
|
58
58
|
|
|
59
|
+
// TypeScript props are the validation. `react/prop-types` cannot see through
|
|
60
|
+
// `forwardRef`'s generic, so every ref-forwarding primitive that
|
|
61
|
+
// destructures its props (shadcn's whole `ui/` folder) reported
|
|
62
|
+
// "'className' is missing in props validation".
|
|
63
|
+
{
|
|
64
|
+
files: ['**/*.{ts,tsx}'],
|
|
65
|
+
rules: { 'react/prop-types': 'off' },
|
|
66
|
+
},
|
|
67
|
+
|
|
59
68
|
{
|
|
60
69
|
files: ['**/*.{js,jsx,ts,tsx}'],
|
|
61
70
|
plugins: {
|
package/src/vite-react.ts
CHANGED
|
@@ -31,6 +31,14 @@ export const createViteReactConfig = (options: ViteReactConfigOptions = {}) => [
|
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
33
|
},
|
|
34
|
+
// TypeScript props are the validation. `react/prop-types` cannot see through
|
|
35
|
+
// `forwardRef`'s generic, so every ref-forwarding primitive that
|
|
36
|
+
// destructures its props (shadcn's whole `ui/` folder) reported
|
|
37
|
+
// "'className' is missing in props validation".
|
|
38
|
+
{
|
|
39
|
+
files: ['**/*.{ts,tsx}'],
|
|
40
|
+
rules: { 'react/prop-types': 'off' },
|
|
41
|
+
},
|
|
34
42
|
{
|
|
35
43
|
files: ['**/*.{ts,tsx,js,jsx}'],
|
|
36
44
|
plugins: {
|