Fix inferred project JavaScript file support when compiler options are provided #2622
+137
−0
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.
Fourslash tests failed for .js files when compiler options were provided to the inferred project without explicitly setting
AllowJs. The inferred project only applied itsAllowJs: truedefault whencompilerOptions == nil, causing .js files to be excluded from the project.Changes
Fix in
internal/project/project.go:Now applies
AllowJs: truedefault when the option is unset (TSUnknown), regardless of whethercompilerOptionsis nil.Test coverage in
internal/fourslash/tests/test_js_file_issue_test.go:.jsfiles with no JS-related compiler options (reproduces bug, verifies fix).jsfiles with@checkJs: true(ensures existing behavior preserved).jsfiles with explicit@allowJs: false(ensures explicit settings override defaults)Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.