From fe74173f19b6e341114723a99043440abce27bd6 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Thu, 26 Aug 2021 21:57:49 +0800 Subject: [PATCH] feat: explicit set `useDefineForClassFields` in ts templates (#4280) --- packages/create-vite/template-lit-element-ts/tsconfig.json | 3 ++- packages/create-vite/template-preact-ts/tsconfig.json | 1 + packages/create-vite/template-react-ts/tsconfig.json | 1 + packages/create-vite/template-svelte-ts/tsconfig.json | 1 + packages/create-vite/template-vanilla-ts/tsconfig.json | 1 + packages/create-vite/template-vue-ts/tsconfig.json | 1 + 6 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/create-vite/template-lit-element-ts/tsconfig.json b/packages/create-vite/template-lit-element-ts/tsconfig.json index d17e916d3feb33..8957a2f4482d3f 100644 --- a/packages/create-vite/template-lit-element-ts/tsconfig.json +++ b/packages/create-vite/template-lit-element-ts/tsconfig.json @@ -14,7 +14,8 @@ "moduleResolution": "node", "allowSyntheticDefaultImports": true, "experimentalDecorators": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "useDefineForClassFields": false }, "include": ["src/**/*.ts"], "exclude": [] diff --git a/packages/create-vite/template-preact-ts/tsconfig.json b/packages/create-vite/template-preact-ts/tsconfig.json index 84c196e7a3ff0f..3925179fdbfeae 100644 --- a/packages/create-vite/template-preact-ts/tsconfig.json +++ b/packages/create-vite/template-preact-ts/tsconfig.json @@ -1,6 +1,7 @@ { "compilerOptions": { "target": "ESNext", + "useDefineForClassFields": true, "lib": ["DOM", "DOM.Iterable", "ESNext"], "allowJs": false, "skipLibCheck": false, diff --git a/packages/create-vite/template-react-ts/tsconfig.json b/packages/create-vite/template-react-ts/tsconfig.json index 013e6c54f0e341..64147035c08dc9 100644 --- a/packages/create-vite/template-react-ts/tsconfig.json +++ b/packages/create-vite/template-react-ts/tsconfig.json @@ -1,6 +1,7 @@ { "compilerOptions": { "target": "ESNext", + "useDefineForClassFields": true, "lib": ["DOM", "DOM.Iterable", "ESNext"], "allowJs": false, "skipLibCheck": false, diff --git a/packages/create-vite/template-svelte-ts/tsconfig.json b/packages/create-vite/template-svelte-ts/tsconfig.json index 69d75958d35c3f..f9039a5aab1bb0 100644 --- a/packages/create-vite/template-svelte-ts/tsconfig.json +++ b/packages/create-vite/template-svelte-ts/tsconfig.json @@ -2,6 +2,7 @@ "extends": "@tsconfig/svelte/tsconfig.json", "compilerOptions": { "target": "esnext", + "useDefineForClassFields": true, "module": "esnext", "resolveJsonModule": true, "baseUrl": ".", diff --git a/packages/create-vite/template-vanilla-ts/tsconfig.json b/packages/create-vite/template-vanilla-ts/tsconfig.json index 4824d012f24b62..8cdbb2ac97c4b1 100644 --- a/packages/create-vite/template-vanilla-ts/tsconfig.json +++ b/packages/create-vite/template-vanilla-ts/tsconfig.json @@ -1,6 +1,7 @@ { "compilerOptions": { "target": "ESNext", + "useDefineForClassFields": true, "module": "ESNext", "lib": ["ESNext", "DOM"], "moduleResolution": "Node", diff --git a/packages/create-vite/template-vue-ts/tsconfig.json b/packages/create-vite/template-vue-ts/tsconfig.json index 5b6c24dfc57c0d..8617c8a54fe868 100644 --- a/packages/create-vite/template-vue-ts/tsconfig.json +++ b/packages/create-vite/template-vue-ts/tsconfig.json @@ -1,6 +1,7 @@ { "compilerOptions": { "target": "esnext", + "useDefineForClassFields": true, "module": "esnext", "moduleResolution": "node", "strict": true,