Skip to content

Instantly share code, notes, and snippets.

@Jayphen
Last active March 12, 2019 12:40
Show Gist options
  • Save Jayphen/77fa13e60305ce6a830c9bed79b00ff9 to your computer and use it in GitHub Desktop.
Save Jayphen/77fa13e60305ce6a830c9bed79b00ff9 to your computer and use it in GitHub Desktop.
ESlint/autosave VSCode settings
{
"prettier.eslintIntegration": true,
"editor.formatOnSave": true,
"eslint.enable": true,
"eslint.validate": [
"javascript",
"javascriptreact",
{ "language": "typescript", "autoFix": true },
{ "language": "typescriptreact", "autoFix": true }
],
}
@Jayphen
Copy link
Author

Jayphen commented Mar 12, 2019

I have removed autofix on save on Dan's recommendation, but if you want fixable eslint warnings to be fixed on save, add this:

  "[javascript]": {
    "editor.formatOnSave": false
  },
  "[javascriptreact]": {
    "editor.formatOnSave": false
  },
  "[typescript]": {
    "editor.formatOnSave": false
  },
  "[typescriptreact]": {
    "editor.formatOnSave": false
  },
  "eslint.autoFixOnSave": true,

It's probably better to manually fix errors so that you learn from them, rather than having them magically fixed for you.

The "autoFix": true for TS in the eslint.validate rules is still necessary in order to get the little lightbulb to show up in VSCode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment