DEV Community

Teerasak Vichadee
Teerasak Vichadee

Posted on

Fixes all eslint on save

I HATE fixing these little ESLint errors and warnings (for example import order). I could ignore or disable it but my colleague going to yell at me.

I'm too lazy to do that kind of stuff (well, ESLint already knows what, where, and how to solve it), good for me VSCode can do it for me with these settings :D

Just open and edit ~/Library/Application\ Support/Code/User/settings.json (in MacOS) by adding editor.codeActionsOnSave.

My final settings will look like these

  // ... other settings
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true,
    "source.fixAll.tslint": true
Enter fullscreen mode Exit fullscreen mode

Every time I made some little mistake that ESLint knows how to solve. When the file is saved, ESLint will fix it for me.

All sorted!

Top comments (1)

yyhsz profile image

It works! thx!