- add
tsconfig.json
and removejsconfig.json
- change
index.js
toindex.tsx
- install dependencies:
yarn add typescript @types/node @types/react @types/react-dom @types/jest --dev
- make test component like
Test.tsx
and check if typescript works there
If your project uses relative-to-root instead of relative-to-current-file paths like below:
import routes from 'domain/routes';
You should add this to the tsconfig.json
: "baseUrl": "./src",
Then in all the descendant directories you can use paths like tools/something
instead of ../../../tools/something