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

taro的TS版本过低 #4631

Closed
chenyulun opened this issue Oct 20, 2019 · 7 comments
Closed

taro的TS版本过低 #4631

chenyulun opened this issue Oct 20, 2019 · 7 comments

Comments

@chenyulun
Copy link

问题描述
taro doctor命令以后提示了ts版本过高后一直卡住,新建的项目配置ts、默认模板
复现步骤
[复现问题的步骤]

  1. taro doctor

期望行为
升级ts版本

报错信息

➜  tarotest git:(master) ✗ taro doctor            
👽 Taro v1.3.20

⠋ 正在诊断项目...=============

WARNING: You are currently running a version of TypeScript which is not officially supported by typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.2.1 <3.6.0

YOUR TYPESCRIPT VERSION: 3.6.4

Please only submit bug reports when using the officially supported version.

=============
⠋ 正在诊断项目...

系统信息

➜  tarotest git:(master) ✗ taro info              
👽 Taro v1.3.20


  Taro CLI 1.3.20 environment info:
    System:
      OS: macOS 10.14.6
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 12.6.0 - /usr/local/bin/node
      Yarn: 1.17.3 - /usr/local/bin/yarn
      npm: 6.11.3 - ~/.npm-global/bin/npm
    npmPackages:
      @tarojs/components: 1.3.20 => 1.3.20 
      @tarojs/plugin-babel: 1.3.20 => 1.3.20 
      @tarojs/plugin-csso: 1.3.20 => 1.3.20 
      @tarojs/plugin-sass: 1.3.20 => 1.3.20 
      @tarojs/plugin-uglifyjs: 1.3.20 => 1.3.20 
      @tarojs/router: 1.3.20 => 1.3.20 
      @tarojs/taro: 1.3.20 => 1.3.20 
      @tarojs/taro-alipay: 1.3.20 => 1.3.20 
      @tarojs/taro-h5: 1.3.20 => 1.3.20 
      @tarojs/taro-qq: 1.3.20 => 1.3.20 
      @tarojs/taro-quickapp: 1.3.20 => 1.3.20 
      @tarojs/taro-swan: 1.3.20 => 1.3.20 
      @tarojs/taro-tt: 1.3.20 => 1.3.20 
      @tarojs/taro-weapp: 1.3.20 => 1.3.20 
      @tarojs/webpack-runner: 1.3.20 => 1.3.20 
      eslint-config-taro: 1.3.20 => 1.3.20 
      eslint-plugin-taro: 1.3.20 => 1.3.20 
      nerv-devtools: ^1.5.0 => 1.5.1 
      nervjs: ^1.5.0 => 1.5.1 
      stylelint-config-taro-rn: 1.3.20 => 1.3.20 
      stylelint-taro-rn: 1.3.20 => 1.3.20 

补充信息
[可选]
[根据你的调查研究,出现这个问题的原因可能在哪里?]

@taro-bot
Copy link

taro-bot bot commented Oct 20, 2019

欢迎提交 Issue~

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

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

Good luck and happy coding~

@Garfield550
Copy link
Collaborator

typescript-estree 这个包不支持更高的 TypeScript 版本,它是 typescript-eslint 的依赖,不是 Taro 本身的原因。

之后会考虑升级 typescript-eslint。

@chenyulun
Copy link
Author

@Garfield550 我可以自己升级是吗?现在
@typescript-eslint/parser最新是2.4.0
typescript最新是3.6.4
我自己升级有什么影响吗

@chenyulun
Copy link
Author

chenyulun commented Oct 20, 2019

那现在卡住不应该吧?要不结束,要不继续执行

➜  tarotest git:(master) ✗ taro doctor
👽 Taro v1.3.20

⠋ 正在诊断项目...=============

WARNING: You are currently running a version of TypeScript which is not officially supported by typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.2.1 <3.6.0

YOUR TYPESCRIPT VERSION: 3.6.4

Please only submit bug reports when using the officially supported version.

=============
⠴ 正在诊断项目...^C%
➜  tarotest git:(master) ✗ ./node_modules/.bin/tsc -v
Version 3.6.4
➜  tarotest git:(master) ✗ tsc -v                    
Version 3.3.3
➜  tarotest git:(master) ✗ 

我发现我全局的版本3.3.3,本地的是3.6.4
请看:yarn.lock

typescript@^3.0.1:
  version "3.6.4"
  resolved "https://registry.npm.taobao.org/typescript/download/typescript-3.6.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftypescript%2Fdownload%2Ftypescript-3.6.4.tgz#b18752bb3792bc1a0281335f7f6ebf1bbfc5b91d"
  integrity sha1-sYdSuzeSvBoCgTNff26/G7/FuR0=

修复了这个问题了,
但是还是卡,新建的项目,什么都没改过的,taro doctor半天没反应

➜  tarotest git:(master) ✗ taro doctor
👽 Taro v1.3.20

⠴ 正在诊断项目...

@chenyulun
Copy link
Author

每个页面的config怎么取消检查

➜  tarotest git:(master) ✗ taro update project
👽 Taro v1.3.20

更新项目 package.json 成功!

yarn install v1.19.1

[1/4] Resolving packages...

[2/4] Fetching packages...

[3/4] Linking dependencies...

[4/4] Building fresh packages...

success Saved lockfile.

Done in 38.36s.

➜  tarotest git:(master) ✗ taro doctor        
👽 Taro v1.3.20

✔ 诊断完成

检查 Taro 配置 (/Users/chenyulun390/learn/tarotest/config/index.js)
  [✓] 没有发现问题

检查依赖
  [✓] 没有发现问题

检查推荐内容
  [!] 没有检查到常见的测试依赖(jest/mocha/ava/tape/jesmine/karma), 配置测试可以帮助提升项目质量
      可以参考 https://github.com/NervJS/taro-ui-sample 项目, 其中已经包含了完整的测试配置与范例
  [!] 没有检查到 Readme (readme/readme.md/readme.markdown), 编写 Readme 可以方便其他人了解项目

检查 ESLint (以下为 ESLint 的输出)

/Users/chenyulun390/learn/tarotest/src/app.tsx
   1:27  error    'Config' is defined but never used. Allowed unused vars must match /Taro/u  no-unused-vars
  21:3   warning  config should be placed after componentDidMount                             react/sort-comp

/Users/chenyulun390/learn/tarotest/src/pages/index/index.tsx
   1:27  error    'Config' is defined but never used. Allowed unused vars must match /Taro/u  no-unused-vars
  14:3   warning  config should be placed after componentWillUnmount                          react/sort-comp

✖ 4 problems (2 errors, 2 warnings)

@Garfield550
Copy link
Collaborator

每个页面的config怎么取消检查

➜  tarotest git:(master) ✗ taro update project
👽 Taro v1.3.20

更新项目 package.json 成功!

yarn install v1.19.1

[1/4] Resolving packages...

[2/4] Fetching packages...

[3/4] Linking dependencies...

[4/4] Building fresh packages...

success Saved lockfile.

Done in 38.36s.

➜  tarotest git:(master) ✗ taro doctor        
👽 Taro v1.3.20

✔ 诊断完成

检查 Taro 配置 (/Users/chenyulun390/learn/tarotest/config/index.js)
  [✓] 没有发现问题

检查依赖
  [✓] 没有发现问题

检查推荐内容
  [!] 没有检查到常见的测试依赖(jest/mocha/ava/tape/jesmine/karma), 配置测试可以帮助提升项目质量
      可以参考 https://github.com/NervJS/taro-ui-sample 项目, 其中已经包含了完整的测试配置与范例
  [!] 没有检查到 Readme (readme/readme.md/readme.markdown), 编写 Readme 可以方便其他人了解项目

检查 ESLint (以下为 ESLint 的输出)

/Users/chenyulun390/learn/tarotest/src/app.tsx
   1:27  error    'Config' is defined but never used. Allowed unused vars must match /Taro/u  no-unused-vars
  21:3   warning  config should be placed after componentDidMount                             react/sort-comp

/Users/chenyulun390/learn/tarotest/src/pages/index/index.tsx
   1:27  error    'Config' is defined but never used. Allowed unused vars must match /Taro/u  no-unused-vars
  14:3   warning  config should be placed after componentWillUnmount                          react/sort-comp

✖ 4 problems (2 errors, 2 warnings)

添加 ESLint 排除规则。

@owen26
Copy link

owen26 commented Oct 23, 2019

我就奇怪为什么eslint会对Config未使用报错

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

3 participants