bazelbuild / examples

Examples for Bazel
http://bazel.build
Apache License 2.0
841 stars 515 forks source link

chore: move @types deps to ts_config #469

Open alexeagle opened 5 months ago

alexeagle commented 5 months ago

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.