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 TypeError for inline comments and autofix for sugarss in max-empty-lines #4821

Merged

Conversation

ecuplxd
Copy link
Contributor

@ecuplxd ecuplxd commented Jun 4, 2020

Which issue, if any, is this issue related to?

#4820

Is there anything in the PR that needs further explanation?

max-empty-lines/index.js line 58
https://github.com/stylelint/stylelint/blob/master/lib/rules/max-empty-lines/index.js#L60

if (!ignoreComments) {
    node.raws.left = getChars(node.raws.left);
    node.raws.right = getChars(node.raws.right);
}

for sugarss inline comment node.raws.right may get a undefined.

@jeddy3 jeddy3 changed the title fix: sugarss max empty lines fix error for inline comment Fix TypeError for inline comments and autofix for sugarss in max-empty-lines Jun 5, 2020
Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

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

@ecuplxd Thank you for your first contribution.

Looks good to me!

Copy link
Member

@mattxwang mattxwang left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@m-allanson m-allanson merged commit 120df50 into stylelint:master Jun 9, 2020
@m-allanson
Copy link
Member

Updated changelog:

  • Fixed: max-empty-lines TypeError from inline comment with autofix and sugarss syntax (#4821).

m-allanson added a commit that referenced this pull request Jun 10, 2020
# By Mike Allanson (6) and others
# Via GitHub
* master:
  Bump got from 11.2.0 to 11.3.0 (#4825)
  Export an object from the CSS-in-JS syntax (#4824)
  Add type `Formatter` for formatter functions (#4823)
  Update CHANGELOG.md
  Fix false positives for namespaced variables in property-no-unknown (#4803)
  Update CHANGELOG.md
  Fix TypeError for inline comments and autofix for sugarss in max-empty-lines (#4821)
  Create new 'lintPostcssResult' module (#4819)
  13.6.0
  Update deps
  Prepare 13.6.0
  Update CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants