interface o {
name: string
}
const func = (obj: o): boolean => true
// this should throw error message.(or warning message at least, but it doesn't)
func({ name })
name
is undefined in the code I wrote, so func({ name })
should throw an error I think. Is this intended?
Can I fix this with eslint or tsc config?
edit: this isn't a duplicate
I'm in node and Global.name is undefined.
It seems tsc
thinks name
is string though.
my tsconfig.json:
{
"compilerOptions": {
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"skipLibCheck" : true,
"rootDir": "./src",
"outDir": "./src/js"
}
}