Skip to content

fix(source-resolution): tsconfig-condition reports the project that lacks the condition - #76

Merged
systemfsoftware-bot merged 2 commits into
mainfrom
fix/multifile-finding-file
Nov 27, 2026
Merged

systemfsoftware-bot merged 2 commits into
mainfrom
fix/multifile-finding-file

Conversation

@systemfsoftware-bot

Copy link
Copy Markdown
Contributor

source-resolution/tsconfig-condition named the wrong file when a project had no customConditions key at all.

Cause

The rule's locate: pattern matched only a customConditions list that lacks the condition. With the key absent it found nothing. The finding then fell back to the first path the multifile match reports for the directory, and that list holds every tsconfig file there. So a directory with a passing tsconfig.app.json and a failing tsconfig.node.json reported tsconfig.app.json.

Fix

The locator also matches the include of a project that has no customConditions key and extends no preset or relative config. That is the same per-file predicate the rule checks. A list that is present but wrong is still located at the list.

Evidence

  • New fixture bad/failing-beside-passing: the old rule reports tsconfig.app.json there, and the new one reports tsconfig.node.json:5:3-5:34.
  • bad/no-condition-no-preset now expects the include range instead of the bare file.
  • gritlint test packs: 341 cases passed.

One finding per directory is unchanged: that is the multifile contract (a_multifile_rule_reports_one_finding_per_directory).

@systemfsoftware-bot
systemfsoftware-bot merged commit 034617c into main Nov 27, 2026
5 checks passed
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