It turns out this was due to a seemingly-unrelated formatter:

JS-CSS-HTML Formatter

I'd forgotten I had this installed (I have about 100 extensions). Sadly, this doesn't mention SCSS or SASS anywhere in its profile. But it does mention it in a changelog update in 2016. Silly me.

I've uninstalled this extension and that's stopped the annoying formatting. I'm sure it's good at it's job, but it isn't obvious that it's doing anything and this made the problem really hard to find.

It did make me have a much-needed clean-out of my extensions, though.

Answer from Astravagrant on Stack Overflow
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
SCSS Formatter - Visual Studio Marketplace
Extension for Visual Studio Code - A Visual Studio Code Extension to format SCSS
Discussions

Setting up auto-compile SCSS on save?
The point is, this should not handled as an editor process. Because as you've just discovered, integrating the dev env is all well and good, until: You change editors. A dev with a different editor tries to access it Separate out your build pipeline from your editor. My recommendation would be Vite, which does support sass and will also handle everything else (e.g. live reload with HMR, etc). More on reddit.com
🌐 r/vscode
3
0
June 10, 2022
Add support for stylelint as SCSS formatter
What problem does this feature solve? It would be cool, if the stylelint extension could be enabled as formatter for SCSS files just like it's possible to enable it for validation. I gave it a ... More on github.com
🌐 github.com
5
March 5, 2022
VSCode Format on save breaks app.css
Background I am using VSCode to do my Phoenix app, however, when modifying the app.css I realized the formatting was literally breaking my code. Specifically, “Format on Save”: As you can see, hover:ring-gray becomes hover: ring-gray, which is invalid and breaks the file. More on elixirforum.com
🌐 elixirforum.com
1
1
June 1, 2023
visual studio code - How to Edit Auto-Formatting Rules for CSS/SCSS/LESS using Prettier in VSCode? - Stack Overflow
I'm using Prettier - Code formatter extension for VSCode to auto-format my code on save. I'm used to writing single-line blocks in my sass files (where there's only a single property) i.e. ... Problem is the Prettier extension formats it to multi-lines i.e. ... It seems prettier uses stylelint for css/scss ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
Visual Studio Code
code.visualstudio.com › docs › languages › css
CSS, SCSS and Less
November 3, 2021 - You can read more about using custom data in the vscode-custom-data repository. The CSS Languages Features extension also provides a formatter. The formatter works with CSS, LESS and SCSS.
🌐
Reddit
reddit.com › r/vscode › setting up auto-compile scss on save?
r/vscode on Reddit: Setting up auto-compile SCSS on save?
June 10, 2022 -

I am needing to setup a workflow for VS coming from Sublime.

In Sublime I have an extension installed that automatically compiles the CSS file upon each save. When I set it up I simply installed and it worked just fine the first time.

What is the process in VS? I have tried a couple extensions from the marketplace... but on save nothing happens. Looking at the different authors docs it seems like they should work, as the flags and switches offered seem to target fringe cases (there is no additional information otherwise).

What is the simplest tool to install?

Thanks

🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-format-code-with-prettier-in-visual-studio-code
Format Code with Prettier in Visual Studio Code: Setup Guide | DigitalOcean
August 1, 2025 - Prettier Can Be Run Manually or Automatically on Save: With the Format Document command or by enabling Format On Save, you can ensure that your code is always formatted cleanly with minimal effort. You Can Customize Prettier to Match Your Preferences: Settings such as quote style, semicolon usage, tab width, and more can be adjusted in the VS Code UI or through a .prettierrc configuration file. Team Projects Benefit from Shared Configuration: Using .prettierrc, .prettierignore, and workspace-level .vscode/settings.json files ensures consistency across all contributors in a shared codebase.
🌐
GitHub
github.com › stylelint › vscode-stylelint › issues › 384
Add support for stylelint as SCSS formatter · Issue #384 · stylelint/vscode-stylelint
March 5, 2022 - You switched accounts on another tab or window. Reload to refresh your session. ... There was an error while loading. Please reload this page. ... It would be cool, if the stylelint extension could be enabled as formatter for SCSS files just like it's possible to enable it for validation. I gave it a shot but I wasn't very surprised it didn't work. { "[scss]": { "editor.defaultFormatter": "stylelint.vscode-stylelint" } }
Author   wedi
Find elsewhere
🌐
GitHub
github.com › sibiraj-s › vscode-scss-formatter
GitHub - sibiraj-s/vscode-scss-formatter: A Visual Studio Code Extension to format SCSS files · GitHub
code --install-extension sibiraj-s.vscode-scss-formatter · Files can be formatted by the Format Document option available in the context menu, by using the associated Keyboard Shortcut or running the Format Document command from the command pallete
Starred by 13 users
Forked by 3 users
Languages   TypeScript 49.7% | SCSS 30.6% | JavaScript 16.7% | CSS 3.0%
🌐
Reddit
reddit.com › r/vscode › how do you disable sass formatting on save?
r/vscode on Reddit: How do you disable SASS formatting on save?
December 12, 2017 -

I've editor.formatOnSave=true but still get newlines and comments being shifted around on save. Tried to disable it in the scss specific settings as well without much luck:

"[scss]": {
    "editor.formatOnSave": false,
    "editor.formatOnType": false
}

Is there a way I can know the functions/extensions hooked to a certain event?

🌐
Medium
medium.com › @codingcarter › how-to-compile-scss-code-in-visual-studio-code-c8406fe54a18
How to Compile SCSS Code in Visual Studio Code | by Coding Carter | Medium
January 24, 2020 - Hello, world and in this tutorial I will be showing you how to compile your SCSS code into CSS using a Visual Studio Code Extension in real time! After you save the .scss file, it will automatically generate the .css file for you! The extension was made by Ritwick Dey, a developer with over 4.3 million downloads on his various extensions on the Visual Studio Marketplace.
🌐
Ritwick Dey
ritwickdey.github.io › vscode-live-sass-compiler › docs › settings.html
Settings | Live Sass Compiler | VSCode Extension
{ "format": "expanded", "extensionName": ".css", "savePath": null }, // You can add more { "format": "compressed", "extensionName": ".min.css", "savePath": "/dist/css" }, // More Complex { "format": "compressed", "extensionName": ".min.css", "savePath": "~/../css/" } ] liveSassCompile.settings.excludeList: To Exclude specific folders. All Sass/Scss files inside the folders will be ignored.
🌐
GitHub
github.com › prettier › prettier-vscode › issues › 117
Prettier doesn't format *.css and *.scss files. · Issue #117 · prettier/prettier-vscode
You switched accounts on another tab or window. Reload to refresh your session. ... There was an error while loading. Please reload this page. ... "prettier.eslintIntegration": true, "prettier.singleQuote": true, "prettier.printWidth": 80, "prettier.trailingComma": "all", "prettier.cssEnable": [ "css", "less", "sass" ], But there is no "Format document" option in the content menu in vscode for *.css and *.scss ...
Author   ghost
🌐
GitHub
github.com › microsoft › vscode › issues › 28836
Format Document doesn't work in CSS, SCSS and LESS files · Issue #28836 · microsoft/vscode
May 22, 2017 - You switched accounts on another tab or window. Reload to refresh your session. ... *as-designedDescribed behavior is as designedDescribed behavior is as designedcss-less-scssIssues and items concerning CSS,Less,SCSS stylingIssues and items concerning CSS,Less,SCSS styling ... Format Document (Alt+Shift+F) command doesn't work in .css, .scss and .less files.
Author   Deilan
🌐
You.com
codegrepper.com › code-examples › delphi › vscode+prettier+scss+on+save+not+working
You.com | AI Search Infrastructure for Enterprise Teams
February 2, 2021 - Stay ahead with real-time data ingestion and enrichment, ensuring your vertical models never operate on outdated information.