#Errors broken in VS Code?
10 messages · Page 1 of 1 (latest)
Also very weird when I run tsc build it doesn't show any errors either.
I thought TS was supposed to find errors or bugs before you even build it?
{
"compilerOptions": {
"module": "NodeNext",
"moduleResolution": "NodeNext",
"target": "ESNext",
"sourceMap": true,
"outDir": "dist",
"strict": true,
"noImplicitAny": true
},
"include": ["src/**/*"]
}
What error are you expecting? By declaring the array in that fashion orderQueue is any[]
Arguably something like that could be caught by noImplicitAny but doesn't seem to be
orderQueue is constant.
Are you referring to the mutability? If so, that doesn't mean the array is immutable, rather the variable reference can't be changed:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const
If you want the array to be immutable you can declare it as readonly:
const foo : readonly any[] = []
I guess I'm stupid, sorry about that. After years of NodeJS I still didn't know that. Thanks so much!