Why is it that the code below (inside an arbitrary Class) does not show a TypeScript error in VSCode as expected?
protected someMethod (someArg?: boolean) {
this.doSomething(someArg)
}
protected doSomething (mustBePassedBoolean: boolean) {
/* ... */
}
The tooltip does not recognize that someArg
should be of type boolean|undefined
:
https://i.stack.imgur.com/0lmTI.png
I suspect this may be due to a misconfiguration in eslint, given that the same code in the TypeScript playground behaves as expected. However, I am unable to identify any eslint configuration errors in the VSCode console.
Are there any suggestions on troubleshooting eslint issues like this in VS Code?
Edit
It's important to note that I am encountering some anticipated TypeScript errors in the same file. It appears this issue only arises with variables that are expected to be assigned as |undefined
.