跳转到主要内容

create-react-app JavaScript project to TypeScript

Add dependencies

npm add -D typescript @types/react @types/node @types/react-dom @types/jest

Delete node_modules and reinstall everything

npm i 

Use CMD change file name

windows bat

@echo off

rem Searching...

for /f "delims=" %%i in ('dir /b /a-d /s "*.js"') do ren "%%i" "%%~ni.ts"

rem Done

@pause