我正在关注从其github README打包的 lint-staged 自定义配置文件 (lint-staged.config.js) 的第一个示例(复制/粘贴) ,但没有成功。我error Command failed with exit code 1.总是得到。
我尝试了三件事,对于每种情况,我都将其lint-staged.config.js放在根目录中。
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)
error Command failed with exit code 1.npx lint-staged --config ../lint-staged.config.js
Run Code Online (Sandbox Code Playgroud)
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]]失败了(我什至提供路径的各种引号)。