matype / stylefmt

stylefmt is a tool that automatically formats stylesheets.
Other
2.1k stars 89 forks source link

Incorrect Quotation in SCSS @functions #342

Open a-coox opened 5 years ago

a-coox commented 5 years ago

Environment Visual Studio Code 1.28.1

Actual Behavior string-quotes: single is set in my stylelintrc file. Most code is auto-formatted correctly, except for in SCSS functions, where @warn, @error, and @debug directives are formatted to double quotes. This then logs as an error with stylelint.

Expected Behavior Formatting with stylefmt should consistently change this code to single quotes.

Steps to Reproduce

  1. Create a new project with the following .stylelintrc file: { "rules": { "string-quotes": "single" } }

  2. Add the following scss file to the project: @function temp() { @warn 'This is a warning'; @error 'This is an error'; }

  3. Trigger a stylefmt format, either through format on save or right click > format. This will format into the following: @function temp() { @warn "This is a warning"; @error "This is an error"; }

Thanks for your help!

ronilaukkarinen commented 3 years ago

Hey @Belgiumese, this has been fixed in my active fork. Also feel free to use my version of vscode-stylefmt. 👍