Repository navigation
fix: prevent lint diagnostics from accumulating across runs (#99) - #105
Merged
Merged
Conversation
|
Thanks for the contribution! Before we can merge this, we need @amazingjoe to sign the Salesforce Inc. Contributor License Agreement. |
Contributor
Author
|
I’ve now signed the Salesforce CLA. Could a maintainer please help refresh the CLA check and approve the pending workflow run? Thanks! |
setu4993
approved these changes
Nov 14, 2026
setu4993
left a comment
Member
There was a problem hiding this comment.
Thanks! Verified against current main: the issue's repro is fixed, and it merges cleanly with build, tests, lint and typecheck passing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fix accumulating lint diagnostics when running the engine repeatedly on the same AST. Also clear stale diagnostics after disabling a rule.
Why
Fixes #99.
The engine defaulted to clearing diagnostics tagged
lint, while built-in rules emitted diagnostics taggedagentscript-lint. This mismatch caused previous diagnostics to remain across runs.How
Use the existing
LINT_SOURCEconstant as the engine’s default source. Explicit source overrides remain supported, and cleanup continues to preserve diagnostics from other sources.Only
lint-engine.tsandlint.test.tswere changed.Test Plan
Added a regression test reproducing the issue. Before the fix, it failed with
[1, 2, 3, 3]; after the fix, it passes with[1, 1, 1, 0].Added four compatibility cases verifying:
Manually reran the reproduction and confirmed
[1, 1, 1, 0]. The full build and tracked-file formatting checks also passed.pnpm test)pnpm lint && pnpm typecheck)Checklist