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

How can I maintain new lines on Prettier? #6916

Closed
ghost opened this issue Nov 10, 2019 · 3 comments
Closed

How can I maintain new lines on Prettier? #6916

ghost opened this issue Nov 10, 2019 · 3 comments
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. type:question Questions and support requests. Please use Stack Overflow for them, not the issue tracker.

Comments

@ghost
Copy link

ghost commented Nov 10, 2019

Hi guys,
I have a question about a Prettier.
I have a file .css where I want to preserve the newlines that I add.
But every time I run Prettier the empty lines were compressed always in one.

How can I maintain this newlines?

Thank you for reading

@j-f1
Copy link
Member

j-f1 commented Nov 10, 2019

Prettier only allows one consecutive blank line. There is no way to prevent Prettier from collapsing multiple blank lines into one.

@j-f1 j-f1 closed this as completed Nov 10, 2019
@j-f1 j-f1 added the type:question Questions and support requests. Please use Stack Overflow for them, not the issue tracker. label Nov 10, 2019
@lydell
Copy link
Member

lydell commented Nov 10, 2019

https://prettier.io/docs/en/rationale.html#empty-lines

You can use lots of empty // comments to achieve a similar effect, I guess.

@zphhhhh
Copy link

zphhhhh commented Nov 22, 2019

but

export default {

    /**
     * aaa
     */
    aaa,

    /**
     * bbb
     */
    bbb
}

will be processed to

export default {
    /**
     * aaa
     */
    aaa,

    /**
     * bbb
     */
    bbb
}

and I want to preserve the empty line before the first param.

@github-actions github-actions bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jun 2, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. type:question Questions and support requests. Please use Stack Overflow for them, not the issue tracker.
Projects
None yet
Development

No branches or pull requests

3 participants