I've become used to using the default vscode.typescript-language-features as my JS formatter. However, the organisation I work for use eslint as a formatter. Ideally I'd like to not override my global formatter.
The dbaeumer.vscode-eslint extension offers a fantastic solution, on paper:
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
This will effectively resolve any formatting conflicts with the built-in formatter by fixing the linting errors when I save in projects that use eslint. Problem is, I also like to use editor.formatOnSave. I believe this actually runs after editor.codeActionsOnSave which results in eslint's tweaks being instantly reverted. The order editor.codeActionsOnSave executes can indeed be customised by setting it as an array instead of as an object, however editor.formatOnSave is its own bespoke setting, and seems to always execute after editor.codeActionsOnSave.
To summarise, I want to be able to set editor.codeActionsOnSave to execute before editor.formatOnSave. Potential solutions could be:
- A setting like
editor.formatOnSaveAfterCodeActionsOnSave, true by default
- The ability to add
editor.formatOnSave to the codeActionsOnSave array
Thanks :)
I've become used to using the default
vscode.typescript-language-featuresas my JS formatter. However, the organisation I work for use eslint as a formatter. Ideally I'd like to not override my global formatter.The
dbaeumer.vscode-eslintextension offers a fantastic solution, on paper:This will effectively resolve any formatting conflicts with the built-in formatter by fixing the linting errors when I save in projects that use eslint. Problem is, I also like to use
editor.formatOnSave. I believe this actually runs aftereditor.codeActionsOnSavewhich results in eslint's tweaks being instantly reverted. The ordereditor.codeActionsOnSaveexecutes can indeed be customised by setting it as an array instead of as an object, howevereditor.formatOnSaveis its own bespoke setting, and seems to always execute aftereditor.codeActionsOnSave.To summarise, I want to be able to set
editor.codeActionsOnSaveto execute beforeeditor.formatOnSave. Potential solutions could be:editor.formatOnSaveAfterCodeActionsOnSave, true by defaulteditor.formatOnSaveto thecodeActionsOnSavearrayThanks :)