Skip to content

fix: tell two entries of the same check apart - #351

Merged
alexander-akait merged 1 commit into
mainfrom
fix/tell-two-checks-apart
Sep 14, 2026
Merged

alexander-akait merged 1 commit into
mainfrom
fix/tell-two-checks-apart

Conversation

@alexander-akait

Copy link
Copy Markdown
Member

Summary

Everything a check is remembered by between compilations was keyed on the tool it runs rather than on the entry that configured it: the incremental result store and the detached report (check.js), the files handed to the watcher (index.js), and the worker and held program (typescript.js). Two entries of the same tool therefore shared one of each.

What that looks like: two eslint entries, one with ignoreDiagnostics: ["no-var"]. Build 1 reports the error once, correctly. On a rebuild that lints neither file, remember() hands the ignoring entry the whole shared store — so the error is reported twice, once by the entry told to ignore it. The same sharing would leak reportAs, fix and a formatter across entries.

Each entry now carries an id of its own (<check>\0<index>), which is what all four are keyed on. name stays what a diagnostic is labelled with.

What kind of change does this PR introduce?

fix.

Did you add tests for your changes?

Yes — test/store.test.js covers the seam directly (one entry's results stay out of another's report), and test/multiple-checks.test.js drives the user-visible case through a real watch. Both fail against unmodified src/.

Does this PR introduce a breaking change?

No.

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

n/a — checks already documents several entries of one tool; this makes it behave that way.

Use of AI

AI was used. It found this while auditing the plugin for bugs, reproduced it as a two-build watch before touching anything, then wrote the fix and both tests and checked each fails with the fix reverted.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GzZci4NQeiqwdrVfd7dGXy


Generated by Claude Code

Everything a check is remembered by between compilations was keyed on the
tool it runs — the incremental result store and the detached report in
`check.js`, the watched files in `index.js`, the worker and the program in
the typescript check. Two entries running the same tool therefore shared
one of each, so a rebuild that linted neither of them handed the first
entry whatever the second had stored: results it was told to ignore,
report as a warning, or not report at all.

Each entry now carries an id of its own, which is what all four are keyed
on. `name` stays what a diagnostic is labelled with.
@alexander-akait
alexander-akait merged commit 297cb8f into main Sep 14, 2026
13 checks passed
@alexander-akait
alexander-akait deleted the fix/tell-two-checks-apart branch September 14, 2026 12:38
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