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

fix(printer-postcss): ignore escape \ and escaped / in Less #5597

Merged
merged 5 commits into from
Dec 17, 2018

Conversation

dsseng
Copy link
Contributor

@dsseng dsseng commented Dec 5, 2018

Avoid messing up Less files containing \/ (escaped /).
Ignore escape \ and escaped / in Less.
Fix #5208 issue.

  • I’ve added tests to confirm my change works.
  • (If changing the API or CLI) I’ve documented the changes I’ve made (in the docs/ directory)
  • I’ve read the contributing guidelines.

Try the playground for this PR

avoid messing up Less files containing \/ (escaped /)

fix prettier#5208
Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need tests

@@ -1038,3 +1038,12 @@ $my-map: (
.something {
grid-template-columns: 1 2fr (3 + 4);
}

// Ignore escape "\" in SCSS mixins
mixin margin-bottom-1\/3 {

This comment was marked as outdated.

label {
@include margin-bottom-1\\/3;
}

Copy link
Member

@alexander-akait alexander-akait Dec 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mixin margin-bottom-1\/3 {
  margin-bottom: 0.8rem;
}

label {
  @include margin-bottom-1\/3;
}

Add this test, looks you fix issue in scss too, great!

@@ -2025,7 +2025,7 @@ $my-map: (
}

// Ignore escape "\\" in SCSS mixins
mixin margin-bottom-1\\/3 {
@mixin margin-bottom-1\\/3 {

This comment was marked as resolved.

This comment was marked as outdated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've added

@mixin margin-bottom-1\/3 {
  margin-bottom: 0.8rem;
}

label {
  @include margin-bottom-1\/3;
}

to tests/css_scss/scss.scss and ran yarn test -u. This is auto generated

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job, thanks!

@ikatyang ikatyang merged commit 6a45924 into prettier:master Dec 17, 2018
@dsseng dsseng deleted the dont-mess-up-less branch December 17, 2018 04:46
@ikatyang ikatyang added this to the 1.16 milestone Jan 9, 2019
@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Apr 9, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Apr 9, 2019
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants