From 4e1d42fdaf613ceab556a0ef198fe11871ef496a Mon Sep 17 00:00:00 2001 From: pedroacamargo Date: Wed, 21 Jun 2023 16:00:46 +0100 Subject: [PATCH 1/2] Typescript final migration --- src/{index.js => index.tsx} | 6 ++++-- src/react-app-env.d.ts | 1 + tsconfig.json | 12 +++++++++--- 3 files changed, 14 insertions(+), 5 deletions(-) rename src/{index.js => index.tsx} (66%) create mode 100644 src/react-app-env.d.ts diff --git a/src/index.js b/src/index.tsx similarity index 66% rename from src/index.js rename to src/index.tsx index 593edf1..d77cdf9 100644 --- a/src/index.js +++ b/src/index.tsx @@ -2,9 +2,11 @@ import React from 'react'; import ReactDOM from 'react-dom/client'; import App from './App'; -const root = ReactDOM.createRoot(document.getElementById('root')); +const root = ReactDOM.createRoot( + document.getElementById('root') as HTMLElement +); root.render( -); +); \ No newline at end of file diff --git a/src/react-app-env.d.ts b/src/react-app-env.d.ts new file mode 100644 index 0000000..6431bc5 --- /dev/null +++ b/src/react-app-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/tsconfig.json b/tsconfig.json index 9d767b1..8de5e1c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,11 @@ { "compilerOptions": { + "target": "es5", + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], "allowJs": true, "skipLibCheck": true, "esModuleInterop": true, @@ -13,8 +19,8 @@ "isolatedModules": true, "noEmit": true, "jsx": "react-jsx" - }, +}, "include": [ - "./src/" + "src" ] -} \ No newline at end of file +} From 97f774f45f64d87e5a0b5f0ceb84a1f2a48ef42e Mon Sep 17 00:00:00 2001 From: pedroacamargo Date: Wed, 21 Jun 2023 16:03:13 +0100 Subject: [PATCH 2/2] Typescript final migration --- webpack.config.js => webpack.config.ts | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename webpack.config.js => webpack.config.ts (100%) diff --git a/webpack.config.js b/webpack.config.ts similarity index 100% rename from webpack.config.js rename to webpack.config.ts