Fixes all eslint on save
Lumin

Lumin @ilumin

Location:
Bangkok, Thailand
Joined:
Jan 25, 2018

Fixes all eslint on save

Publish Date: May 19 '22
10 1

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!

Comments 1 total

  • yyhsz
    yyhszOct 18, 2023

    It works! thx!

Add comment