I have this tsconfig.json
file
{
"compilerOptions": {
"target": "es2019",
"lib": [
"es2020",
"esnext.asynciterable"
],
"typeRoots": [
"./node_modules/@types",
"./src/types"
],
"allowSyntheticDefaultImports": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "node",
"module": "commonjs",
"pretty": true,
"sourceMap": true,
"outDir": "./build",
"allowJs": true,
"noEmit": false
},
"include": [
"./src/**/*"
],
"exclude": [
"node_modules",
"tests"
]
}
As far as you can see there are no strict rules there. The most important for me it's starting to use strictNullChecks
setting, but my project is already large, and when I set this setting to true
I've got ~1000 errors.
I want to start refactor code for avoiding potential issues, but I want to move step by step, file by file and don't want to spend time resolving 1000 errors at once.
How can I achieve it?
I had a plan to use a comment // @ts-ignore
for each error line and then incrementally resolve problems. But it's even hard to add // @ts-ignore
1000 times. How can I do it automatically?
Any advice please