Skip to content
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

chore: move @types deps to ts_config #469

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

chore: move @types deps to ts_config #469

wants to merge 1 commit into from

Conversation

alexeagle
Copy link
Collaborator

@alexeagle alexeagle commented Jun 11, 2024

This is simpler for Gazelle to be able to generate, since it follows the locality principle: tsconfig.json contains data needed to generate ts_config rule, and no ambients need to be listed on ts_project when the srcs didn't reference them.

Also means Source code doesn't have to include any indication these 'ambient' types are required, as is typical in typescript.

To make this pattern more accessible, we'll also need to improve error messaging to suggest compilerOptions.types needs to be explicit for all compilation units that use that tsconfig.json file, possibly by offering to edit the file.

@alexeagle alexeagle requested a review from jbedard June 11, 2024 03:09
@alexeagle alexeagle changed the title chore: typecheck dep on all @types chore: move @types deps to ts_config Jun 11, 2024
Source code doesn't have to include any indication these 'ambient' types are required.
However we can force users to be explicit in the tsconfig of which `@types` packages to include in compilation.
This follows the locality principle, since the types weren't referenced in the sources, the deps dont belong on the ts_project.
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.

1 participant