Skip to content

Add isSourceFile() type guard#4210

Open
mrazauskas wants to merge 2 commits into
microsoft:mainfrom
mrazauskas:add-isSourceFile
Open

Add isSourceFile() type guard#4210
mrazauskas wants to merge 2 commits into
microsoft:mainfrom
mrazauskas:add-isSourceFile

Conversation

@mrazauskas
Copy link
Copy Markdown

Signed-off-by: mrazauskas <tom@mrazauskas.de>
Copilot AI review requested due to automatic review settings June 5, 2026 16:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a new type guard to detect TypeScript SourceFile nodes in the AST helper utilities.

Changes:

  • Import SourceFile type in ast/is.ts
  • Add isSourceFile(node: Node): node is SourceFile helper

@RyanCavanaugh RyanCavanaugh added this to the Post-7.0 milestone Jun 5, 2026
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.

isSourceFile() is missing in the API

3 participants