@vllnt/eslint-config 2.0.0 → 2.1.0-canary.093ea10
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 +85 -2
- package/flat/base.d.ts +3 -0
- package/flat/boundaries.d.ts +4 -0
- package/flat/convex-rules/_utils.js +3 -1
- package/flat/convex-rules/namespace-separation.js +3 -3
- package/flat/convex-rules/standard-filenames.js +2 -2
- package/flat/convex.d.ts +4 -0
- package/flat/index.d.ts +7 -0
- package/flat/nextjs.d.ts +4 -0
- package/flat/nodejs.d.ts +4 -0
- package/flat/react.d.ts +4 -0
- package/flat/turbo.d.ts +4 -0
- package/package.json +23 -15
package/README.md
CHANGED
|
@@ -43,7 +43,10 @@ import { nextjs } from "@vllnt/eslint-config/nextjs";
|
|
|
43
43
|
export default [...nextjs];
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
Each preset is an array — spread it into your flat config.
|
|
46
|
+
Each preset is an array — spread it into your flat config. Base and its React,
|
|
47
|
+
Next.js, and Node.js variants enable `projectService: true` for type-aware linting.
|
|
48
|
+
Convex also enables it; Turbo and Boundaries are opt-in additions, not replacements
|
|
49
|
+
for a language preset.
|
|
47
50
|
|
|
48
51
|
## Presets
|
|
49
52
|
|
|
@@ -83,11 +86,76 @@ export default [
|
|
|
83
86
|
];
|
|
84
87
|
```
|
|
85
88
|
|
|
89
|
+
## Inspecting and profiling ESLint
|
|
90
|
+
|
|
91
|
+
Run these commands from the consuming project's root so they use its local ESLint,
|
|
92
|
+
configuration, TypeScript project, and installed version of this package. No extra
|
|
93
|
+
inspector dependency is required.
|
|
94
|
+
|
|
95
|
+
### Inspect the effective configuration
|
|
96
|
+
|
|
97
|
+
```sh
|
|
98
|
+
pnpm exec eslint --inspect-config
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
ESLint downloads on demand (via `npx`) and launches the Config Inspector for the
|
|
102
|
+
project's config file; it takes no file argument. Use its file-matching view to see
|
|
103
|
+
which config objects match a path, where a rule was defined, and the final rule
|
|
104
|
+
options. Check representative files from each environment (for example,
|
|
105
|
+
application code, tests, generated code, and Convex code) because flat config is
|
|
106
|
+
resolved per file.
|
|
107
|
+
|
|
108
|
+
The inspector explains configuration; it does **not** profile lint performance.
|
|
109
|
+
|
|
110
|
+
### Find slow rules
|
|
111
|
+
|
|
112
|
+
```sh
|
|
113
|
+
TIMING=1 pnpm exec eslint .
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
`TIMING=1` prints the ten rules with the highest aggregate execution time after a
|
|
117
|
+
normal lint run. Set `TIMING=all` to display every rule. Treat the percentages as
|
|
118
|
+
directional: type-aware rules often share the one-time cost of creating a
|
|
119
|
+
TypeScript program, so one cold run does not prove that the highest-ranked rule is
|
|
120
|
+
the root cause.
|
|
121
|
+
|
|
122
|
+
### Find slow files and collect granular stats
|
|
123
|
+
|
|
124
|
+
```sh
|
|
125
|
+
pnpm exec eslint . \
|
|
126
|
+
--stats \
|
|
127
|
+
--format json-with-metadata \
|
|
128
|
+
--output-file eslint-stats.json
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
The built-in `json-with-metadata` formatter preserves each file's `stats`,
|
|
132
|
+
including parse, fix, and per-rule lint timings. Use the resulting JSON with a
|
|
133
|
+
stats-aware analyzer or a small script to group by `filePath` and rule ID. Delete
|
|
134
|
+
or gitignore the generated report; it can contain local paths and lint messages.
|
|
135
|
+
|
|
136
|
+
### Profiling best practices
|
|
137
|
+
|
|
138
|
+
1. Profile the same file set and command used by CI, without `--fix`.
|
|
139
|
+
2. Run once to warm the operating system's file cache, then compare several runs.
|
|
140
|
+
Each CLI run is a fresh process, so TypeScript program setup is part of every timing.
|
|
141
|
+
3. Disable ESLint's result cache while benchmarking; cached files have no useful
|
|
142
|
+
rule timings.
|
|
143
|
+
4. Separate parse time from rule time. High parse time usually points to typed
|
|
144
|
+
linting or TypeScript project scope rather than an individual rule.
|
|
145
|
+
5. Use Config Inspector on the slowest representative files to confirm which
|
|
146
|
+
presets and type-aware rules actually apply before changing configuration.
|
|
147
|
+
6. Prefer narrowing ignores, file globs, or TypeScript project scope over disabling
|
|
148
|
+
correctness rules. Re-run the same baseline after every change.
|
|
149
|
+
|
|
150
|
+
See ESLint's official documentation for [Config Inspector](https://eslint.org/docs/latest/use/configure/debug#use-the-config-inspector),
|
|
151
|
+
[rule profiling](https://eslint.org/docs/latest/extend/custom-rules#profile-rule-performance),
|
|
152
|
+
and [stats data](https://eslint.org/docs/latest/extend/stats).
|
|
153
|
+
|
|
86
154
|
---
|
|
87
155
|
|
|
88
156
|
## What's included
|
|
89
157
|
|
|
90
|
-
### Base (
|
|
158
|
+
### Base (also included by React, Next.js, and Node.js)
|
|
91
159
|
|
|
92
160
|
| Plugin | What it does |
|
|
93
161
|
| ------------------------------------------------------------------------------------------------- | -------------------------------------------- |
|
|
@@ -206,6 +274,7 @@ convex/
|
|
|
206
274
|
queries.ts query(), internalQuery()
|
|
207
275
|
mutations.ts mutation(), internalMutation()
|
|
208
276
|
actions.ts action(), internalAction()
|
|
277
|
+
node_actions.ts action(), internalAction() in the Node.js runtime ("use node")
|
|
209
278
|
internal_mutations.ts internalMutation() (optional split)
|
|
210
279
|
validators.ts v.* validators + types
|
|
211
280
|
schema.ts table definitions
|
|
@@ -238,6 +307,20 @@ Add to `.vscode/settings.json` for monorepo support:
|
|
|
238
307
|
}
|
|
239
308
|
```
|
|
240
309
|
|
|
310
|
+
## Documentation and support
|
|
311
|
+
|
|
312
|
+
- [LLM index](llms.txt) · [Changelog](CHANGELOG.md)
|
|
313
|
+
- [Contributing](CONTRIBUTING.md) · [Issues](https://github.com/vllnt/eslint-config/issues)
|
|
314
|
+
- [Security policy and private vulnerability reporting](SECURITY.md)
|
|
315
|
+
|
|
316
|
+
npm `latest` is stable `2.0.0` at this audit. `@canary` selects moving prerelease
|
|
317
|
+
builds; pin and test them before adoption.
|
|
318
|
+
|
|
319
|
+
## Author
|
|
320
|
+
|
|
321
|
+
Built by [bntvllnt](https://github.com/bntvllnt) · [bntvllnt.com](https://bntvllnt.com).
|
|
322
|
+
Part of [@vllnt](https://github.com/vllnt). [Sponsor the work](https://github.com/sponsors/bntvllnt).
|
|
323
|
+
|
|
241
324
|
## License
|
|
242
325
|
|
|
243
326
|
[MIT](LICENSE)
|
package/flat/base.d.ts
ADDED
|
@@ -18,6 +18,7 @@ export const STANDARD_CONVEX_FILENAMES = new Set([
|
|
|
18
18
|
'mutations.ts',
|
|
19
19
|
'actions.ts',
|
|
20
20
|
'internal_mutations.ts',
|
|
21
|
+
'node_actions.ts',
|
|
21
22
|
])
|
|
22
23
|
|
|
23
24
|
/**
|
|
@@ -59,7 +60,8 @@ export function getBasenameNoExt(filePath) {
|
|
|
59
60
|
* @returns {string}
|
|
60
61
|
*/
|
|
61
62
|
export function getFilename(context) {
|
|
62
|
-
|
|
63
|
+
// ESLint reports native separators; normalise so Windows paths match the same checks.
|
|
64
|
+
return (context.physicalFilename ?? context.filename ?? '').replaceAll('\\', '/')
|
|
63
65
|
}
|
|
64
66
|
|
|
65
67
|
/**
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Enforces that Convex factory functions only appear in their designated files:
|
|
4
4
|
* - query / internalQuery -> queries.ts
|
|
5
5
|
* - mutation / internalMutation -> mutations.ts or internal_mutations.ts
|
|
6
|
-
* - action / internalAction -> actions.ts
|
|
6
|
+
* - action / internalAction -> actions.ts or node_actions.ts
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { getConvexFactory, getBasename, getFilename } from './_utils.js'
|
|
@@ -29,8 +29,8 @@ function getAllowedFile(factoryType) {
|
|
|
29
29
|
case 'action':
|
|
30
30
|
case 'internalAction':
|
|
31
31
|
return {
|
|
32
|
-
expectedFile: 'actions.ts',
|
|
33
|
-
isAllowed: (b) => b === 'actions.ts',
|
|
32
|
+
expectedFile: 'actions.ts or node_actions.ts',
|
|
33
|
+
isAllowed: (b) => b === 'actions.ts' || b === 'node_actions.ts',
|
|
34
34
|
}
|
|
35
35
|
default:
|
|
36
36
|
return null
|
|
@@ -17,11 +17,11 @@ const rule = {
|
|
|
17
17
|
type: 'problem',
|
|
18
18
|
docs: {
|
|
19
19
|
description:
|
|
20
|
-
'Convex factory exports must be in standard-named files (queries.ts, mutations.ts, actions.ts, internal_mutations.ts)',
|
|
20
|
+
'Convex factory exports must be in standard-named files (queries.ts, mutations.ts, actions.ts, internal_mutations.ts, node_actions.ts)',
|
|
21
21
|
},
|
|
22
22
|
messages: {
|
|
23
23
|
wrongFilename:
|
|
24
|
-
'Convex {{factoryType}}() exports must be in a standard-named file (queries.ts, mutations.ts, actions.ts, or
|
|
24
|
+
'Convex {{factoryType}}() exports must be in a standard-named file (queries.ts, mutations.ts, actions.ts, internal_mutations.ts, or node_actions.ts). Found in "{{filename}}".',
|
|
25
25
|
},
|
|
26
26
|
schema: [],
|
|
27
27
|
},
|
package/flat/convex.d.ts
ADDED
package/flat/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { nextjs } from "./nextjs.js";
|
|
2
|
+
export { convex } from "./convex.js";
|
|
3
|
+
export { nodejs } from "./nodejs.js";
|
|
4
|
+
export { react } from "./react.js";
|
|
5
|
+
export { base } from "./base.js";
|
|
6
|
+
export { turbo } from "./turbo.js";
|
|
7
|
+
export { boundaries } from "./boundaries.js";
|
package/flat/nextjs.d.ts
ADDED
package/flat/nodejs.d.ts
ADDED
package/flat/react.d.ts
ADDED
package/flat/turbo.d.ts
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vllnt/eslint-config",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.1.0-canary.093ea10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Strict ESLint config for TypeScript projects. All rules enforce error — no warnings.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=20"
|
|
22
22
|
},
|
|
23
|
-
"packageManager": "pnpm@10.
|
|
23
|
+
"packageManager": "pnpm@10.34.8",
|
|
24
24
|
"files": [
|
|
25
25
|
"flat"
|
|
26
26
|
],
|
|
@@ -35,27 +35,27 @@
|
|
|
35
35
|
"./package.json": "./package.json"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
|
-
"test": "node --test tests
|
|
39
|
-
"
|
|
38
|
+
"test": "pnpm check:agents && node --test tests/*.test.js",
|
|
39
|
+
"check:agents": "node -e \"const f=require('node:fs');if(!f.existsSync('AGENTS.md')||f.existsSync('CLAUDE.md')||f.existsSync('.claude'))process.exit(1)\""
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@convex-dev/eslint-plugin": "^
|
|
42
|
+
"@convex-dev/eslint-plugin": "^5.0.0",
|
|
43
43
|
"@eslint/js": "^9.39.5",
|
|
44
|
-
"@next/eslint-plugin-next": "^16.
|
|
44
|
+
"@next/eslint-plugin-next": "^16.4.3",
|
|
45
45
|
"eslint-config-prettier": "^10.1.8",
|
|
46
46
|
"eslint-plugin-boundaries": "^5.4.0",
|
|
47
47
|
"eslint-plugin-css-modules": "^2.12.0",
|
|
48
|
-
"eslint-plugin-functional": "^
|
|
48
|
+
"eslint-plugin-functional": "^10.0.1",
|
|
49
49
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
50
|
-
"eslint-plugin-perfectionist": "^5.
|
|
51
|
-
"eslint-plugin-prettier": "^5.5.
|
|
50
|
+
"eslint-plugin-perfectionist": "^5.13.0",
|
|
51
|
+
"eslint-plugin-prettier": "^5.5.7",
|
|
52
52
|
"eslint-plugin-react": "^7.37.5",
|
|
53
53
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
54
|
-
"eslint-plugin-simple-import-sort": "^
|
|
55
|
-
"eslint-plugin-turbo": "^2.10
|
|
56
|
-
"eslint-plugin-unicorn": "^
|
|
54
|
+
"eslint-plugin-simple-import-sort": "^14.0.0",
|
|
55
|
+
"eslint-plugin-turbo": "^2.11.10",
|
|
56
|
+
"eslint-plugin-unicorn": "^65.0.1",
|
|
57
57
|
"eslint-plugin-write-good-comments": "^0.2.0",
|
|
58
|
-
"typescript-eslint": "
|
|
58
|
+
"typescript-eslint": "8.72.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"eslint": ">=9",
|
|
@@ -73,13 +73,21 @@
|
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@typescript/native": "npm:typescript@7.0.2",
|
|
76
|
-
"convex": "^1.
|
|
76
|
+
"convex": "^1.48.0",
|
|
77
77
|
"eslint": "^9.39.5",
|
|
78
78
|
"typescript": "npm:@typescript/typescript6@^6.0.2"
|
|
79
79
|
},
|
|
80
80
|
"pnpm": {
|
|
81
|
+
"minimumReleaseAge": 10080,
|
|
82
|
+
"minimumReleaseAgeExclude": [
|
|
83
|
+
"@vllnt/*"
|
|
84
|
+
],
|
|
85
|
+
"ignoredBuiltDependencies": [
|
|
86
|
+
"esbuild"
|
|
87
|
+
],
|
|
81
88
|
"overrides": {
|
|
82
|
-
"handlebars": ">=4.7.9"
|
|
89
|
+
"handlebars": ">=4.7.9",
|
|
90
|
+
"deepmerge-ts@<8.0.0": "^8.0.2"
|
|
83
91
|
}
|
|
84
92
|
}
|
|
85
93
|
}
|