Difference between codeActionsOnSave and formatOnSave in VS Code
I'm trying to get my VS Code to run ESLint and Prettier together properly as well.
Then VSCode 1.44 (March 2020) would highlight another difference between codeActionsOnSave
and formatOnSave
:
Explicit ordering for editor.codeActionsOnSave
You can now set
editor.codeActionsOnSave
to an array of code actions to execute in order. You can use this to guarantee that a specific code action is always run before or after another one that may conflict with itThe following
editor.codeActionsOnSave
will always runOrganize Imports
followed byFix All
once organize imports finishes:
"editor.codeActionsOnSave": [ "source.organizeImports", "source.fixAll"]