question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

eslint.autoFixOnSave does not trigger consistently

See original GitHub issue

Hi 👋

First of all, thanks a lot for your work, this plugin is amazing and I use it everyday !

Unfortunately, sometimes (as described in eslint.autoFixOnSave doesn’t always fire on save #283) eslint shows all file errors correctly but does not trigger the file fixes on save when the setting is correctly set in vscode settings (either in User or Workspace settings).

As asked in #283 I set the setting eslint.server.trace to “messages” and observed that when the plugin does not work as expected this lines are not shown in the trace logs:

[Trace - 3:46:33 PM] Sending request 'textDocument/willSaveWaitUntil - (2)'.
[Trace - 3:46:33 PM] Received response 'textDocument/willSaveWaitUntil - (2)' in 110ms.

They are outputted just before textDocument/didSave in the normal situation, but not when the plugin does not fixe on save.

Also, Reload Window solves the issue temporarily, until it breaks again.

PS: I’m sorry because I just reload before sending this issue, so I don’t have the trace logs when it does not work. I’m add them in a following comment.

Thanks in advance for your time !

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:19
  • Comments:75 (20 by maintainers)

github_iconTop GitHub Comments

29reactions
ghostcommented, Feb 21, 2019

Happens to me all the time as well. It will work for a short while, then suddenly just stop working. My workaround is to restart vscode.

18reactions
verbumfeitcommented, Sep 7, 2019

After removing this editor.defaultFormatter - autofix works like a charm, and willSaveWaitUntil is showing in output.

I discovered it works with editor.defaultFormatter, you just have to add

"eslint.validate": [
  { "language": "typescript", "autoFix": true },
  { "language": "typescriptreact" , "autoFix": true} // If you use React
]

So the combination of autoFixOnSave and autoFix works, don’t know why though.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ESLint in VSCode not fixing on save - Stack Overflow
When I save I would like my ESLint to run automatically and fix all the warnings for me automatically. This is my settings.json...
Read more >
How To Enable Linting on Save with Visual Studio Code and ...
Trying to manually run ESLint: Fix all auto-fixable Problems periodically is not very reliable. However, having lint rules run every time you ...
Read more >
coc-eslint - Vim Awesome
You can apply the quick fix by either: Set eslint.autoFixOnSave to true and save your file (recommended). Trigger <Plug>(coc-codeaction) with mapped keys, ...
Read more >
How to run ESLINT on save (VS Code) - YouTube
Daily Webdev Newsletter: https://www.penta-code.com/news$100 DigitalOcean hosting coupon: https://m. do.co/c/dba93b1bbe11Discord: ...
Read more >
ESLint - Open VSX Registry
no modal dialog is shown when the ESLint extension tries to load an ESLint ... The migration can always be triggered manually using...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Hashnode Post

No results found