docs(lint): the config comments say which rules can report, and count what is suppressed
eslint.config.js called every zero-hit React Compiler diagnostic a tripwire. Under eslint-plugin-react-hooks 7.1.1 three cannot report anything: exhaustive-effect-dependencies (its validation is compiled off), memoized-effect-dependencies (nothing emits its category) and rule-suppression (lint mode passes no suppression rules). Probed: a missing effect dependency is reported by exhaustive-deps only, and an inline disable is named by nothing. The header's "33 suppressions" of exhaustive-deps is 0. reactPlugin.ts said one react-hooks rule was still off; none is (three run at warn, which --max-warnings 0 fails).
This commit is contained in:
@@ -8,9 +8,10 @@ import eslintComments from "@eslint-community/eslint-plugin-eslint-comments";
|
||||
import vitest from "@vitest/eslint-plugin";
|
||||
import playwright from "eslint-plugin-playwright";
|
||||
|
||||
// Flat config (ESLint 9). Deliberately NARROW: the high-value rule here is
|
||||
// react-hooks/exhaustive-deps — 33 suppressions across the app exist for it, and until this
|
||||
// sprint nothing ran to make them mean anything. tsc already owns unused vars, undefined names
|
||||
// Flat config (ESLint 9). Deliberately NARROW: the high-value rules here are react-hooks' (the
|
||||
// hook rules and the React Compiler's diagnostics). The 33 inline `exhaustive-deps` suppressions this
|
||||
// config first met are all gone (0 left, E32 review); what is still suppressed is suppressed inline,
|
||||
// one site at a time, each naming its invariant. tsc already owns unused vars, undefined names
|
||||
// and types (noUnusedLocals/Parameters + strict), so typescript-eslint's non-type-checked
|
||||
// `recommended` is layered on but its overlap with tsc is turned off below to avoid double-reporting
|
||||
// and a churny diff. `eslint-config-prettier` is LAST so formatting rules never fight Prettier.
|
||||
@@ -543,7 +544,14 @@ export default tseslint.config(
|
||||
// the compiler SKIPS, silently — `panicThreshold` is "none" and there is no logger, so a lint
|
||||
// error is the only place the skip is said out loud. `todo` is the compiler's "cannot lower
|
||||
// this shape yet" (E32 S4 rewrote all 31 try statements it found); the rest had 0 hits when
|
||||
// switched on and are tripwires. `todo` does NOT see every such shape — a conditional, a loop
|
||||
// switched on. Most are tripwires, but three cannot report anything under
|
||||
// eslint-plugin-react-hooks 7.1.1 (E32 review, read in its source and probed):
|
||||
// `exhaustive-effect-dependencies` (its validation is compiled off — a missing effect dependency
|
||||
// is reported by the classic `exhaustive-deps` only), `memoized-effect-dependencies` (nothing
|
||||
// emits its category) and `rule-suppression` (lint mode hands it no suppression rules, so an
|
||||
// inline disable is never named). They stay on for the plugin version that wires them up; a
|
||||
// function the compiler skips over a suppression is caught by the coverage ratchet below.
|
||||
// `todo` does NOT see every such shape — a conditional, a loop
|
||||
// or an optional call inside a try skips the function with no lint hit at all — so the full
|
||||
// per-function picture is components/compilerCoverage.contract.test.ts.
|
||||
"react-hooks/todo": "error",
|
||||
|
||||
Reference in New Issue
Block a user