Jac*_*Dev 33 continuous-integration eslint
在我的 CI 设置中,我有一个针对所有 JS 文件运行 eslint 的测试。如果不存在 JS 文件,则当前正在抛出错误。我更喜欢它是否在不存在 JS 文件时成功。这可能吗?
$ eslint "./src/assets/scripts/**/*.js"
Oops! Something went wrong! :(
ESLint: 5.7.0.
No files matching the pattern "./src/assets/scripts/**/*.js" were found.
Please check for typing mistakes in the pattern.
ERROR: Job failed: exit code 1
Run Code Online (Sandbox Code Playgroud)
小智 45
该--no-error-on-unmatched-pattern标志是在v6.8.0ESLint中添加的。
https://eslint.org/docs/user-guide/command-line-interface#no-error-on-unmatched-pattern
Seb*_*ráč 24
对我有用的是 changing single quotes to escaped double quotes
所以从:
"lint": "eslint '**/*.{ts,tsx}'"
Run Code Online (Sandbox Code Playgroud)
到:
"lint": "eslint \"**/*.{ts,tsx}\""
Run Code Online (Sandbox Code Playgroud)
原因是因为它取决于您使用的控制台 - 可能是操作系统(这就是为什么它可以为您工作,而对其他人不起作用,反之亦然)来源:https : //dev.to/gruckion/comment/b65c
我有同样的错误
未找到与模式“.ts”匹配的文件
我刚刚删除了.js, .ts, .tsx配置中类型之间的空格,它就可以工作了。
从:
"lint": "eslint --ignore-path .gitignore --ext .js, .ts, .tsx .",
Run Code Online (Sandbox Code Playgroud)
到
"lint": "eslint --ignore-path .gitignore --ext .js,.ts,.tsx .",
Run Code Online (Sandbox Code Playgroud)
就我而言,我必须从
"lint": "eslint \"**/*.{ts, tsx}\""
Run Code Online (Sandbox Code Playgroud)
到
"lint": "eslint \"**/*.{ts,tsx}\""
Run Code Online (Sandbox Code Playgroud)
ts这实际上是& tsx/ js&之间的空格jsx
| 归档时间: |
|
| 查看次数: |
29836 次 |
| 最近记录: |