Never report diagnostics for .d.bs typedef files - #1759
Open
markwpearce wants to merge 2 commits into
Open
Conversation
.d.bs files are ambient type declarations only - they're never executed, so validating their own content (e.g. cross-scope type resolution) can surface false errors when a typedef ends up malformed by some external tool (e.g. ropm's namespace rewriting), even though nothing would ever break at runtime. Fixes #1757 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
.d.bsfiles are ambient type declarations only — they're never executed, so their own content should never surface diagnostics (similar to how TypeScript'sskipLibChecktreats.d.tsfiles).ScopeValidator) entirely for typedef files, so cross-namespace type resolution issues (e.g.cannot-find-name) inside a.d.bsno longer break a consuming project's build.CrossScopeValidator's required-symbol collection, so their own unresolved type references aren't flagged as missing symbols. Symbols provided by.d.bsfiles (needed by consumers) are unaffected.Fixes #1757
Test plan
.d.bsscenario from the issue (namespace-qualified ambient types that don't actually resolve) and asserting zero diagnosticsnpm run test:nocover— full suite passes (4262 passing)npm run lintpasses