Repository navigation
fix(source-resolution): tsconfig-condition reports the project that lacks the condition - #76
Merged
Merged
Conversation
…acks the condition, not its first sibling
…roject that passes the rule
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.
source-resolution/tsconfig-conditionnamed the wrong file when a project had nocustomConditionskey at all.Cause
The rule's
locate:pattern matched only acustomConditionslist 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 passingtsconfig.app.jsonand a failingtsconfig.node.jsonreportedtsconfig.app.json.Fix
The locator also matches the
includeof a project that has nocustomConditionskey 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
bad/failing-beside-passing: the old rule reportstsconfig.app.jsonthere, and the new one reportstsconfig.node.json:5:3-5:34.bad/no-condition-no-presetnow expects theincluderange 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).