🔧 Allow ternaries and lowercase comments

Turn off `eslint/no-ternary` and `eslint/capitalized-comments` in the
project config: both encode a style the project rejects, so they belong in
the config's rule map rather than a per-site disable.

Scope the adjacent `oxlint-disable` decision to false positives and
record why a rejected stylistic rule is turned off project-wide.
This commit is contained in:
tmu committed 2026-09-16 21:45:54 +00:00
1 parent 71ecd508b7
commit fa0b7f2e84
2 files changed
+30 -5

No files matched your search

+2
View File
@@ -13,6 +13,8 @@
"eslint/no-undefined": "off", "eslint/no-undefined": "off",
"eslint/sort-keys": "off", "eslint/sort-keys": "off",
"eslint/id-length": "off", "eslint/id-length": "off",
"eslint/capitalized-comments": "off",
"eslint/no-ternary": "off",
"import/no-named-export": "off", "import/no-named-export": "off",
"eslint/one-var": "off", "eslint/one-var": "off",
"import/group-exports": "off", "import/group-exports": "off",
+28 -5
View File
@@ -104,25 +104,48 @@ Type-aware oxlint is enabled via `options.typeAware: true` in `.oxlintrc.json`
#### Decision (2026-09) #### Decision (2026-09)
Known type-aware false positives are silenced with source-level `oxlint-disable` A type-aware rule that false-positives is silenced with a source-level
directives (see `src/pattern.ts`, `src/match.ts`, `src/index.test.ts`), not with `oxlint-disable` directive (see `src/pattern.ts`, `src/match.ts`,
rules disabled in `.oxlintrc.json`. `src/index.test.ts`), not by turning the rule off in `.oxlintrc.json`.
#### Why #### Why
- The disable sits next to the code it silences, visible to anyone reading the - The disable sits next to the code it silences, visible to anyone reading the
source. source.
- The rule stays on everywhere else, so only the mis-firing line is exempted.
#### Rejected #### Rejected
- A project-wide disable in `.oxlintrc.json`: it hides the suppression from the - A project-wide disable in `.oxlintrc.json` for a false positive: it hides the
reader of the affected code. exemption from the reader of the affected code and switches the rule off
repo-wide for a one-site problem.
#### Known issue #### Known issue
- A source-level disable is a _human_ last resort. AI agents must not add one; - A source-level disable is a _human_ last resort. AI agents must not add one;
they fix the type at its root (see [AGENTS.md § Never do](../AGENTS.md#never-do)). they fix the type at its root (see [AGENTS.md § Never do](../AGENTS.md#never-do)).
### Unwanted stylistic rules are turned off in the config
#### Decision (2026-09)
A stylistic rule the project rejects is `"off"` in the `.oxlintrc.json` `rules`
map, not silenced at a use site. Current entries: `eslint/capitalized-comments`
(comments may start lowercase) and `eslint/no-ternary` (ternaries are allowed),
joining the oxfmt-superseded rules already off.
#### Why
- The rule is wrong for the whole project, not mis-firing at one site, so there
is no line to annotate.
- Keeping the two mechanisms separate keeps a source-level `oxlint-disable`
meaningful: it marks a lone exception.
#### Rejected
- A source-level `oxlint-disable` per use: the same exemption repeated at every
site, and oxfmt can move the site.
### `check:tsc` runs first ### `check:tsc` runs first
#### Decision (2026-09) #### Decision (2026-09)