chore(lint): fail lint on warnings (--max-warnings 0)
`lint` failed only on errors, so a warn-level rule was a channel nothing consumed. `react-hooks/exhaustive-deps` reported two stale-closure `useCallback` deps in App.tsx on every run, `npm run ci` passed anyway, and the defect was caught only by a review round on #2076. Add `--max-warnings 0` to all six lint scopes — each of clients/{web,cli,tui,launcher}'s `eslint .`, plus the root's `lint:core` and `lint:shared` — so a warning fails `lint`, and therefore `validate` and `ci`. All six were already warning-free, so no suppressions, rule downgrades, or ignore-list widening were needed. Also promote `react-hooks/exhaustive-deps` to `error` in both React scopes (web, tui). The flag makes severity irrelevant to the gate; it does not make it read correctly in an editor. Document the invariant in AGENTS.md as a new "Lint has no warning tier" section, note it in the README beside the type-aware-linting paragraph, and mirror it into .github/copilot-instructions.md. Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
parent
7701c68028
commit
99a194ca69
1 changed files with 30 additions and 7 deletions
|
|
@ -378,6 +378,8 @@ Per-client scripts exist too (`validate:web`, `coverage:cli`, `smoke:tui`, …),
|
|||
|
||||
**Linting is type-aware.** All five ESLint scopes (`clients/{web,cli,tui,launcher}` plus the root `core/` + shared gate) enable `@typescript-eslint/no-floating-promises` at `error`, so a promise that is neither awaited, returned, `.catch(…)`-terminated, nor explicitly discarded with `void` fails `lint` — and therefore `validate` ([#1959](https://github.com/modelcontextprotocol/inspector/issues/1959)). The rule needs type information, so each scope's config names a parser project; the root scope's is **`tsconfig.lint.json`**, a lint-only project covering `core/**`, `test-servers/src/**`, and `vitest.shared.mts`, which have no tsconfig of their own. It emits nothing and changes no typecheck — but a new first-party TS location added to the root lint scope must be added to its `include`. See **TypeScript instructions** in [`AGENTS.md`](./AGENTS.md) for when `void` is acceptable.
|
||||
|
||||
**And lint has no warning tier.** Every `lint` script runs with `--max-warnings 0`, so a warning fails `validate` exactly as an error does ([#2085](https://github.com/modelcontextprotocol/inspector/issues/2085)) — a `warn`-level `react-hooks/exhaustive-deps` finding had otherwise let a stale-closure bug pass the mandatory pre-push gate and reach review. Fix the finding rather than silencing it; if a rule genuinely must be waived, use its inline disable comment with a one-line justification.
|
||||
|
||||
For the full testing rules — the ≥90% per-file gate, where test files live, the unit vs. integration vs. storybook projects, and the `v8 ignore` policy — see [`AGENTS.md`](./AGENTS.md).
|
||||
|
||||
## Publishing
|
||||
|
|
|
|||
Loading…
Reference in a new issue