when I am using Vscode coding my Vue project, everytime I saved code, then Vscode deleted my css code. I don’t know where it can be set so that it do not delete my code.
I woted css code like this: display: -webkit-box
after I saved code, the code is changed to display: box
.
2
Answers
The reason for this question is that I am using Stylelint in my project. I have set up code formatting to occur automatically when I save the file. Therefore, if you want to prevent the code from being changed when you save it, you can add the comment // stylelint-disable-next-line above the line you don't want to change.
This behaviour was due to usage of Stylelint. The asker worked around it by using
// stylelint-disable-next-line
to disable linting for that particular line. See also https://github.com/stylelint/vscode-stylelint?tab=readme-ov-file#editorcodeactionsonsave and https://stylelint.io/user-guide/configure.