I am encountering an issue with my tsconfig.json file:
{
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"baseUrl": "src",
"isolatedModules": true,
"jsx": "preserve",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"lib": ["dom", "dom.iterable", "esnext"],
"module": "esnext",
"moduleResolution": "node",
"noEmit": true,
"noImplicitAny": true,
"noUnusedLocals": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"target": "es5",
"types": ["node", "jest"]
},
"include": ["./src/**/*.ts", "./src/**/*.tsx"],
"plugins": [
{
"name": "typescript-tslint-plugin"
}
]
}
Even though I have set noImplicitAny
, TypeScript is inferring the type for a specific object in my code:
export const routes = [
{
exact: true,
id: "home",
main: {
component: Home,
},
path: "/",
},
{
id: "audit-report",
main: {
component: AuditReport,
},
path: "/reports/audit",
},
];
I was expecting an error to be flagged for this particular object since it lacks explicit typing.