skip to Main Content

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


  1. Chosen as BEST ANSWER

    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.


  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search