Action

搜索Actions选择Fix ESLint Problems(Cmd-Shift-A on OS X or Ctrl+Shift+A on Windows and Linux):

Fix ESLint Problems

File Watchers

保存文件时自动eslint --fix:

IntelliJ IDEA eslint --fix

保存文件时自动prettier --write

IntelliJ IDEA prettier --write<

适用于IntelliJ IDEA/PHPStorm/WebStorm

参考链接:

  • https://www.jetbrains.com/help/webstorm/using-file-watchers.html
  • https://blog.jetbrains.com/webstorm/2016/08/using-external-tools/