mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
The `packages/core/test` test code was relying on non-ESM compatible features like untyped `require` calls. We switch these to ESM `import` statements/expressions and make it strongly typed. It's a trade-off between type-safety and the dependency graph- but it feels more reasonable typing this properly to actually benefit from the type system provided by using TypeScript. Additionally, we align the IDE tsconfigs to use `esnext` as module because that is what we use in Bazel and it allows us to use top-level await. PR Close #48521
35 lines
1.1 KiB
JSON
35 lines
1.1 KiB
JSON
/**
|
|
* Root tsconfig file for use building all Angular packages. Note there is no rootDir
|
|
* and therefore any tsconfig in the package directory will need to define its own
|
|
* rootDir.
|
|
*/
|
|
{
|
|
"compilerOptions": {
|
|
"declaration": true,
|
|
"stripInternal": true,
|
|
"noImplicitAny": true,
|
|
"noImplicitOverride": true,
|
|
"strictNullChecks": true,
|
|
"esModuleInterop": true,
|
|
"strict": true,
|
|
"strictPropertyInitialization": true,
|
|
"noFallthroughCasesInSwitch": true,
|
|
"moduleResolution": "node",
|
|
"module": "esnext",
|
|
"target": "es2020",
|
|
"lib": ["es2020", "dom"],
|
|
"skipLibCheck": true,
|
|
// don't auto-discover @types/node, it results in a ///<reference in the .d.ts output
|
|
"types": [],
|
|
"experimentalDecorators": true,
|
|
// This is needed due to https://github.com/Microsoft/TypeScript/issues/17516.
|
|
// As tsickle will lower decorators before TS, this is not a problem for our build.
|
|
"emitDecoratorMetadata": true,
|
|
"sourceMap": true,
|
|
"inlineSources": true,
|
|
"importHelpers": true
|
|
},
|
|
"bazelOptions": {
|
|
"suppressTsconfigOverrideWarnings": true
|
|
}
|
|
}
|