I'm wondering why there's no error when I do something blatantly wrong like this:
const test : number = 123;
const test2 = test[3];
This is the tsconfig I'm using:
{
"compilerOptions": {
"module": "commonjs",
"declaration": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"target": "es2017",
"sourceMap": true,
"outDir": "./dist",
"baseUrl": "./",
"incremental": true
}
}
CodePudding user response:
You need to add
"strict": true
to your tsconfig.