I would like to run a custom formatter while I save in VSCode.
I want to force attibutes orderning in CSS, so I installed postcssSorting and configured it. It works when I manually run the command postcssSorting.execute
But now I want it to autorun when the user saves a SCSS or CSS document. And that is here I run into problems.
Most extentions I see run Commandline lines (tried save-runner), or run it AFTER the save (tried RunOnSave). So I'm stuck both ways because its not a command line line that I need, or it modifies the file after the save so I'm stuck that the file needs to be saved twice so the formatting is placed (and the file will always be in an 'unsaved' state).
So is there a way to hook into the VSCode formatter to say 'hey run this one too before saving' or do the equivalent?
question from:
https://stackoverflow.com/questions/66067637/running-custom-formatter-before-save-in-vscode 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…