【问题标题】:Eslint "No files matching the pattern "lint" were found. Please check for typing mistakes in the pattern." errorEslint“没有找到匹配模式“lint”的文件。请检查模式中的输入错误。”错误
【发布时间】:2020-06-06 06:39:30
【问题描述】:

最近我将我的项目 eslint 包更新为"eslint": "^6.8.0"。这是我看到错误的时候

Oops! Something went wrong! :(

ESLint: 6.8.0.

No files matching the pattern "lint" were found.
Please check for typing mistakes in the pattern.

我的包 JSON 脚本如下所示:

"lint": "eslint lint --color src -f ./node_modules/eslint-friendly-formatter src/ tests/unit/__mocks__/ --ext .json --ext .js -c .eslintrc.js",

我不确定这个脚本有什么问题,旧版本的 eslint 运行良好。

在论坛中寻找解决方案时,建议添加一个标志 --no-error-on-unmatched-pattern。我不确定为什么需要将此标志添加到我的脚本中。 任何帮助表示赞赏!

【问题讨论】:

  • 以前的版本是什么?
  • @A.Ametov 这是我正在使用的版本"eslint": "^3.19.0",

标签: javascript eslint package.json


【解决方案1】:

我猜人们在版本 5 上也遇到过这个问题。请参阅这个问题

https://github.com/eslint/eslint/issues/10587

--no-error-on-unmatched-pattern 被添加以忽略此类问题。

【讨论】:

  • eslint-summary-formatter 也有这个问题,--sort-by 不起作用,因为它被视为文件模式,因此修复:npx eslint -f summary --no-error-on-unmatched-pattern file.js -- --sort-by rule
猜你喜欢
  • 2021-01-12
  • 1970-01-01
  • 1970-01-01
  • 2020-08-05
  • 1970-01-01
  • 2016-09-03
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多