Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): 更新内置默认模板 tsconfig.json #15417

Open
wants to merge 3 commits into
base: 3.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/taro-cli/templates/default/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const App = {
},
render(h) {
// this.$slots.default 是将要会渲染的页面
return h('block', this.$slots.default)
return h('block', {{#if typescript }}(this as unknown as Vue){{else}}this{{/if}}.$slots.default)
}
}
{{/if}}
Expand Down
19 changes: 9 additions & 10 deletions packages/taro-cli/templates/default/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
{
"compilerOptions": {
// https://npmjs.com/package/@tsconfig/recommended
"target": "es2017",
"module": "commonjs",
"removeComments": false,
"preserveConstEnums": true,
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,

"moduleResolution": "node",
"experimentalDecorators": true,
"noEmit": true,
"noImplicitAny": false,
"allowSyntheticDefaultImports": true,
"declaration": false, // fix IDE compile error(tsc --noEmit false --declaration true). ref: https://github.com/microsoft/TypeScript/issues/47663#issuecomment-1519138189
"outDir": "lib",
"noUnusedLocals": true,
"noUnusedParameters": true,
"strictNullChecks": true,
"sourceMap": true,
"rootDir": ".",
"jsx": "{{#if (includes "Vue" "Vue3" s=framework)}}preserve{{else}}react-jsx{{/if}}",{{#if (eq framework "Preact") }}
"skipLibCheck": true,{{/if}}
"jsx": "{{#if (includes "Vue" "Vue3" s=framework)}}preserve{{else}}react-jsx{{/if}}",
"allowJs": true,
"resolveJsonModule": true,
"typeRoots": [
"node_modules/@types"
],
"paths": {
// TS5090 leading './'
"@/*": ["./src/*"]
Expand Down
Loading