lint-stage 无法看到文件

问题描述 投票:0回答:2

我的项目结构如下:

project
- .husky
- src
-- all files
- package.json

这是我

lint-staged
来自
package.json

  "lint-staged": "^12.1.7",
  .
  .
  .
  "lint-staged": {
    "*.{js,ts,tsx}": [
      "npm run prettier",
      "npm run lint:fix"
    ]
  },

有人可以告诉我我有什么问题吗

yarn lint-staged
启动此命令后他总是返回给我:

→ No staged files match any configured task.

感谢您的帮助!

PS。我正在从预推哈士奇脚本运行此命令

javascript reactjs typescript lint
2个回答
1
投票

跑步前

git add .
你跑步过吗
yarn lint-staged


0
投票

这里

"*/*.{js,ts,tsx}"
应该是
"**/*.{js,ts,tsx}"
并有 2 颗星。因此,它将在您所有的存储库中查找

© www.soinside.com 2019 - 2024. All rights reserved.