Created
April 12, 2021 17:07
-
-
Save michalczukm/ab46d435ba7e8cf86995a3a7d627e915 to your computer and use it in GitHub Desktop.
Moves js exercises files to TS - so now you can do the examples in TS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
npm install -D typescript @types/node @types/react @types/react-dom @types/jest | |
echo "{ | |
"compilerOptions": { | |
"target": "ESNext", | |
"lib": ["dom", "dom.iterable", "esnext"], | |
"allowJs": true, | |
"skipLibCheck": true, | |
"esModuleInterop": true, | |
"allowSyntheticDefaultImports": true, | |
"strict": true, | |
"forceConsistentCasingInFileNames": true, | |
"noFallthroughCasesInSwitch": true, | |
"module": "esnext", | |
"moduleResolution": "node", | |
"resolveJsonModule": true, | |
"isolatedModules": true, | |
"noEmit": true, | |
"jsx": "react-jsx" | |
}, | |
"include": ["src", "./src/typings.d.ts"] | |
} " > tsconfig.json | |
for f in src/exercise/*.js; do sed -i '' '1s/^/\/\/ @ts-nocheck\'$'\n/g' "$f"; mv -- "$f" "${f%.js}.tsx"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment