amis icon indicating copy to clipboard operation
amis copied to clipboard

git推送时候 npx stylelint 'packages/**/*.scss' 总报错

Open lhtuling opened this issue 3 years ago • 8 comments

image 提示错误

> stylelint
> npx stylelint 'packages/**/*.scss'

Error: No files matching the pattern "'packages/**/*.scss'" were found.
    at standalone (....\node_modules\stylelint\lib\standalone.js:260:43)
husky - pre-commit hook exited with code 1 (error)

去了这一行 又提示新的错误

npm ERR! Missing script: "stylelint"
npm ERR! 
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in:
npm ERR!    2023-09-25T08_45_04_092Z-debug-0.log
husky - pre-commit hook exited with code 1 (error)



lhtuling avatar Sep 25 '23 08:09 lhtuling

👍 Thanks for this! 🏷 I have applied any labels matching special text in your issue.

Please review the labels and make any necessary changes.

github-actions[bot] avatar Sep 25 '23 08:09 github-actions[bot]

git提交的时候,会通过husky/pre-commit触发 npm run stylelint,这个只是对当前项目中的样式进行一次格式化,我们这边都是能正常执行的。 怀疑可能是node_modules中的模块安装的有问题,可以试下重装下(删掉当前node_modules目录,重新执行下:npm install),然后再执行这个命令试试:npm run stylelint。

wibetter avatar Sep 25 '23 09:09 wibetter

不行 报一样的错误! 重新安装了几次了 image

git提交的时候,会通过husky/pre-commit触发 npm run stylelint,这个只是对当前项目中的样式进行一次格式化,我们这边都是能正常执行的。 怀疑可能是node_modules中的模块安装的有问题,可以试下重装下(删掉当前node_modules目录,重新执行下:npm install),然后再执行这个命令试试:npm run stylelint。

lhtuling avatar Sep 25 '23 11:09 lhtuling

是不是stylelint版本问题? 只要npm安装后 就会有这个问题 没装过之前修改文件提交没问题 奇怪 就这两天开始 提交不了代码太烦人了

lhtuling avatar Sep 25 '23 12:09 lhtuling

image 好吧 删了这个文件夹就行了。。。先这样吧 感觉也没啥影响吧

lhtuling avatar Sep 25 '23 12:09 lhtuling

@lhtuling 这个是为了在commit的时候自动触发样式代码格式化,如果只是本地使用的话,可以删掉。

wibetter avatar Sep 26 '23 10:09 wibetter

嗯 先这样吧 应该是我这边有啥问题 删了正常了 影响不大

lhtuling avatar Sep 29 '23 03:09 lhtuling

package.json "stylelint": "npx stylelint 'packages/**/*.scss'", 改为 "stylelint": "npx stylelint \"packages/**/*.scss\"",

thetime50 avatar May 07 '24 07:05 thetime50