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

SCSS file with multi-line comments is malformed when formatting #4716

Open
shiftkey opened this issue Jun 18, 2018 · 1 comment
Open

SCSS file with multi-line comments is malformed when formatting #4716

shiftkey opened this issue Jun 18, 2018 · 1 comment
Labels
area:comments Issues with how Prettier prints comments lang:css/scss/less Issues affecting CSS, Less or SCSS type:bug Issues identifying ugly output, or a defect in the program

Comments

@shiftkey
Copy link

Prettier 1.13.5
Playground link

I've only been able to reproduce this on Windows, and that Playground link above shows that it doesn't munge the comments there, so I've put together a repository which should be setup to see the issue on Windows:

$ git clone https://github.com/shiftkey/prettier-repro-scss
$ cd prettier-repro-scss
$ npm i
$ cat file.scss
$ npm run repro

Input:

body.theme-dark {
  /**
    * App menu bar colors (Windows/Linux only)
    */
  --app-menu-button-hover-background-color: var(
    --toolbar-button-hover-background-color
  );
  /**
    * Background color for badges inside of toolbar buttons.
    * Examples of badges are the ahead/behind bubble in the
    * push/pull button and the PR badge in the branch drop
    * down button.
    */
  --toolbar-badge-background-color: $gray-700;
}

Output:

body.theme-dark {
  /**
    * App menu bar colors (Windows/Linux only)
    */
  --app-menu-button-hover-background-color: var(
    --toolbar-button-hover-background-color
  );
  /* *
    * Background color for badges inside of toolbar buttons.
    * Examples of badges are the ahead/behind bubble in the
    * push/pull button and the PR badge in the branch drop
    * down button. */
  --toolbar-badge-background-color: $gray-700;
}

Expected behavior:

Multi-line are not malformed when formatting

@alexander-akait alexander-akait added type:bug Issues identifying ugly output, or a defect in the program lang:css/scss/less Issues affecting CSS, Less or SCSS labels Jun 19, 2018
@octref
Copy link

octref commented Mar 21, 2019

Another issue, multiline comments only get first line correctly indented:

Input and Output:

/**
        * foo bar
        */

Expected

/**
 * foo bar
 */

This works fine for all JS/TS parsers.

Playground Link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:comments Issues with how Prettier prints comments lang:css/scss/less Issues affecting CSS, Less or SCSS type:bug Issues identifying ugly output, or a defect in the program
Projects
None yet
Development

No branches or pull requests

4 participants