Describe the Deno size limits in the notes

This commit is contained in:
Danny Kim
2026-10-17 18:50:24 +09:00
parent cd1864e1a9
commit 3cbe4171ea
4 changed files with 28 additions and 43 deletions
+6 -6
View File
@@ -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 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 from `@typescript-eslint/types` instead of string literals
([[lint-overrides-policy]]). ([[lint-overrides-policy]]).
Oxlint's default size limits apply to `src/`; the migration split `run.ts` Size and complexity limits match Deno, which had none here, so every Oxlint
into `run-context.ts`, `agents.ts`, and `agent-{claude,codex,opencode}.ts`, limit rule is `"off"` ([[lint-config-shape]]). `run.ts` and `post.ts` keep
and `post.ts` into `post.ts` + `post-artifacts.ts`, rather than raising them. main's single-file layout (2026-10-17 revert of the size splits). Sequential
Sequential awaits in loops became recursion or a `reduce` chain to stay awaits in loops became recursion or a `reduce` chain (`no-await-in-loop`) to
sequential. Add no other opt-out without the user. stay sequential. Add no other opt-out without the user.
+10 -8
View File
@@ -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): 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`. - **Categories:** `correctness`, `suspicious`, `pedantic`, `perf` at `error`.
`style` and `restriction` are never turned on wholesale; pick single rules `style` and `restriction` are never turned on wholesale; pick single rules
from them in `configs.project`. Extra rules that categories bring are fine. from them in `configs.project`. Extra rules that categories bring are fine.
- **Default limits stay** (2026-10-16): pedantic's `max-lines` 300, - **Size limits match Deno** (2026-10-17, replaces the 2026-10-16 "default
`max-lines-per-function` 50, `max-classes-per-file` 1, limits stay"): repos behave as they did on Deno. bot-agents ran `deno lint`
`max-dependencies` 10, `max-params` 3, `complexity` 20. Don't raise them to with no config, so it had no size or complexity limit, and every Oxlint
make code pass; refactor (see [[lint-overrides-policy]]). `max-lines` stays limit rule (`complexity`, `max-lines`, `max-params`, `id-length`,
at 300 everywhere, `scripts/` included, with no override (2026-10-16): split `no-nested-ternary`, `max-lines-per-function`, `max-classes-per-file`,
a long file by theme instead. Do not add new opt-outs anywhere without `max-depth`, `max-nested-callbacks`, `max-statements`,
asking the user. `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, - **`vite.config.ts` names no rule.** Every rule id, built-in ones included,
lives in `configs.project` of `scripts/project-lint.ts` lives in `configs.project` of `scripts/project-lint.ts`
([[project-lint-plugin]]). `vite.config.ts` only spreads configs. ([[project-lint-plugin]]). `vite.config.ts` only spreads configs.
+8 -25
View File
@@ -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 Final policy (2026-10-16). The user considers per-file `overrides` bad
@@ -18,31 +18,14 @@ practice.
## Fix the code instead ## Fix the code instead
Oxlint's defaults stay; violations are refactored without behavior change, Category rule violations are fixed in the code without behavior change,
covered by the tests, inside the same migration PR. 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 | Size and complexity limits are not refactored for: they match what Deno
| ------------------------- | ------------------------------------------------------- | enforced (2026-10-17, replacing the earlier "refactor to Oxlint's defaults"),
| `import/max-dependencies` | import a barrel (`#ui`) instead of many direct modules | which for bot-agents is none, so those rules are `"off"`
| `max-lines` | split the file by responsibility | ([[lint-config-shape]]).
| `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).
Alias rule: an alias may point anywhere and owns its target (a folder's 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 `index.ts` owns the folder and below, any other file owns only itself); no
+4 -4
View File
@@ -13,10 +13,10 @@ Oxlint plugin with `meta.name` `"project"`, loaded through `jsPlugins` in
- **Custom rules**, enabled as `project/<rule>`. Every repo has - **Custom rules**, enabled as `project/<rule>`. Every repo has
`no-disable-comments` and `no-asset-imports`; bot-agents has no others. `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 `scripts/` stays flat; don't add `scripts/rules/`. If the plugin ever needs
`max-lines` (300) splits into flat themed files sharing the prefix: more files, they sit flat beside it and share the prefix
`scripts/project-lint.ts` keeps the plugin object and the rule list and (`project-lint-modules.ts`, ...); `scripts/project-lint.ts` keeps the plugin
imports the others (`project-lint-modules.ts`, `project-lint-types.ts`, ...). object and the rule list.
```ts ```ts
import type { DummyRuleMap } from "vite-plus/lint"; import type { DummyRuleMap } from "vite-plus/lint";