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

[2.0.0-beta.8][typescript] tsconfig 设置 noEmitOnError 无效 #5111

Closed
dpyzo0o opened this issue Dec 17, 2019 · 4 comments
Closed

[2.0.0-beta.8][typescript] tsconfig 设置 noEmitOnError 无效 #5111

dpyzo0o opened this issue Dec 17, 2019 · 4 comments
Assignees
Milestone

Comments

@dpyzo0o
Copy link

dpyzo0o commented Dec 17, 2019

问题描述

tsconfig 中开启 noEmitOnError: true,当代码中有类型错误时,taro 会正常编译。

复现步骤

tsconfig 配置

  "compilerOptions": {
    "target": "es2017",
    "module": "commonjs",
    "removeComments": false,
    "preserveConstEnums": true,
    "moduleResolution": "node",
    "experimentalDecorators": true,
    "noImplicitAny": false,
    "allowSyntheticDefaultImports": true,
    "outDir": "lib",
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "strictNullChecks": true,
    "sourceMap": true,
    "baseUrl": ".",
    "rootDir": ".",
    "jsx": "preserve",
    "jsxFactory": "Taro.createElement",
    "allowJs": true,
    "resolveJsonModule": true,
    "typeRoots": ["node_modules/@types", "global.d.ts"],
    "paths": {
      "~/*": ["src/*"]
    }
  }

期望行为

代码中有类型错误时控制台报错,编译不通过。

报错信息

系统信息

Taro CLI 2.0.0-beta.8 environment info:
System:
OS: macOS High Sierra 10.13.6
Shell: 5.3 - /bin/zsh
Binaries:
Node: 10.15.3 - ~/.nvm/versions/node/v10.15.3/bin/node
Yarn: 1.16.0 - ~/.nvm/versions/node/v10.15.3/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v10.15.3/bin/npm
npmPackages:
@tarojs/async-await: 2.0.0-beta.8 => 2.0.0-beta.8
@tarojs/cli: 2.0.0-beta.8 => 2.0.0-beta.8
@tarojs/components: 2.0.0-beta.8 => 2.0.0-beta.8
@tarojs/plugin-babel: 2.0.0-beta.8 => 2.0.0-beta.8
@tarojs/plugin-csso: 2.0.0-beta.8 => 2.0.0-beta.8
@tarojs/plugin-sass: 2.0.0-beta.8 => 2.0.0-beta.8
@tarojs/plugin-uglifyjs: 2.0.0-beta.8 => 2.0.0-beta.8
@tarojs/redux: 2.0.0-beta.8 => 2.0.0-beta.8
@tarojs/redux-h5: 2.0.0-beta.8 => 2.0.0-beta.8
@tarojs/router: 2.0.0-beta.8 => 2.0.0-beta.8
@tarojs/taro: 2.0.0-beta.8 => 2.0.0-beta.8
@tarojs/taro-alipay: 2.0.0-beta.8 => 2.0.0-beta.8
@tarojs/taro-h5: 2.0.0-beta.8 => 2.0.0-beta.8
@tarojs/taro-qq: 2.0.0-beta.8 => 2.0.0-beta.8
@tarojs/taro-quickapp: 2.0.0-beta.8 => 2.0.0-beta.8
@tarojs/taro-swan: 2.0.0-beta.8 => 2.0.0-beta.8
@tarojs/taro-tt: 2.0.0-beta.8 => 2.0.0-beta.8
@tarojs/taro-weapp: 2.0.0-beta.8 => 2.0.0-beta.8
@tarojs/webpack-runner: 2.0.0-beta.8 => 2.0.0-beta.8
eslint-config-taro: 2.0.0-beta.8 => 2.0.0-beta.8
eslint-plugin-taro: 2.0.0-beta.8 => 2.0.0-beta.8
nerv-devtools: ^1.5.6 => 1.5.6
nervjs: ^1.5.6 => 1.5.6
stylelint-config-taro-rn: 2.0.0-beta.8 => 2.0.0-beta.8
stylelint-taro-rn: 2.0.0-beta.8 => 2.0.0-beta.8
npmGlobalPackages:
typescript: 3.6.3

补充信息

如果您有功能上的建议,可以提到 FeatHub

使用上的问题,欢迎在「Taro 社区」一起交流

@taro-bot
Copy link

taro-bot bot commented Dec 17, 2019

CC @luckyadam

@taro-bot
Copy link

taro-bot bot commented Dec 17, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@Garfield550 Garfield550 added this to the 2.0.0-beta.9 milestone Dec 17, 2019
@dpyzo0o
Copy link
Author

dpyzo0o commented Dec 19, 2019

有人帮忙看一下嘛

@luckyadam
Copy link
Member

因为 Taro 的编译没有管 tsconfig 的配置,一般 typescript 出错编辑器都会有体现

@dpyzo0o dpyzo0o closed this as completed Dec 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants