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

Add Yarn constraint to validate references in tsconfig.json and tsconfig.build.json against internal dependencies #1922

Closed
mcmire opened this issue Oct 25, 2023 · 1 comment

Comments

@mcmire
Copy link
Contributor

mcmire commented Oct 25, 2023

It is critical that if your package relies on another package within the repo, that you add that package not only as a dependency, but you also add that package to the references field in both tsconfig.json and tsconfig.build.json. Doing so ensures that your package is being compiled with the correct types at build time.

Furthermore, it is critical that the list of references in tsconfig.json and tsconfig.build.json are the same, except that each reference in tsconfig.build.json ends in /tsconfig.build.json. Doing so ensures that the exact same set of types are used in development as production.

It is easy to miss one or both of these items, especially when creating a new package.

Now that we are using JavaScript constraints, we can check both using constraints.

@mcmire mcmire changed the title Add script for ensuring that tsconfig.json and tsconfig.build.json match, and run it on lint Add Yarn constraint to validate references in tsconfig.json and tsconfig.build.json against internal dependencies Oct 24, 2024
@mcmire
Copy link
Contributor Author

mcmire commented Oct 25, 2024

This is a duplicate of #966. Closing and copying any relevant information there.

@mcmire mcmire closed this as not planned Won't fix, can't repro, duplicate, stale Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants