I am using core-ui project and I am trying implement Typescript on my component files.
I'm getting an error from VSCODE which does't allow me to use it in files with tsx extention.
const TheLayout: React.FunctionComponent = () => {}
Getting the following error:
Type annotations can only be used in TypeScript files.ts(8010)
My tsconfig.json file:
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react",
"rootDir": "src",
"outDir": "build",
"noFallthroughCasesInSwitch": true
},
"files.associations": {
"*.tsx": "typescriptreact",
"*.ts": "typescriptreact"
},
"include": [
"src"
]
}
