Skip to content

feat: leave out what any check found, not TypeScript's alone - #341

Merged
alexander-akait merged 1 commit into
mainfrom
feat/ignore-what-a-check-found
Sep 14, 2026
Merged

alexander-akait merged 1 commit into
mainfrom
feat/ignore-what-a-check-found

Conversation

@alexander-akait

@alexander-akait alexander-akait commented Sep 13, 2026

Copy link
Copy Markdown
Member

Summary

ignoreDiagnostics was the typescript check's and took the codes tsc prints. It is a shared option now, and takes a rule or code as a string, a match of a file, a code and a severity together, a list of any of those, or a function over each thing a check found. A number still means the TypeScript code it meant before, so what was written already reads the same.

new DiagnosticsPlugin({
  checks: [
    { use: "typescript", ignoreDiagnostics: [2307, 7016] },
    {
      use: "eslint",
      ignoreDiagnostics: { code: "no-unused-vars", file: "src/legacy/**" },
    },
  ],
});

Nothing invented, as asked. The name is the one this plugin already had and the one ts-loader uses; the match is the shape fork-ts-checker-webpack-plugin matches an issue by (severity, code, and a glob on the file relative to the context — the same semantics, picomatch rather than minimatch). vite-plugin-checker@0.14.5 has nothing of the kind: its only filter is dev.logLevel: ('error' | 'warning')[] per checker, which is reportAs here and already covers severity, so it is not duplicated. ESLint 9.19's own ruleFilter({ ruleId, severity }) is the same idea one tool down.

ignore would have been the shorter name — and it is ESLint's own option. Trying it first turned every ESLint test red, because ignore: false is passed through to the ESLint class; the schema rejected it. That is the collision the name avoids.

A check answers for its own results through a new optional filterResults, so what is left out is left out of everything the check reports — the outputReport and the counts a formatter prints included. The two CLI checks share one implementation, and a check shipped outside this package reports its results unfiltered until it implements the hook.

Rebased onto main now that #340 has landed, so this is one commit and the last of the stack.

What kind of change does this PR introduce?

feat

Did you add tests for your changes?

Yes — test/ignore-diagnostics.test.js: a rule as a string, a list, a severity, a file glob with a code, a function of one's own, a check that is not ESLint reading the same option, something reported of no file being kept, a check with no filterResults reporting everything, and the counts a formatter prints being the ones left. Plus a case each in test/oxlint/oxlint.test.js and test/biome/biome.test.js, and the three TypeScript cases from #335 unchanged, which is what says the numeric form still means what it did.

Does this PR introduce a breaking change?

No. ignoreDiagnostics: number[] in a typescript entry keeps working, and the option now also reads at the top level, where it applies to every check.

If relevant, what needs to be documented once your changes are merged or what have you already documented?

README.md: the option moved from the TypeScript check to the shared options and is written out there, with the fork-ts-checker-webpack-plugin migration row for issue.include/exclude updated to point at it.

Use of AI

Claude Code read vite-plugin-checker@0.14.5 and fork-ts-checker-webpack-plugin@9.1.0 before choosing the shape, wrote the change, the tests and this description, and ran the suite against ESLint 9 as well as 10; I reviewed all of it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GzZci4NQeiqwdrVfd7dGXy


Generated by Claude Code

`ignoreDiagnostics` was the typescript check's and took the codes `tsc`
prints. It is a shared option now, and takes a rule or a code as a string,
a match of a file, a code and a severity together, a list of any of those,
or a function over each thing a check found. A number still means what it
did, so what was written before still reads the same.

The name is the one it already had here and the one `ts-loader` uses; the
match is the shape `fork-ts-checker-webpack-plugin` matches an issue by.
`ignore` would have been the shorter name and is ESLint's own option, so
it is not this one.

A check answers for its own results through `filterResults`, which every
check here implements and one shipped outside this package may.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GzZci4NQeiqwdrVfd7dGXy
@alexander-akait
alexander-akait force-pushed the feat/ignore-what-a-check-found branch from 219bfde to bfa63ec Compare September 14, 2026 03:46
@alexander-akait
alexander-akait merged commit 2ebdbbb into main Sep 14, 2026
13 checks passed
@alexander-akait
alexander-akait deleted the feat/ignore-what-a-check-found branch September 14, 2026 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant