2.8 KiB
2.8 KiB
description
| 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): turn on whole categories, then list only what parity or a real need adds.
lint: {
plugins: ["typescript", "unicorn", "oxc", "import"],
jsPlugins: ["eslint-plugin-explicit-types", "./scripts/project-lint.ts"],
categories: { correctness: "error", suspicious: "error", pedantic: "error", perf: "error" },
rules: { ...explicitTypes.configs.concrete.rules, ...projectLint.configs.project.rules },
ignorePatterns: ["src/generated/**"], // generated files only, see below
options: { typeAware: true, typeCheck: true, maxWarnings: 0, reportUnusedDisableDirectives: "error" },
},
- Categories:
correctness,suspicious,pedantic,perfaterror.styleandrestrictionare never turned on wholesale; pick single rules from them inconfigs.project. Extra rules that categories bring are fine. - 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 lintwith 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"inconfigs.project. No file is split for size. Do not add new opt-outs anywhere without asking the user. vite.config.tsnames no rule. Every rule id, built-in ones included, lives inconfigs.projectofscripts/project-lint.ts(project-lint-plugin).vite.config.tsonly spreads configs.- Published plugins are consumed through their configs: ESLint flat config
uses
plugin.configs.<name>; Oxlint lists the package injsPluginsand spreadsplugin.configs.<name>.rules, since Oxlint plugins carry no configs. Use the configs equivalent to what the repo enabled under Deno. maxWarnings: 0keeps Deno's "every diagnostic fails" behaviour.ignorePatternsis only for generated files (compiled output, codegen). Hand-written code is never ignored.- No lint disable comments: lint-no-disable-comments.
- Parity: lint-parity-never-shrinks. Naming: naming-id-match.
- Don't add a second import sorter; the import-structure plugin's
enforce-import-orderis the only one, and Oxfmt'ssortImportsstays off.
perf came last: in the template it flagged nine .includes on constant
arrays, fixed as ReadonlySet + .has() rather than by turning a rule off.
That is the expected response to any new rule: change the code.