Repository navigation
Point the readyWhen type error at the readyWhen value - #1561
Open
Ishkirat-Singh wants to merge 1 commit into
Open
Ishkirat-Singh wants to merge 1 commit into
Ishkirat-Singh wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
When
service.readyWhenis not an object, for example"readyWhen": 1, Wireit reportsExpected an object., but the diagnostic's range covers the whole"service": {...}object, not thereadyWhenvalue. So the CLI underlines theserviceblock, and in the editor the squiggle spans the whole object, which is an object. That makes the message hard to act on.In
#processService(src/analyzer.ts), the failure for a non-objectreadyWhenbuilt its location fromserviceNodeand not fromwaitForNode(thereadyWhennode). The siblinglineMatcheschecks right below already use their own node. This useswaitForNodefor the range.The existing
service.readyWhen must be an objecttest insrc/test/errors-analysis.test.tshad captured the old output. I updated it to expect the error atpackage.json:9:22, with only the1underlined. With the test change but not the fix, the test fails and shows the old range (package.json:8:18, the wholeserviceobject underlined). With the fix it passes. I also added an entry under Unreleased > Fixed inCHANGELOG.md.Testing (Windows, Node 24):
tsc --build --pretty, thennode --test lib/test/errors-analysis.test.js: 69 tests, 69 pass.prettier --checkandeslintpass on the changed files.