User story
The main advantage of integrating @code-pushup/typescript-plugin is that it allows setting a strict aspirational tsconfig.json, even though the current codebase isn't prepared to meet those standards. This can be set up with 2 tsconfigs - the old config that currently passes compilation, and a derived config with added strict flags for Code PushUp. This facilitates incremental improvements over a longer period of time, with progress being tracked and no blocking build errors.
Real-world example
tsconfig.json
{
"extends": "@strapi/typescript-utils/tsconfigs/server",
"compilerOptions": {
"jsx": "react",
"outDir": "dist",
"rootDir": ".",
"allowJs": true,
"baseUrl": "./",
"target": "esnext",
"skipLibCheck": true,
"strictNullChecks": true,
"noUncheckedIndexedAccess": true
},
"include": ["./"],
"exclude": ["node_modules/", "build/", "dist/", ".cache/", ".tmp/"]
}
tsconfig.strict.json
{
"extends": "./tsconfig.json",
"compilerOptions": {
"strict": true,
"noUncheckedIndexedAccess": true
}
}
Acceptance criteria
User story
The main advantage of integrating
@code-pushup/typescript-pluginis that it allows setting a strict aspirationaltsconfig.json, even though the current codebase isn't prepared to meet those standards. This can be set up with 2 tsconfigs - the old config that currently passes compilation, and a derived config with added strict flags for Code PushUp. This facilitates incremental improvements over a longer period of time, with progress being tracked and no blocking build errors.Real-world example
tsconfig.json{ "extends": "@strapi/typescript-utils/tsconfigs/server", "compilerOptions": { "jsx": "react", "outDir": "dist", "rootDir": ".", "allowJs": true, "baseUrl": "./", "target": "esnext", "skipLibCheck": true, "strictNullChecks": true, "noUncheckedIndexedAccess": true }, "include": ["./"], "exclude": ["node_modules/", "build/", "dist/", ".cache/", ".tmp/"] }tsconfig.strict.json{ "extends": "./tsconfig.json", "compilerOptions": { "strict": true, "noUncheckedIndexedAccess": true } }Acceptance criteria
strict,noUncheckedIndexedAccess, andexactOptionalPropertyTypescompiler options are pre-selected.strictflag is enabled but other flags within this family are disabled (e.g.,strictNullChecksornoImplicitAny), then these flags are pre-selected.tsconfig.strict.jsonis created.tsconfig.strict.jsonextends the existing tsconfig (previously selected by the user in TypeScript plugin setup wizard #1256).tsconfig.strict.jsonenables the selected compiler options.@code-pushup/typescript-pluginsetup incode-pushup.config.tsuses the newtsconfig.strict.jsoninstead of the user-provided existing tsconfig.