我正在尝试在PHPStorm中创建一个自定义文件监视器,它将在保存时自动修复ESLint错误.在“设置”中工具>文件监视器我使用以下设置创建了一个新的文件监视器:
>文件类型:任何
>范围:所有地方
>程序:/home/user/Projects/todo-app/eslint-autofix.sh
>参数:空白
>要刷新的输出路径:空白
>其他选项>工作目录:/ home / user / Projects / todo-app
eslint-autofix.sh:
#!/usr/bin/env bash ./node_modules/.bin/eslint --fix
然后我发出ESLint错误并按下Ctrl S保存.弹出以下错误:
/home/user/Projects/todo-app/eslint-autofix.sh /usr/bin/env: ‘node’: No such file or directory