@vllnt/eslint-config 2.1.1-canary.9df17f8 → 2.2.0-canary.fdeee40
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/CHANGELOG.md +155 -0
- package/README.md +50 -22
- package/flat/core/compat.js +15 -0
- package/flat/core/good-practices.js +2 -1
- package/flat/core/react.js +3 -2
- package/llms.txt +73 -0
- package/package.json +19 -9
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
6
|
+
|
|
7
|
+
## [2.2.0] - 2026-11-27
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- ESLint 10 support (#42). The `eslint >=9` peer range is unchanged and is now tested on 9 and 10: `pnpm test` runs the smoke, lint-behavior and Convex rule tests again on ESLint 10 through an `eslint10` development alias. `@eslint/compat` is a new dependency; it and its `@eslint/core` dependency declare Node `^20.19.0 || ^22.13.0 || >=24`, so Node 20.0 to 20.18 and 22.0 to 22.12 get an engine warning (or an install failure with `engine-strict`), while this package's `engines.node` stays `>=20`. ESLint 11 and later are inside the `>=9` range but untested. On ESLint 10, `eslint-plugin-react` 7.37.5 and `eslint-plugin-jsx-a11y` 6.10.2 print a peer warning, because their own ranges stop at 9.
|
|
12
|
+
- Privacy Guard CI check and a pre-publish package content check, so personal or private data is blocked before merge and before npm publish.
|
|
13
|
+
- Privacy Guard is re-synced with the skills template so the required check can use an optional SHA baseline. This repository has no baseline, so the check stays full-history.
|
|
14
|
+
- The npm package now ships `CHANGELOG.md` and `llms.txt` next to `README.md`, so coding agents can read docs that match the installed version from `node_modules/@vllnt/eslint-config/`. README and `llms.txt` each have a "For coding agents" note, and `llms.txt` links to the shipped files with relative paths and to the vllnt oss index.
|
|
15
|
+
- A package-contents test runs `npm pack --dry-run` and fails when `README.md`, `LICENSE`, `CHANGELOG.md`, `llms.txt` or an `exports` target is missing from the tarball, when tests, scripts or contributor files (`AGENTS.md`, `CONTRIBUTING.md`) are packed, or when a relative link in `llms.txt` points outside the tarball.
|
|
16
|
+
- `package.json` sets `homepage` to https://oss.vllnt.com/packages/eslint-config and adds the `flat-config`, `convex`, `playwright` and `turborepo` keywords.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- On ESLint 10, every preset built on the base rules (the root entry, Base, React, Next.js and Node.js) crashed: `write-good-comments` with `context.getSourceCode is not a function`, and `eslint-plugin-react` with `contextOrFilename.getFilename is not a function`. The presets now run the rules of `eslint-plugin-write-good-comments`, `eslint-plugin-react` and `eslint-plugin-css-modules` through `fixupRule` from `@eslint/compat`, which adds back the context methods ESLint 10 removed. The rules are replaced in place, so the plugin object stays the one a project imports: a config that registers its own `eslint-plugin-react` next to a preset keeps working, instead of failing with `Cannot redefine plugin "react"`. Rule results on ESLint 9 are unchanged.
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- Dependencies bumped within their majors (#22). Shipped plugins: `@convex-dev/eslint-plugin` 5.0.1, `@next/eslint-plugin-next` 16.4.6, `eslint-plugin-perfectionist` 5.14.0 and `eslint-plugin-turbo` 2.11.13 (2.11.13 changes only its version string). Development: `convex` 1.51.0, pnpm 10.34.9 and a lockfile refresh within the existing ranges. The repository's `handlebars` override now requires 4.7.10.
|
|
25
|
+
- `pnpm audit` is clean in this repository only because of its pnpm overrides, which do not reach consumers. A consumer install still gets `handlebars` 4.7.8 through `eslint-plugin-boundaries` 5 (critical advisories; fixed from Boundaries 7.2.1, #31), `deepmerge-ts` 7 through `eslint-plugin-functional` 10.0.1 (GHSA-ggr8-5vv4-36mx; no `eslint-plugin-functional` release uses `deepmerge-ts` 8 yet) and `minimatch` 10 through `@convex-dev/eslint-plugin` (GHSA-g3hv-75wg-m249; 6.0.0 keeps the same pins). They run only inside ESLint; whether lint input can reach the vulnerable code is not verified.
|
|
26
|
+
- Held majors: `@eslint/js` 10 (it drops ESLint 9, so the presets keep `@eslint/js` 9 on both ESLint majors), `eslint-plugin-unicorn` 66 to 80 (need ESLint >= 10.4), `eslint-plugin-boundaries` 6 and 7 (change what the preset reports, #31). `@convex-dev/eslint-plugin` 6.0.0 and `typescript-eslint` 8.74.0 are newer than the 7-day minimum release age. pnpm 11 and 12 no longer read the install policy from `package.json`, so moving it is left for its own change.
|
|
27
|
+
- README: a "Related packages" section (`@vllnt/typescript`) and a vllnt oss footer. It now describes what the presets actually configure: presets take no options and only subpaths have a default export; the install command pins the ESLint major (`eslint@^10` since this release; `eslint@^9` also works); `typescript` is required by every preset that type-checks; in React and Next.js, `.tsx` and `*.decorator.ts` files (and `*.decorator.ts` in Node.js) check only function names, and Next.js `app/api/**/route.*` drops the naming rule and the enum and `| undefined` bans; css-modules has no rule on; Boundaries needs `boundaries/elements`; `snake-case-filenames` only checks `convex/`; and the Perfectionist, React Hooks and Convex filename rules are listed as configured. Contributor docs that do not ship link to GitHub. Lint rules are unchanged.
|
|
28
|
+
- Canaries always sort above the current stable: the publish workflow bumps the canary base when `package.json` still matches `dist-tags.latest` or that version is already on npm.
|
|
29
|
+
|
|
30
|
+
### Known gaps
|
|
31
|
+
|
|
32
|
+
- Still open for 3.0.0 (#31), because each fix would fail code that lints clean today. In React and Next.js, `.tsx` and `*.decorator.ts` files check only function names, and so do `*.decorator.ts` files in Node.js. Next.js `app/api/**/route.*` drops the enum and `| undefined` bans. css-modules is registered with no rule on. `snake-case-filenames` skips `src/component/`.
|
|
33
|
+
|
|
34
|
+
## [2.1.0] - 2026-11-17
|
|
35
|
+
|
|
36
|
+
### Added
|
|
37
|
+
|
|
38
|
+
- TypeScript declarations for every preset entry point, so TypeScript consumers no longer get TS7016 on `import { nextjs } from "@vllnt/eslint-config"` or the subpath imports under `strict`. A type-check test covers every export.
|
|
39
|
+
- `@vllnt/eslint-config/playwright`, an opt-in overlay for `**/tests/e2e/**/*.{spec,setup}.ts`, `**/e2e/**/*.spec.ts` and `**/playwright.config.{ts,mts}`. It turns off `functional/no-loop-statements` and `max-lines-per-function` there and stops checking object literal key names in `@typescript-eslint/naming-convention`; every other rule, including `write-good-comments` and `unicorn/prevent-abbreviations`, stays on. Spread it after a language preset (`[...nextjs, ...playwright]`).
|
|
40
|
+
- `@vllnt/eslint-config/ignores`, a shared list of tool output to ignore (`coverage/`, `playwright-report/`, `test-results/`, `.turbo/`, `.worktrees/` at any depth; `dist/` and `build/` at the config root), so repos stop copying and drifting from the same list (part of #16; the React Native entry and the formatter choice remain open).
|
|
41
|
+
- Lint-behavior tests that run real ESLint over fixture files with the Node API, covering the Next.js route handler conventions, the Playwright overlay and the ignores, each with a clean fixture and a near-miss that must still fail (part of #4; the base, nodejs, react and convex presets still need their own lint runs).
|
|
42
|
+
|
|
43
|
+
### Fixed
|
|
44
|
+
|
|
45
|
+
- Convex `standard-filenames` and `namespace-separation` now accept `node_actions.ts` for actions that run in the Node.js runtime.
|
|
46
|
+
- Convex custom rules (`standard-filenames`, `namespace-separation`, `snake-case-filenames`, `no-bare-v-any`) now normalise Windows path separators, so `queries.ts`-style files are no longer reported as misplaced on Windows.
|
|
47
|
+
|
|
48
|
+
### Changed
|
|
49
|
+
|
|
50
|
+
- Next.js preset: route files (`app/**/route.{js,jsx,ts}`) accept `GET`, `HEAD`, `POST`, `PUT`, `PATCH`, `DELETE` and `OPTIONS` as exported function names through a narrow `@typescript-eslint/naming-convention` selector, so apps no longer turn the rule off for them. Any other name still follows the base convention, and `functional/no-loop-statements` stays on in route handlers. `route.tsx` keeps the `.tsx` naming rule, which already accepts PascalCase functions such as `GET` and JSX helpers.
|
|
51
|
+
- Under `app/api/**/route.*`, `@typescript-eslint/naming-convention` stays off, as before. The exported-function allowlist there now also accepts `HEAD`, `PATCH`, `OPTIONS` and `generateStaticParams`, which it used to reject. Turning the naming rule on there is tracked for 3.0.0 in #31.
|
|
52
|
+
- Every preset: object and type property names that need quotes (`'content-type'`, `'@type'`, `'x-default'`) are exempt from `@typescript-eslint/naming-convention`, because an external format fixes their spelling. Names that do not need quotes (`user_id`) are still checked.
|
|
53
|
+
- Next.js preset: ignore `.next/`, `out/`, `build/` and `next-env.d.ts` by default, as Next.js does.
|
|
54
|
+
|
|
55
|
+
- typescript-eslint 8.73.0 adds `@typescript-eslint/no-unsafe-class-instance-assignment`
|
|
56
|
+
to `strictTypeChecked`; it stays off so the upgrade adds no errors. Turning it on is
|
|
57
|
+
tracked for 3.0.0 in #31.
|
|
58
|
+
- Upgrade dependencies: `typescript-eslint` 8.73.0, `@next/eslint-plugin-next` 16.4.3,
|
|
59
|
+
`eslint-plugin-functional` 10.0.1, `eslint-plugin-perfectionist` 5.13.0,
|
|
60
|
+
`eslint-plugin-prettier` 5.5.7, `eslint-plugin-turbo` 2.11.10,
|
|
61
|
+
`eslint-plugin-simple-import-sort` 14.0.0, `eslint-plugin-unicorn` 65.0.1 and `@convex-dev/eslint-plugin` 5.0.0;
|
|
62
|
+
refresh the lockfile. The `typescript-eslint` upgrade enables two more strict
|
|
63
|
+
rules at error level: `@typescript-eslint/no-generated-empty-object-type` and
|
|
64
|
+
`@typescript-eslint/no-unsafe-enum-assignment`. Peer dependency ranges are
|
|
65
|
+
unchanged; `eslint` and `@eslint/js` stay on 9.
|
|
66
|
+
The `eslint-plugin-unicorn` upgrade (62 to 65) can report errors on code that passed
|
|
67
|
+
2.0.0; `eslint --fix` fixes both cases seen in vllnt consumers:
|
|
68
|
+
`unicorn/numeric-separators-style` now checks the digits after the decimal point
|
|
69
|
+
(`0.040_45` becomes `0.04045`), and `unicorn/prefer-set-has` flags more constant
|
|
70
|
+
arrays that are only used for membership checks (`['ui', 'dig'].includes(slug)`
|
|
71
|
+
becomes a `Set` with `.has()`).
|
|
72
|
+
|
|
73
|
+
- Run the org leak gate on pull requests and pushes to main to block secrets and private references.
|
|
74
|
+
|
|
75
|
+
- Test on the patched Node 22.23.4 and 24.22.1 in CI instead of end-of-life Node 20, and publish with Node 24.22.1 from `.node-version` (October 2026 security release). `engines.node` is unchanged.
|
|
76
|
+
- Correct README preset guidance and security release-line documentation; remove
|
|
77
|
+
`llms-full.txt` and retain `llms.txt` as the maintained LLM documentation index.
|
|
78
|
+
- Publish `@latest` only from a pushed `vX.Y.Z` tag on `main` (version and changelog entry must match) instead of on every version change; pin workflow actions to commit SHAs, use least-privilege permissions, and enforce pnpm 10 install policies (minimum release age, blocked install scripts).
|
|
79
|
+
- Test every custom Convex rule and assert that every configured rule id resolves to a registered rule in each preset, so a plugin upgrade that removes a rule fails CI instead of crashing consumers.
|
|
80
|
+
- Consolidate repository contributor guidance in `AGENTS.md` and enforce that it remains the sole agent instruction surface.
|
|
81
|
+
- Document ESLint Config Inspector, aggregate rule timing, granular per-file stats, and repeatable profiling practices.
|
|
82
|
+
- Require agents to verify inherited rules against the lockfile-pinned plugin version and the composed preset source in `AGENTS.md`.
|
|
83
|
+
|
|
84
|
+
### Removed
|
|
85
|
+
|
|
86
|
+
- The `eslint-config-prettier` dependency. No preset imported it, so it never disabled a
|
|
87
|
+
rule; lint behavior is unchanged.
|
|
88
|
+
|
|
89
|
+
### Security
|
|
90
|
+
|
|
91
|
+
- Pin `typescript-eslint` to 8.73.0, whose `@typescript-eslint/typescript-estree` depends on
|
|
92
|
+
`minimatch` ^11.0.1, so that path no longer installs `minimatch` 10.2.6
|
|
93
|
+
(GHSA-g3hv-75wg-m249, a denial of service through glob pattern amplification, fixed in
|
|
94
|
+
11.0.1). Consumers still get the affected version through `@convex-dev/eslint-plugin`, a
|
|
95
|
+
dependency of this package whatever preset is used: every 5.x release pins
|
|
96
|
+
`@typescript-eslint/*` ~8.58, which needs `minimatch` ^10. Until that plugin updates,
|
|
97
|
+
force the fixed version in the consuming project: `"minimatch@>=7.0.0 <11.0.1": "^11.0.1"`
|
|
98
|
+
under `pnpm.overrides` (as this repository does), `overrides` for npm or `resolutions`
|
|
99
|
+
for Yarn. The glob patterns come from the project's own ESLint and TypeScript
|
|
100
|
+
configuration, so the practical risk is a slow lint run.
|
|
101
|
+
|
|
102
|
+
## [2.0.0] - 2026-08-31
|
|
103
|
+
|
|
104
|
+
### Changed
|
|
105
|
+
|
|
106
|
+
- Require the TypeScript 6 compatibility API (`>=6.0.2 <6.1`) for type-aware
|
|
107
|
+
linting and validate the official side-by-side TypeScript 7 compiler setup.
|
|
108
|
+
- Upgrade and pin `typescript-eslint` to `8.68.0` so package managers cannot
|
|
109
|
+
select an unpublished companion package, upgrade `eslint-plugin-functional`
|
|
110
|
+
to its TypeScript 6-compatible major, and refresh compatible lint plugins.
|
|
111
|
+
- Upgrade `@convex-dev/eslint-plugin` to `^4.0.0`, retain the four established
|
|
112
|
+
official rules, and apply the Convex preset directly to sandboxed
|
|
113
|
+
`src/component/**` sources.
|
|
114
|
+
- Correct the documented Node.js runtime floor to 20.
|
|
115
|
+
|
|
116
|
+
### Breaking Changes
|
|
117
|
+
|
|
118
|
+
- TypeScript 5 is no longer supported. Install TypeScript 7 through
|
|
119
|
+
`@typescript/native` and TypeScript 6 under the canonical `typescript` package
|
|
120
|
+
name when using JavaScript-API tooling.
|
|
121
|
+
- Sandboxed `src/component/**` sources now receive the official Convex rules
|
|
122
|
+
directly from the preset.
|
|
123
|
+
|
|
124
|
+
## [1.0.1] - 2026-03-29
|
|
125
|
+
|
|
126
|
+
### Changed
|
|
127
|
+
|
|
128
|
+
- CI: auto-release on push to main when new version detected (replaces manual workflow_dispatch)
|
|
129
|
+
- CI: enforce CHANGELOG.md updated in every PR with version match check
|
|
130
|
+
|
|
131
|
+
### Fixed
|
|
132
|
+
|
|
133
|
+
- Resolve 23 transitive dependency vulnerabilities (1 critical, 14 high, 7 moderate, 1 low) (#12)
|
|
134
|
+
- Bump `@convex-dev/eslint-plugin` ^1.1.1 to ^1.2.1
|
|
135
|
+
- Bump `eslint` (dev) ^9.39.2 to ^9.39.4
|
|
136
|
+
- Add `pnpm.overrides` for `handlebars` (pinned by upstream `@boundaries/elements`)
|
|
137
|
+
- Refresh lockfile to resolve minimatch, picomatch, flatted, brace-expansion to patched versions
|
|
138
|
+
|
|
139
|
+
## [1.0.0] - 2026-03-05
|
|
140
|
+
|
|
141
|
+
### Added
|
|
142
|
+
|
|
143
|
+
- Initial release
|
|
144
|
+
- 7 presets: Base, React, Next.js, Node.js, Convex, Turbo, Boundaries
|
|
145
|
+
- TypeScript-first with `strictTypeChecked` + `stylisticTypeChecked`
|
|
146
|
+
- Prettier built-in as lint errors
|
|
147
|
+
- 7 custom Convex lint rules bundled as `eslint-plugin-convex-rules`
|
|
148
|
+
- Smoke tests with 43 assertions
|
|
149
|
+
- CI/CD with GitHub Actions (test + canary publish + release)
|
|
150
|
+
|
|
151
|
+
[2.2.0]: https://github.com/vllnt/eslint-config/compare/v2.1.0...v2.2.0
|
|
152
|
+
[2.1.0]: https://github.com/vllnt/eslint-config/compare/v2.0.0...v2.1.0
|
|
153
|
+
[2.0.0]: https://github.com/vllnt/eslint-config/compare/v1.0.1...v2.0.0
|
|
154
|
+
[1.0.1]: https://github.com/vllnt/eslint-config/compare/v1.0.0...v1.0.1
|
|
155
|
+
[1.0.0]: https://github.com/vllnt/eslint-config/releases/tag/v1.0.0
|
package/README.md
CHANGED
|
@@ -26,13 +26,19 @@ Every rule enforces `error` — no warnings, no compromises.
|
|
|
26
26
|
## Install
|
|
27
27
|
|
|
28
28
|
```sh
|
|
29
|
-
pnpm add -D @vllnt/eslint-config@^2 @typescript/native@npm:typescript@^7.0.2 eslint prettier typescript@npm:@typescript/typescript6@^6.0.2
|
|
29
|
+
pnpm add -D @vllnt/eslint-config@^2 @typescript/native@npm:typescript@^7.0.2 eslint@^10 prettier typescript@npm:@typescript/typescript6@^6.0.2
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
Version 2 follows the official TypeScript 7 side-by-side migration arrangement:
|
|
33
33
|
`tsc` runs TypeScript 7, while type-aware ESLint tooling imports the TypeScript 6
|
|
34
34
|
JavaScript API through the canonical `typescript` package. TypeScript 5 is no
|
|
35
|
-
longer supported.
|
|
35
|
+
longer supported. ESLint 9 works too (`eslint@^9`).
|
|
36
|
+
|
|
37
|
+
## For coding agents
|
|
38
|
+
|
|
39
|
+
The docs ship inside the package, in `node_modules/@vllnt/eslint-config/`:
|
|
40
|
+
`README.md`, `llms.txt` and `CHANGELOG.md`. They match the installed version.
|
|
41
|
+
Read them before writing or changing an ESLint config that uses this package.
|
|
36
42
|
|
|
37
43
|
## Quick start
|
|
38
44
|
|
|
@@ -43,7 +49,9 @@ import { nextjs } from "@vllnt/eslint-config/nextjs";
|
|
|
43
49
|
export default [...nextjs];
|
|
44
50
|
```
|
|
45
51
|
|
|
46
|
-
Each preset is an array — spread it into your flat config.
|
|
52
|
+
Each preset is an array — spread it into your flat config. Presets take no options;
|
|
53
|
+
change a rule by appending your own config object (see below). The root entry has
|
|
54
|
+
named exports only; each subpath also has a default export. Base and its React,
|
|
47
55
|
Next.js, and Node.js variants enable `projectService: true` for type-aware linting.
|
|
48
56
|
Convex also enables it; Turbo, Boundaries and Playwright are opt-in additions, not
|
|
49
57
|
replacements for a language preset.
|
|
@@ -58,7 +66,7 @@ replacements for a language preset.
|
|
|
58
66
|
| `@vllnt/eslint-config/nodejs` | Node.js backends |
|
|
59
67
|
| `@vllnt/eslint-config/convex` | Convex backends (4 official + 7 custom rules) |
|
|
60
68
|
| `@vllnt/eslint-config/turbo` | Turborepo cache rules (opt-in) |
|
|
61
|
-
| `@vllnt/eslint-config/boundaries` | Architecture
|
|
69
|
+
| `@vllnt/eslint-config/boundaries` | Architecture boundaries (opt-in; needs `boundaries/elements`) |
|
|
62
70
|
| `@vllnt/eslint-config/playwright` | Playwright test and config files (opt-in) |
|
|
63
71
|
| `@vllnt/eslint-config/ignores` | Shared ignores for build and test output (opt-in) |
|
|
64
72
|
|
|
@@ -206,22 +214,24 @@ and [stats data](https://eslint.org/docs/latest/extend/stats).
|
|
|
206
214
|
| [@eslint/js](https://eslint.org/docs/latest/rules/) | ESLint recommended rules |
|
|
207
215
|
| [typescript-eslint](https://typescript-eslint.io/) | `strictTypeChecked` + `stylisticTypeChecked` |
|
|
208
216
|
| [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) | Prettier as ESLint errors |
|
|
209
|
-
| [eslint-plugin-perfectionist](https://perfectionist.dev/) |
|
|
217
|
+
| [eslint-plugin-perfectionist](https://perfectionist.dev/) | Sorts objects, object types, interfaces, unions, enums, JSX props, named exports, Map entries and `includes` arrays |
|
|
210
218
|
| [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) | Modern JS best practices |
|
|
211
219
|
| [eslint-plugin-simple-import-sort](https://github.com/lydell/eslint-plugin-simple-import-sort) | Import ordering |
|
|
212
220
|
| [eslint-plugin-functional](https://github.com/eslint-functional/eslint-plugin-functional) | Functional patterns (no loops, readonly) |
|
|
213
221
|
| [eslint-plugin-write-good-comments](https://github.com/kantord/eslint-plugin-write-good-comments) | Comment quality |
|
|
214
222
|
|
|
215
223
|
Plus: strict naming conventions (camelCase, PascalCase types, T-prefixed generics), no enums (union types enforced via AST selector).
|
|
224
|
+
In the React and Next.js presets, `.tsx` and `*.decorator.ts` files check only function names (camelCase or
|
|
225
|
+
PascalCase); Node.js does this for `*.decorator.ts` only, and Base applies the full rule everywhere.
|
|
216
226
|
|
|
217
227
|
### React additions
|
|
218
228
|
|
|
219
229
|
| Plugin | What it does |
|
|
220
230
|
| ------------------------------------------------------------------------------- | ------------------------- |
|
|
221
231
|
| [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) | Recommended + jsx-runtime |
|
|
222
|
-
| [eslint-plugin-react-hooks](https://react.dev/reference/rules/rules-of-hooks) | Rules of
|
|
232
|
+
| [eslint-plugin-react-hooks](https://react.dev/reference/rules/rules-of-hooks) | `recommended-latest`: Rules of Hooks, exhaustive deps, React Compiler rules |
|
|
223
233
|
| [eslint-plugin-jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y) | Accessibility |
|
|
224
|
-
| [eslint-plugin-css-modules](https://github.com/atfzl/eslint-plugin-css-modules) |
|
|
234
|
+
| [eslint-plugin-css-modules](https://github.com/atfzl/eslint-plugin-css-modules) | Registered only: `no-unused-class` is off and no other rule is on |
|
|
225
235
|
|
|
226
236
|
### Next.js additions
|
|
227
237
|
|
|
@@ -237,23 +247,26 @@ Everything in React, plus:
|
|
|
237
247
|
still fail. Config exports such as `dynamic`, `revalidate` and `runtime` are
|
|
238
248
|
camelCase and already pass. `route.tsx` follows the `.tsx` rule, which accepts
|
|
239
249
|
PascalCase functions, so `GET` and JSX helpers pass there.
|
|
240
|
-
- Under `app/api/**/route.*`, the naming rule
|
|
241
|
-
|
|
250
|
+
- Under `app/api/**/route.*`, the naming rule is off, and `no-restricted-syntax`
|
|
251
|
+
only limits function exports to those methods and `generateStaticParams`; the base
|
|
252
|
+
enum and `| undefined` bans do not apply in those files.
|
|
242
253
|
- `functional/no-loop-statements` stays on in route handlers; build the response with
|
|
243
254
|
`map` or `reduce`.
|
|
244
255
|
- `.next/`, `out/`, `build/` and `next-env.d.ts` are ignored.
|
|
245
|
-
-
|
|
256
|
+
- `max-lines-per-function` is off in pages and layouts.
|
|
246
257
|
|
|
247
258
|
In every preset, object and type property names that need quotes (`'content-type'`,
|
|
248
259
|
`'@type'`, `'x-default'`) are exempt from the naming convention, because an external
|
|
249
|
-
format fixes their spelling. Names that do not need quotes (`user_id`) are still checked
|
|
260
|
+
format fixes their spelling. Names that do not need quotes (`user_id`) are still checked
|
|
261
|
+
wherever the full naming rule applies (not in React and Next.js `.tsx` files, `*.decorator.ts` in
|
|
262
|
+
React, Next.js and Node.js, or Next.js `app/api/**/route.*`).
|
|
250
263
|
|
|
251
264
|
### Opt-in
|
|
252
265
|
|
|
253
266
|
| Preset | Plugin |
|
|
254
267
|
| ---------- | ----------------------------------------------------------------------------------------------------------- |
|
|
255
268
|
| Turbo | [eslint-plugin-turbo](https://turbo.build/repo/docs/reference/eslint-plugin-turbo) cache rules |
|
|
256
|
-
| Boundaries | [eslint-plugin-boundaries](https://github.com/javierbrea/eslint-plugin-boundaries)
|
|
269
|
+
| Boundaries | [eslint-plugin-boundaries](https://github.com/javierbrea/eslint-plugin-boundaries) recommended rules; define `settings['boundaries/elements']` in your config, since with none nothing is enforced |
|
|
257
270
|
|
|
258
271
|
---
|
|
259
272
|
|
|
@@ -291,9 +304,9 @@ export default [...base, ...convex];
|
|
|
291
304
|
|
|
292
305
|
| Rule | Catches |
|
|
293
306
|
| --------------------------- | ------------------------------------------------------------ |
|
|
294
|
-
| `standard-filenames` | Factories outside `queries.ts`, `mutations.ts`, `actions.ts` |
|
|
307
|
+
| `standard-filenames` | Factories outside `queries.ts`, `mutations.ts`, `actions.ts`, `internal_mutations.ts`, `node_actions.ts` |
|
|
295
308
|
| `namespace-separation` | `query()` in `mutations.ts`, `mutation()` in `queries.ts` |
|
|
296
|
-
| `snake-case-filenames` |
|
|
309
|
+
| `snake-case-filenames` | Non-`snake_case` filenames in `convex/` (hyphens, camelCase); names starting uppercase are exempt |
|
|
297
310
|
| `no-bare-v-any` | `v.any()` outside `validators.ts` |
|
|
298
311
|
| `require-returns-validator` | Missing `returns` validator in factory config |
|
|
299
312
|
| `no-query-in-loop` | N+1 queries (`ctx.db.query`/`get`/`runQuery` inside loops) |
|
|
@@ -301,10 +314,10 @@ export default [...base, ...convex];
|
|
|
301
314
|
|
|
302
315
|
### Auto-applied overrides
|
|
303
316
|
|
|
304
|
-
- **Config files** (`auth.ts`, `auth.config.ts`, `convex.config.ts`) — exempt from `snake-case-filenames` and `explicit-module-boundary-types`
|
|
317
|
+
- **Config files** (`auth.ts`, `auth.config.ts`, `convex.config.ts` at the root of `convex/` or `src/component/`) — exempt from `snake-case-filenames` and `explicit-module-boundary-types`
|
|
305
318
|
- **Migration files** (`convex/migrations/**`) — exempt from `standard-filenames`, `namespace-separation`, `no-query-in-loop`
|
|
306
|
-
- **Generated/test files** (`convex/_generated/**`, `*.test.ts`, `convex/testing/**`) — excluded
|
|
307
|
-
- Sandboxed component sources under `src/component/**` receive the same rules and exclusions
|
|
319
|
+
- **Generated/test files** (`convex/_generated/**`, `*.test.ts`, `convex/testing/**`) — excluded from the Convex rules (other presets in your config still apply)
|
|
320
|
+
- Sandboxed component sources under `src/component/**` receive the same rules and exclusions, except `snake-case-filenames`, which only checks files under `convex/`.
|
|
308
321
|
|
|
309
322
|
### Project-specific overrides
|
|
310
323
|
|
|
@@ -348,13 +361,18 @@ convex/
|
|
|
348
361
|
|
|
349
362
|
| Package | Required |
|
|
350
363
|
| ------------------------------- | ---------------------------------------------- |
|
|
351
|
-
| `eslint` >= 9 | Yes
|
|
364
|
+
| `eslint` >= 9 | Yes (tested on 9 and 10, later majors untested; on 10, eslint-plugin-react 7.37.5 and eslint-plugin-jsx-a11y 6.10.2 print a peer warning because their own ranges stop at 9) |
|
|
352
365
|
| `prettier` >= 3 | Yes |
|
|
353
|
-
| `typescript` >= 6.0.2 and < 6.1 |
|
|
366
|
+
| `typescript` >= 6.0.2 and < 6.1 | Yes for the root entry and the Base, React, Next.js, Node.js and Convex presets (type-aware linting through `typescript-eslint`); not needed when you import only Turbo, Boundaries, Playwright or ignores |
|
|
354
367
|
|
|
355
368
|
Install `@typescript/native` as `npm:typescript@^7.0.2` when using TypeScript 7
|
|
356
369
|
as the build compiler.
|
|
357
370
|
|
|
371
|
+
ESLint 10 removed rule-context methods such as `context.getSourceCode()`, which
|
|
372
|
+
eslint-plugin-write-good-comments, eslint-plugin-react and eslint-plugin-css-modules still
|
|
373
|
+
call. The presets add them back for those plugins' rules with `fixupRule` from
|
|
374
|
+
`@eslint/compat`, so the same presets run on ESLint 9 and 10.
|
|
375
|
+
|
|
358
376
|
## VS Code
|
|
359
377
|
|
|
360
378
|
Add to `.vscode/settings.json` for monorepo support:
|
|
@@ -368,12 +386,18 @@ Add to `.vscode/settings.json` for monorepo support:
|
|
|
368
386
|
## Documentation and support
|
|
369
387
|
|
|
370
388
|
- [LLM index](llms.txt) · [Changelog](CHANGELOG.md)
|
|
371
|
-
- [Contributing](CONTRIBUTING.md) · [Issues](https://github.com/vllnt/eslint-config/issues)
|
|
372
|
-
- [Security policy and private vulnerability reporting](SECURITY.md)
|
|
389
|
+
- [Contributing](https://github.com/vllnt/eslint-config/blob/main/CONTRIBUTING.md) · [Issues](https://github.com/vllnt/eslint-config/issues)
|
|
390
|
+
- [Security policy and private vulnerability reporting](https://github.com/vllnt/eslint-config/blob/main/SECURITY.md)
|
|
373
391
|
|
|
374
|
-
|
|
392
|
+
Stable releases use the npm `latest` tag. `@canary` selects moving prerelease
|
|
375
393
|
builds; pin and test them before adoption.
|
|
376
394
|
|
|
395
|
+
## Related packages
|
|
396
|
+
|
|
397
|
+
| Package | Use it for |
|
|
398
|
+
| ---------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
|
|
399
|
+
| [`@vllnt/typescript`](https://oss.vllnt.com/packages/typescript) | Shared `tsconfig` presets. Type-aware linting here reads your `tsconfig.json`; use that package to set the compiler options, this one to lint. |
|
|
400
|
+
|
|
377
401
|
## Author
|
|
378
402
|
|
|
379
403
|
Built by [bntvllnt](https://github.com/bntvllnt) · [bntvllnt.com](https://bntvllnt.com).
|
|
@@ -382,3 +406,7 @@ Part of [@vllnt](https://github.com/vllnt). [Sponsor the work](https://github.co
|
|
|
382
406
|
## License
|
|
383
407
|
|
|
384
408
|
[MIT](LICENSE)
|
|
409
|
+
|
|
410
|
+
---
|
|
411
|
+
|
|
412
|
+
Part of vllnt oss: https://oss.vllnt.com
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { fixupRule } from '@eslint/compat'
|
|
2
|
+
|
|
3
|
+
// ESLint 10 removed the rule-context methods that older plugins still call
|
|
4
|
+
// (`context.getSourceCode()`, `context.getFilename()`, ...), so their rules
|
|
5
|
+
// crash there. `fixupRule` adds the removed methods back; rule results are
|
|
6
|
+
// unchanged.
|
|
7
|
+
// The rules are replaced in place instead of wrapping the plugin, so the plugin
|
|
8
|
+
// object stays the one a project gets from its own import: ESLint rejects two
|
|
9
|
+
// different objects registered under the same plugin name.
|
|
10
|
+
export function withLegacyContext(plugin) {
|
|
11
|
+
for (const [name, rule] of Object.entries(plugin.rules)) {
|
|
12
|
+
plugin.rules[name] = fixupRule(rule)
|
|
13
|
+
}
|
|
14
|
+
return plugin
|
|
15
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import functionalPlugin from 'eslint-plugin-functional'
|
|
2
2
|
import writeGoodCommentsPlugin from 'eslint-plugin-write-good-comments'
|
|
3
|
+
import { withLegacyContext } from './compat.js'
|
|
3
4
|
|
|
4
5
|
export const goodPractices = {
|
|
5
6
|
plugins: {
|
|
6
7
|
functional: functionalPlugin,
|
|
7
|
-
'write-good-comments': writeGoodCommentsPlugin,
|
|
8
|
+
'write-good-comments': withLegacyContext(writeGoodCommentsPlugin),
|
|
8
9
|
},
|
|
9
10
|
rules: {
|
|
10
11
|
'no-unreachable-loop': 'error',
|
package/flat/core/react.js
CHANGED
|
@@ -2,13 +2,14 @@ import reactPlugin from 'eslint-plugin-react'
|
|
|
2
2
|
import reactHooksPlugin from 'eslint-plugin-react-hooks'
|
|
3
3
|
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y'
|
|
4
4
|
import cssModulesPlugin from 'eslint-plugin-css-modules'
|
|
5
|
+
import { withLegacyContext } from './compat.js'
|
|
5
6
|
|
|
6
7
|
export const reactConfig = {
|
|
7
8
|
plugins: {
|
|
8
|
-
react: reactPlugin,
|
|
9
|
+
react: withLegacyContext(reactPlugin),
|
|
9
10
|
'react-hooks': reactHooksPlugin,
|
|
10
11
|
'jsx-a11y': jsxA11yPlugin,
|
|
11
|
-
'css-modules': cssModulesPlugin,
|
|
12
|
+
'css-modules': withLegacyContext(cssModulesPlugin),
|
|
12
13
|
},
|
|
13
14
|
settings: {
|
|
14
15
|
react: {
|
package/llms.txt
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# @vllnt/eslint-config
|
|
2
|
+
|
|
3
|
+
> Strict, opinionated ESLint flat config for TypeScript projects. Every rule enforces error — no warnings, no compromises.
|
|
4
|
+
|
|
5
|
+
ESLint v9+ flat config with 8 presets: Base, React, Next.js, Node.js, Convex, Turbo, Boundaries, Playwright, plus a shared `ignores` list. TypeScript-first with `strictTypeChecked` + `stylisticTypeChecked`. Prettier built-in. 7 custom Convex lint rules bundled as `eslint-plugin-convex-rules`.
|
|
6
|
+
|
|
7
|
+
Version 2 requires ESLint >=9 (tested on 9 and 10), Prettier >=3, and the TypeScript 6 JavaScript API
|
|
8
|
+
(`typescript@npm:@typescript/typescript6@^6.0.2`) for type-aware linting. Use
|
|
9
|
+
`@typescript/native@npm:typescript@^7.0.2` alongside it for the TypeScript 7 compiler.
|
|
10
|
+
TypeScript 5 is not supported. Stable releases use the npm `latest` tag; `canary`
|
|
11
|
+
builds are moving prereleases. See the README installation command.
|
|
12
|
+
|
|
13
|
+
## For coding agents
|
|
14
|
+
|
|
15
|
+
The docs ship inside the package, in `node_modules/@vllnt/eslint-config/`:
|
|
16
|
+
`README.md`, `llms.txt` and `CHANGELOG.md`. They match the installed version.
|
|
17
|
+
Read them before writing or changing an ESLint config that uses this package.
|
|
18
|
+
|
|
19
|
+
## Entry points
|
|
20
|
+
|
|
21
|
+
Each entry point exports an array of flat config objects with the same name.
|
|
22
|
+
Subpaths also have a default export; the root entry has named exports only.
|
|
23
|
+
`./package.json` is exported for tooling. Presets take no options; spread them and
|
|
24
|
+
append config objects to override rules.
|
|
25
|
+
|
|
26
|
+
- `@vllnt/eslint-config`: `base` (and every preset below as a named export)
|
|
27
|
+
- `@vllnt/eslint-config/nextjs`: `nextjs`
|
|
28
|
+
- `@vllnt/eslint-config/react`: `react`
|
|
29
|
+
- `@vllnt/eslint-config/nodejs`: `nodejs`
|
|
30
|
+
- `@vllnt/eslint-config/convex`: `convex`
|
|
31
|
+
- `@vllnt/eslint-config/turbo`: `turbo` (opt-in addition)
|
|
32
|
+
- `@vllnt/eslint-config/boundaries`: `boundaries` (opt-in addition)
|
|
33
|
+
- `@vllnt/eslint-config/playwright`: `playwright` (opt-in overlay)
|
|
34
|
+
- `@vllnt/eslint-config/ignores`: `ignores` (opt-in)
|
|
35
|
+
|
|
36
|
+
## Next.js, Playwright and ignores
|
|
37
|
+
|
|
38
|
+
The Next.js preset accepts route handler exports (`GET`, `HEAD`, `POST`, `PUT`,
|
|
39
|
+
`PATCH`, `DELETE`, `OPTIONS`) by exact name and ignores `.next/`, `out/`, `build/` and
|
|
40
|
+
`next-env.d.ts`. `@vllnt/eslint-config/playwright` is an opt-in overlay for
|
|
41
|
+
`**/tests/e2e/**/*.{spec,setup}.ts`, `**/e2e/**/*.spec.ts` and
|
|
42
|
+
`**/playwright.config.{ts,mts}` that relaxes
|
|
43
|
+
`functional/no-loop-statements`, `max-lines-per-function` and object-key naming
|
|
44
|
+
only. `@vllnt/eslint-config/ignores` is a shared ignores list. See
|
|
45
|
+
[README](./README.md#playwright) and [Shared ignores](./README.md#shared-ignores).
|
|
46
|
+
|
|
47
|
+
## Diagnostics
|
|
48
|
+
|
|
49
|
+
The package uses ESLint v9+ flat config and needs no extra dependency for the
|
|
50
|
+
built-in Config Inspector. From a consuming project, open the inspector with
|
|
51
|
+
`pnpm exec eslint --inspect-config` (it downloads on demand and takes no file
|
|
52
|
+
argument; pick files in its UI), profile aggregate rule time
|
|
53
|
+
with `TIMING=1 pnpm exec eslint .`, or capture per-file parse and rule timings
|
|
54
|
+
with `pnpm exec eslint . --stats --format json-with-metadata --output-file eslint-stats.json`.
|
|
55
|
+
The inspector explains the effective config but does not measure performance.
|
|
56
|
+
See [Inspecting and profiling ESLint](./README.md#inspecting-and-profiling-eslint)
|
|
57
|
+
for interpretation and benchmarking practices.
|
|
58
|
+
|
|
59
|
+
## Docs
|
|
60
|
+
|
|
61
|
+
- [README](./README.md): Project overview, presets, installation, diagnostics, and usage guide
|
|
62
|
+
- [Changelog](./CHANGELOG.md): Version history and release notes
|
|
63
|
+
- [License](./LICENSE): MIT license
|
|
64
|
+
|
|
65
|
+
## Optional
|
|
66
|
+
|
|
67
|
+
- [Contributing](https://github.com/vllnt/eslint-config/blob/main/CONTRIBUTING.md): Contribution guidelines and development setup
|
|
68
|
+
- [Security Policy](https://github.com/vllnt/eslint-config/blob/main/SECURITY.md): Vulnerability reporting and disclosure policy
|
|
69
|
+
- [Code of Conduct](https://github.com/vllnt/eslint-config/blob/main/CODE_OF_CONDUCT.md): Community guidelines
|
|
70
|
+
|
|
71
|
+
## Ecosystem
|
|
72
|
+
|
|
73
|
+
- [vllnt oss](https://oss.vllnt.com/llms.txt): Index of the open-source @vllnt packages
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vllnt/eslint-config",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0-canary.fdeee40",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Strict ESLint config for TypeScript projects. All rules enforce error — no warnings.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "./flat/index.js",
|
|
8
|
+
"homepage": "https://oss.vllnt.com/packages/eslint-config",
|
|
8
9
|
"repository": {
|
|
9
10
|
"type": "git",
|
|
10
11
|
"url": "https://github.com/vllnt/eslint-config"
|
|
@@ -15,14 +16,20 @@
|
|
|
15
16
|
"typescript",
|
|
16
17
|
"react",
|
|
17
18
|
"nextjs",
|
|
18
|
-
"prettier"
|
|
19
|
+
"prettier",
|
|
20
|
+
"flat-config",
|
|
21
|
+
"convex",
|
|
22
|
+
"playwright",
|
|
23
|
+
"turborepo"
|
|
19
24
|
],
|
|
20
25
|
"engines": {
|
|
21
26
|
"node": ">=20"
|
|
22
27
|
},
|
|
23
|
-
"packageManager": "pnpm@10.34.
|
|
28
|
+
"packageManager": "pnpm@10.34.9",
|
|
24
29
|
"files": [
|
|
25
|
-
"flat"
|
|
30
|
+
"flat",
|
|
31
|
+
"CHANGELOG.md",
|
|
32
|
+
"llms.txt"
|
|
26
33
|
],
|
|
27
34
|
"exports": {
|
|
28
35
|
".": "./flat/index.js",
|
|
@@ -37,11 +44,13 @@
|
|
|
37
44
|
"./package.json": "./package.json"
|
|
38
45
|
},
|
|
39
46
|
"scripts": {
|
|
40
|
-
"test": "pnpm check:agents && node --test tests/*.test.js",
|
|
41
|
-
"check:agents": "node -e \"const f=require('node:fs');if(!f.existsSync('AGENTS.md')||f.existsSync('CLAUDE.md')||f.existsSync('.claude'))process.exit(1)\""
|
|
47
|
+
"test": "pnpm check:agents && node --test tests/*.test.js && pnpm test:eslint10",
|
|
48
|
+
"check:agents": "node -e \"const f=require('node:fs');if(!f.existsSync('AGENTS.md')||f.existsSync('CLAUDE.md')||f.existsSync('.claude'))process.exit(1)\"",
|
|
49
|
+
"test:eslint10": "LINT_ESLINT=eslint10 node --test tests/smoke.test.js tests/lint-behavior.test.js tests/convex-rules.test.js"
|
|
42
50
|
},
|
|
43
51
|
"dependencies": {
|
|
44
52
|
"@convex-dev/eslint-plugin": "^5.0.1",
|
|
53
|
+
"@eslint/compat": "^2.1.1",
|
|
45
54
|
"@eslint/js": "^9.39.5",
|
|
46
55
|
"@next/eslint-plugin-next": "^16.4.6",
|
|
47
56
|
"eslint-plugin-boundaries": "^5.4.0",
|
|
@@ -53,7 +62,7 @@
|
|
|
53
62
|
"eslint-plugin-react": "^7.37.5",
|
|
54
63
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
55
64
|
"eslint-plugin-simple-import-sort": "^14.0.0",
|
|
56
|
-
"eslint-plugin-turbo": "^2.11.
|
|
65
|
+
"eslint-plugin-turbo": "^2.11.13",
|
|
57
66
|
"eslint-plugin-unicorn": "^65.0.1",
|
|
58
67
|
"eslint-plugin-write-good-comments": "^0.2.0",
|
|
59
68
|
"typescript-eslint": "8.73.0"
|
|
@@ -74,8 +83,9 @@
|
|
|
74
83
|
},
|
|
75
84
|
"devDependencies": {
|
|
76
85
|
"@typescript/native": "npm:typescript@7.0.2",
|
|
77
|
-
"convex": "^1.
|
|
86
|
+
"convex": "^1.51.0",
|
|
78
87
|
"eslint": "^9.39.5",
|
|
88
|
+
"eslint10": "npm:eslint@^10.15.0",
|
|
79
89
|
"typescript": "npm:@typescript/typescript6@^6.0.2"
|
|
80
90
|
},
|
|
81
91
|
"pnpm": {
|
|
@@ -87,7 +97,7 @@
|
|
|
87
97
|
"esbuild"
|
|
88
98
|
],
|
|
89
99
|
"overrides": {
|
|
90
|
-
"handlebars": ">=4.7.
|
|
100
|
+
"handlebars": ">=4.7.10",
|
|
91
101
|
"deepmerge-ts@<8.0.0": "^8.0.2",
|
|
92
102
|
"minimatch@>=7.0.0 <11.0.1": "^11.0.1"
|
|
93
103
|
}
|