In this example in Typescript playground I'm trying to use an nonexistent type inside a namespace and I get an error:
This is expected.
But in my local dev environment, Typescript is basically accepting any nonexistent type as any
.
Note: This is only happening inside d.ts
files.
Don't know if it matters, but I'm using the noImplicitAny: true
flag.
See my tsconfig.json
file:
{
"compilerOptions": {
"allowJs": true,
"baseUrl": ".",
"esModuleInterop": true,
"jsx": "react",
"module": "CommonJS",
"moduleResolution": "Node",
"noEmit": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strictNullChecks": true,
"target": "ES6",
"paths": {
"@src/*": ["./src/*"],
}
},
"include": [
"src/**/*",
"functions/src/**/*",
"functions/index.ts"
],
}
How can I make Typescript detect those errors?
.d.ts
file? – Chacon