Improve TS configuration for target and included libs for monorepo packages #29840
Labels
stale
no activity on this issue for a long period
topic: typescript
type: chore
Work is required w/ no deliverable to end user
Currently, TSConfig is spread around and not necessarily mutually compatible between packages in the monorepo.
Discovery:
ts-check
script, or if it is indicative of potential build failures.DevEx / TechDebt pain point this is intended to fix:
Monorepo packages sometimes have older libs and/or targets than the packages that they import. This can break check-ts in interesting ways. Example:
ts/tsconfig.json
declaresES2018
as the default target, and includes libraries forES2018
,ES2020.Promise
,ES2021.String
.@packages/source-package
overrides the included libraries, but not the target. It's still targetingES2018
, but is including all libs foresnext
. It makes extensive use ofes2022
features, like the#
prefix for truly private fields on classes.@packages/destination-package
uses the defaults, and imports portions of@packages/parent-package
that use the#
prefix for private fields.ts-check
will fail for@packages/destination-package
, but will reference the file that uses the#
prefix in@packages/source-package
.Acceptance Criteria:
tsconfig
lib and target values are either synchronized across all packages, or values are verified such that dependencies are required to have a subset of their dependent's lib and target valuesThe text was updated successfully, but these errors were encountered: