小编Zyn*_*cho的帖子

lint-staged 自定义配置 > 错误命令失败,退出代码为 1

我正在关注从其github README打包的 lint-staged 自定义配置文件 (lint-staged.config.js) 的第一个示例(复制/粘贴) ,但没有成功。我error Command failed with exit code 1.总是得到。

我试过这个...

我尝试了三件事,对于每种情况,我都将其lint-staged.config.js放在根目录中。

  1. package.json:结果是error Command failed with exit code 1.
"lint-staged": {
        "packages/**/*.{ts,tsx}": [
            "yarn lint-staged --config ./lint-staged.config.js"
        ]
    },
Run Code Online (Sandbox Code Playgroud)
  1. 哈士奇/预提交:结果是error Command failed with exit code 1.
npx lint-staged --config ../lint-staged.config.js
Run Code Online (Sandbox Code Playgroud)
  1. cmd 行:结果是error Command failed with exit code 1.
yarn lint-staged --config lint-staged.config.js
Run Code Online (Sandbox Code Playgroud)

问题

我只是在寻找运行自定义配置文件。

问题是执行失败,错误消息与命令相关,但命令本身正确为lint-staged [options](yarn/npx lint-staged -h),然后提供一个自定义配置文件,但它lint-staged [--config [path]]失败了(我什至提供路径的各种引号)。

eslint next.js husky lint-staged

5
推荐指数
1
解决办法
3557
查看次数

标签 统计

eslint ×1

husky ×1

lint-staged ×1

next.js ×1