Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build: Add TypeScript version validation (#21208)
Provide clear errors due to mismated TypeScript versions. This should help make the transition period from #18942 smoother. Add `validate-typescript-version` bin that will be used by `lint-staged` typechecker and in `build:package-types` script. This helps to prevent cryptic errors when an older TypeScript module is present in `node_modules` and requires updating. Without this change, lint-staged and `npm run build:package-types` would print this error: ```none # npm run build:pacakge-types > tsc --build error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. error TS5053: Option 'declaration' cannot be specified with option 'isolatedModules'. ``` This is due to an incompatible TypeScript package. With this change, these script will print this error: ```none $ npm run build:package-types > node ./bin/packages/validate-typescript-version.js && tsc --build TypeScript dependency out of date. Detected: '3.5.3' Required: '3.8.3' Please ensure dependencies are up to date. ```
- Loading branch information