question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prettier messing up .less files

See original GitHub issue

Prettier messes up escape slashs in less files:

VSCode last version. Prettier last version.

Source:

.figcaption {
    .margin-top-1\/2;
    .large\:none;
}

Format:

.figcaption {
    .margin-top-1\ / 2;
    .large\: none;
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
incompletudecommented, Nov 14, 2018

This is a valid less mixin:

.margin-bottom-1\/3() {
    margin-bottom: 0.8rem;
}

This is a valid less class declaration:

label {
    .margin-bottom-1\/3;
}

That will produce the following css:

label {
  margin-bottom: 0.8rem;
}

Prettier also messes up mixins like .large\:none().

1reaction
j-f1commented, Nov 14, 2018

@evilebottnawi I’m guessing that it’s used to include all the styles for the classes margin-top-1/2 and large:none in the figcaption class.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prettier not formatting LESS files - visual studio code
If I manually run "Format document with..." and choose Prettier, it works fine. Less files are selected under the settings auto-format options, ...
Read more >
Options - Prettier
Prettier can insert a special @format marker at the top of files specifying that the file has been formatted with Prettier. This works...
Read more >
Formatting your code is a waste of time - use Prettier instead
Prettier helps format our code, and also should help take the argument away from how our code is formatted in the first place...
Read more >
How To Setup Prettier - YouTube
Prettier is one of my favorites tools for writing clean and easy to read ... Ignoring Files 08:00 - Configuration Options 09:55 -...
Read more >
I don't like prettier : r/javascript - Reddit
The more Prettier deviates from well-established JS formatting, the less I ... If the file was already formatted with prettier, this doesn't really...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found