-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
cli使用ts生成的模板报错 #5207
Comments
欢迎提交 Issue~ 如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏 如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。 Good luck and happy coding~ |
报错应该不是这个文件吧。 |
|
可以的。 |
Taro CLI 1.3.25 可以升级啦。升级到最新版本。1.3.25是有一些小问题的。 @HerbertHe |
CC @luckyadam |
同样的问题。 我个人是在 .eslintrc 里边直接 "no-unused-vars":0 全禁止了,一了百了。。 |
@shenghanqin 升级1.3.29这个问题还是存在 |
好像是 |
This reverts commit ed6f261. 添加 @typescript-eslint/eslint-plugin 并更新 eslintrc 解决
@Garfield550 [taro-v2.0.1] 也存在同样的问题,手动添加
|
按照文中方式 还是不管用 2:8 warning 'Taro' is defined but never used @typescript-eslint/no-unused-vars
� Taro v2.0.4
Taro CLI 2.0.4 environment info:
System:
OS: Windows 10
Binaries:
Node: 10.16.3 - D:\Program Files\nodejs\node.EXE
Yarn: E:\code\challenge>"node" "C:\Users\Administrator\AppData\Roaming\npm\\node_modules\yarn\bin\yarn.js" -v
1.19.1 - C:\Users\Administrator\AppData\Roaming\npm\yarn.CMD
npm: 6.9.0 - D:\Program Files\nodejs\npm.CMD 配置文件 {
"extends": [
"taro",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"rules": {
"no-unused-vars": ["error", { "varsIgnorePattern": "Taro" }],
"react/jsx-filename-extension": [
1,
{
"extensions": [
".js",
".jsx",
".tsx"
]
}
],
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/no-empty-function": [
"error"
]
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"useJSXTextNode": true,
"project": "./tsconfig.json"
}
} ================更新==================
|
改下配置文件就行 "no-unused-vars": ["error", { "varsIgnorePattern": "[Taro|Config]" }] |
This reverts commit ed6f261. 添加 @typescript-eslint/eslint-plugin 并更新 eslintrc 解决
问题描述
使用taro init 生成ts工程检查报错
复现步骤
期望行为
控制台无问题输出
报错信息
'Config' is defined but never used. Allowed unused vars must match /Taro/.
系统信息
Taro CLI 1.3.25 environment info:
System:
OS: Windows 10
Binaries:
Node: 12.13.0 - D:\nodejs\node.EXE
Yarn: 1.19.1 - C:\Users\Herbert\AppData\Roaming\npm\yarn.CMD
npm: 6.12.0 - D:\nodejs\npm.CMD
补充信息
刚生成的工程文件中Config的位置不对警告,可以改到生命周期的下面解决
The text was updated successfully, but these errors were encountered: