Describe the Deno size limits in the notes
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
---
|
||||
description: bot-agents lint has prefer-readonly-parameter-types off (Node/web types can't satisfy it) and no overrides; nothing else
|
||||
description: bot-agents lint has prefer-readonly-parameter-types and the size/complexity rules off (Deno had no limits) and no overrides; nothing else
|
||||
---
|
||||
|
||||
The repo follows [[lint-config-shape]] with one recorded exception, present
|
||||
@@ -14,8 +14,8 @@ when the migration PR was approved:
|
||||
from `@typescript-eslint/types` instead of string literals
|
||||
([[lint-overrides-policy]]).
|
||||
|
||||
Oxlint's default size limits apply to `src/`; the migration split `run.ts`
|
||||
into `run-context.ts`, `agents.ts`, and `agent-{claude,codex,opencode}.ts`,
|
||||
and `post.ts` into `post.ts` + `post-artifacts.ts`, rather than raising them.
|
||||
Sequential awaits in loops became recursion or a `reduce` chain to stay
|
||||
sequential. Add no other opt-out without the user.
|
||||
Size and complexity limits match Deno, which had none here, so every Oxlint
|
||||
limit rule is `"off"` ([[lint-config-shape]]). `run.ts` and `post.ts` keep
|
||||
main's single-file layout (2026-10-17 revert of the size splits). Sequential
|
||||
awaits in loops became recursion or a `reduce` chain (`no-await-in-loop`) to
|
||||
stay sequential. Add no other opt-out without the user.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
description: vite.config.ts lint uses Oxlint categories at error with default limits, names no rule itself, and spreads configs from the plugins and scripts/project-lint.ts
|
||||
description: vite.config.ts lint uses Oxlint categories at error with Deno size limits, names no rule itself, and spreads configs from the plugins and scripts/project-lint.ts
|
||||
---
|
||||
|
||||
The lint config is short and category-driven (user decisions 2026-10-14/15):
|
||||
@@ -19,13 +19,15 @@ lint: {
|
||||
- **Categories:** `correctness`, `suspicious`, `pedantic`, `perf` at `error`.
|
||||
`style` and `restriction` are never turned on wholesale; pick single rules
|
||||
from them in `configs.project`. Extra rules that categories bring are fine.
|
||||
- **Default limits stay** (2026-10-16): pedantic's `max-lines` 300,
|
||||
`max-lines-per-function` 50, `max-classes-per-file` 1,
|
||||
`max-dependencies` 10, `max-params` 3, `complexity` 20. Don't raise them to
|
||||
make code pass; refactor (see [[lint-overrides-policy]]). `max-lines` stays
|
||||
at 300 everywhere, `scripts/` included, with no override (2026-10-16): split
|
||||
a long file by theme instead. Do not add new opt-outs anywhere without
|
||||
asking the user.
|
||||
- **Size limits match Deno** (2026-10-17, replaces the 2026-10-16 "default
|
||||
limits stay"): repos behave as they did on Deno. bot-agents ran `deno lint`
|
||||
with no config, so it had no size or complexity limit, and every Oxlint
|
||||
limit rule (`complexity`, `max-lines`, `max-params`, `id-length`,
|
||||
`no-nested-ternary`, `max-lines-per-function`, `max-classes-per-file`,
|
||||
`max-depth`, `max-nested-callbacks`, `max-statements`,
|
||||
`import/max-dependencies`, `unicorn/max-nested-calls`) is `"off"` in
|
||||
`configs.project`. No file is split for size. Do not add new opt-outs
|
||||
anywhere without asking the user.
|
||||
- **`vite.config.ts` names no rule.** Every rule id, built-in ones included,
|
||||
lives in `configs.project` of `scripts/project-lint.ts`
|
||||
([[project-lint-plugin]]). `vite.config.ts` only spreads configs.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
description: No lint overrides for source files; narrow ones only for scripts/**; generated files go in ignorePatterns; refactor (barrels, splits) instead of raising limits
|
||||
description: No lint overrides for source files; narrow ones only for scripts/**; generated files go in ignorePatterns; size limits match Deno, so nothing is split for size
|
||||
---
|
||||
|
||||
Final policy (2026-10-16). The user considers per-file `overrides` bad
|
||||
@@ -18,31 +18,14 @@ practice.
|
||||
|
||||
## Fix the code instead
|
||||
|
||||
Oxlint's defaults stay; violations are refactored without behavior change,
|
||||
covered by the tests, inside the same migration PR.
|
||||
Category rule violations are fixed in the code without behavior change,
|
||||
covered by the tests, inside the same migration PR; e.g. `prefer-set-has`
|
||||
becomes `const K: ReadonlySet<string> = new Set([...])` with `.has`.
|
||||
|
||||
| Rule | Usual fix |
|
||||
| ------------------------- | ------------------------------------------------------- |
|
||||
| `import/max-dependencies` | import a barrel (`#ui`) instead of many direct modules |
|
||||
| `max-lines` | split the file by responsibility |
|
||||
| `max-lines-per-function` | extract helpers |
|
||||
| `max-classes-per-file` | one class per file |
|
||||
| `max-params` | pass one options object |
|
||||
| `prefer-set-has` | `const K: ReadonlySet<string> = new Set([...])`, `.has` |
|
||||
|
||||
```ts
|
||||
// before: 14 imports, over the limit of 10
|
||||
import { a } from "#ui/button";
|
||||
import { b } from "#ui/dialog";
|
||||
// after: one barrel
|
||||
import { a, b } from "#ui";
|
||||
```
|
||||
|
||||
Measured on memona before the move (Oxlint 1.87, default limits): 921
|
||||
pedantic hits in 274 files, of which `max-lines-per-function` 206,
|
||||
`max-lines` 145, `max-classes-per-file` 59, `max-dependencies` 45 (median 14
|
||||
imports, worst 29). The user chose refactoring over raising limits or
|
||||
matching memona's old hugoalh limits (2048 lines per file, no function limit).
|
||||
Size and complexity limits are not refactored for: they match what Deno
|
||||
enforced (2026-10-17, replacing the earlier "refactor to Oxlint's defaults"),
|
||||
which for bot-agents is none, so those rules are `"off"`
|
||||
([[lint-config-shape]]).
|
||||
|
||||
Alias rule: an alias may point anywhere and owns its target (a folder's
|
||||
`index.ts` owns the folder and below, any other file owns only itself); no
|
||||
|
||||
@@ -13,10 +13,10 @@ Oxlint plugin with `meta.name` `"project"`, loaded through `jsPlugins` in
|
||||
- **Custom rules**, enabled as `project/<rule>`. Every repo has
|
||||
`no-disable-comments` and `no-asset-imports`; bot-agents has no others.
|
||||
|
||||
`scripts/` stays flat; don't add `scripts/rules/`. A file that would pass
|
||||
`max-lines` (300) splits into flat themed files sharing the prefix:
|
||||
`scripts/project-lint.ts` keeps the plugin object and the rule list and
|
||||
imports the others (`project-lint-modules.ts`, `project-lint-types.ts`, ...).
|
||||
`scripts/` stays flat; don't add `scripts/rules/`. If the plugin ever needs
|
||||
more files, they sit flat beside it and share the prefix
|
||||
(`project-lint-modules.ts`, ...); `scripts/project-lint.ts` keeps the plugin
|
||||
object and the rule list.
|
||||
|
||||
```ts
|
||||
import type { DummyRuleMap } from "vite-plus/lint";
|
||||
|
||||
Reference in New Issue
Block a user