2.4 KiB
2.4 KiB
description: Lint config shape: every non-nursery Oxlint category on, plugins via all, a blacklist of offs in configs.project, per-file exceptions only in projectOverrides, ignorePatterns only for generated output
Policy (2026-10-19): a blacklist, not a whitelist. Replaces the older category-subset and "no overrides" notes.
- Categories:
correctness,suspicious,pedantic,perf,style,restrictionaterror.nurserystays off (no line for it). - Plugins are enabled whole through their
allconfig (explicitTypes.configs.all.rules,importStructure.configs.all.rules). - Blacklist: repo-wide offs and option tweaks live in
projectLint.configs.project.rulesinscripts/project-lint.ts, spread last inrules, each with a one-line reason. Never re-list a rule a category already turns on. bot-agents runs on Node everywhere, soimport/no-nodejs-modules,unicorn/no-process-exit, andno-consoleare off repo-wide. - Per-file exceptions only via
projectOverrides, the wholeoverridesarray exported fromscripts/project-lint.ts: the Node code entry (vite.config.ts,scripts/**,nodeRules) first, then one entry per exception with a why-comment.vite.config.tshas exactlyoverrides: projectOverrides. - No
allowFilesoptions in custom rules, and no disable comments (lint-no-disable-comments). ignorePatternsonly for generated or build output, never hand-written code. A hand-written file is linted, with override entries for only what it legitimately breaks. bot-agents has no generated code, so none.- Precedence: categories <
rules(a later spread wins) <overrides(a later entry wins). - Size and complexity limits (
complexity,max-lines, ...) are set to the smallest value the current code passes.
// scripts/project-lint.ts
export const projectOverrides: OxlintOverride[] = [
{ files: ["vite.config.ts", "scripts/**"], rules: nodeRules },
// Why: src/example.ts must ... (a per-file exception, if one is ever needed)
// { files: ["src/example.ts"], rules: { "some-rule": "off" } },
];
// vite.config.ts
rules: {
...explicitTypes.configs.all.rules,
...importStructure.configs.all.rules,
...projectLint.configs.project.rules,
},
overrides: projectOverrides,
A new category hit is fixed in the code; an off or exception is added only for a real collision or churn, with its reason. Rules: project-lint-plugin.