I would like to upgrade [email protected] for my React application (it is already using Typescript).
After I run yarn add typescript@latest
or yarn upgrade typescript@latest
, there are changes in package.json and lock file to the latest version without any error.
I don’t install typescript globally.
However, the Typescript new features are not usable yet.
E.g I cannot use intersection
method for Set.
Could someone help me point out what steps I miss in order to upgrade Typescript?
This is my tsconfig.json.
{
"compilerOptions": {
"baseUrl": ".",
"sourceMap": true, // allow sourcemap support
"strictNullChecks": true, // enable strict null checks as a best practice
"module": "commonjs", // specify module code generation
"jsx": "react", // use typescript to transpile jsx to js
"target": "ESNext", // specify ECMAScript target version
"allowJs": false, // allow a partial TypeScript and JavaScript codebase
"checkJs": false,
"noEmit": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"resolveJsonModule": true,
"useUnknownInCatchVariables": true,
"noUncheckedIndexedAccess": true,
"strictPropertyInitialization": true,
"strictBindCallApply": true,
"lib": [
"es2018", "DOM", "ESNext.Array"
],
"esModuleInterop": true,
"typeRoots": ["node_modules/@types", "types"],
"downlevelIteration": true,
"skipLibCheck": true,
"paths": {
"@/*": ["public/*"],
"@test/*": ["test/*"],
"@modules/*": ["modules/*"]
}
},
"exclude": [
"./build",
"./distributions"
]
}
13