Skip to content

SCSS: don't add extra comma after last comment in map#6918

Merged
lydell merged 4 commits intoprettier:masterfrom
fisker:issue-6911
Nov 12, 2019
Merged

SCSS: don't add extra comma after last comment in map#6918
lydell merged 4 commits intoprettier:masterfrom
fisker:issue-6911

Conversation

@fisker
Copy link
Copy Markdown
Member

@fisker fisker commented Nov 11, 2019

fixes: #6911

FYI:

$my-map: (
  "foo": 1,
  // Comment
    "bar": 2,
  //        ^ <----- this PR don't remove this extra comma, when trailingComma is none
  // Comment,
  //        ^ <----- this PR only removed this extra comma
);
  • 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)
  • (If the change is user-facing) I’ve added my changes to changelog_unreleased/*/pr-XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.

Try the playground for this PR

@fisker fisker changed the title SCSS: don't add extra comma to map that ends with comma SCSS: don't add extra comma to last comment in map Nov 11, 2019
@fisker fisker changed the title SCSS: don't add extra comma to last comment in map SCSS: don't add extra comma after last comment in map Nov 11, 2019
Copy link
Copy Markdown
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, in future try to avoid extra tests not related to issue, because it is hard to review

Copy link
Copy Markdown
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.

Oh, problem still exists

$my-map: (
  "foo": 1,
  // Comment
  "bar": 2,
  // Comment
);

Should be

$my-map: (
  "foo": 1,
  // Comment
  "bar": 2
  // Comment
);

and

$my-map: (
  "foo": 1,
  // Comment
  "bar": 2,
  // Comment
);

with --trailing-comma all

@fisker
Copy link
Copy Markdown
Member Author

fisker commented Nov 11, 2019

As I said, this PR only fix comma after the last comment. #6920 is another issue.

Copy link
Copy Markdown
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.

Okey, let's solve this in other PR

Comment thread changelog_unreleased/scss/pr-6918.md Outdated
@alexander-akait
Copy link
Copy Markdown
Member

/cc @lydell need approve 😄

@lydell lydell merged commit 11d0323 into prettier:master Nov 12, 2019
@fisker fisker deleted the issue-6911 branch November 12, 2019 23:50
lipis added a commit that referenced this pull request Jan 8, 2020
* 'master' of github.com:prettier/prettier:
  Don't lowercase element names in CSS selectors (#6947)
  Support string-to-package config in JSON schema: (#6941)
  Rename SECURITY.md to .github/SECURITY.md
  Create SECURITY.md
  Add the XML plugin to the docs (#6944)
  TypeScript: Fix formatting of type operators as arrow function… (#6901)
  SCSS: don't add extra comma after last comment in map (#6918)
  Remove typescript-etw from build (#6919)
@lock lock Bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Feb 11, 2020
@lock lock Bot locked as resolved and limited conversation to collaborators Feb 11, 2020
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.

SCSS: extra comma added to map, after last comment

4 participants