Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unwanted and incorrect scss formatting from vs code #146534

Closed
talamaska opened this issue Apr 1, 2022 · 7 comments
Closed

Unwanted and incorrect scss formatting from vs code #146534

talamaska opened this issue Apr 1, 2022 · 7 comments
Assignees

Comments

@talamaska
Copy link

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.66..0
  • OS Version: Windows 10

Steps to Reproduce:

  1. Create an sccs file which has @use 'variables' as *;
  2. save
  3. the space before keyword 'as' is removed

No setting to turn that off. No idea why this is on.
I have to turn off the whole vs code scss formatter in order to avoid that incorrect removal of this space.
"scss.format.enable": false,

@JarrodMFlesch
Copy link

JarrodMFlesch commented Apr 4, 2022

Can confirm issue 👍

@aeschli
Copy link
Contributor

aeschli commented Apr 4, 2022

We use beautifyjs as the underlying formatter. Would you mind filing this request directly against https://github.com/beautify-web/js-beautify ?

@aeschli aeschli closed this as completed Apr 4, 2022
@JarrodMFlesch
Copy link

JarrodMFlesch commented Apr 4, 2022

Looks like its logged here already for anyone that encounters this.

@talamaska
Copy link
Author

@aeschli 1st of The bug mentioned is already 4 months, second VS Code should expose a setting to turn off this rule. Since the bug in js-beautify is not fixed, no option in vs code config and altogether the feature to format css and scss was added premature, since the @use syntax is a defacto a standard. Please reopen to track the addition of a setting to turn off the rule that is to be added some day and don't pass the ball to beautifyjs

@aeschli
Copy link
Contributor

aeschli commented Apr 5, 2022

We have no plans to implement our own SCSS formatter nor do we want to create a fork of the jsbeautify formatter.

I enabled the jsbeautify for SCSS files to see how useful it is. If it is not, we remove it again for SCSS and only keep it for CSS.

@talamaska
Copy link
Author

I have not suggested implementing your own scss formatter. I have suggested adding a rule in the settings. Like for js and ts
e.g.

 "javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": false,
 "typescript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": false,

@JarrodMFlesch
Copy link

We have no plans to implement our own SCSS formatter nor do we want to create a fork of the jsbeautify formatter.

I enabled the jsbeautify for SCSS files to see how useful it is. If it is not, we remove it again for SCSS and only keep it for CSS.

I think I would prefer it not be enabled for scss files since it's not really beneficial at the moment. And it's cumbersome for me to tell every member of my team to disable this one rule that is uglifying our scss files.

@github-actions github-actions bot locked and limited conversation to collaborators May 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants