-
Notifications
You must be signed in to change notification settings - Fork 648
Set maxNodeModuleJsDepth in JS-containing projects #1213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for setting a maximum depth for Node.js modules in projects that contain JavaScript files. Key changes include:
- Introducing a new field (rootJSFileCount) to track the count of JS files.
- Updating project configuration in updateProgram() to set a default MaxNodeModuleJsDepth when JS files are present.
- Refactoring root file management by replacing direct map access with helper methods that update the JS file count.
internal/project/project.go
Outdated
func (p *Project) setRootFileNameOfInferred(path tspath.Path, fileName string) { | ||
has := p.rootFileNames.Has(path) | ||
p.rootFileNames.Set(path, fileName) | ||
if p.kind == KindInferred { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to check this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like I should at least assert it for these functions? There's no guards elsewhere.
Could use a test, but this looks correct to me in theory.
Fixes #1209