lesshint icon indicating copy to clipboard operation
lesshint copied to clipboard

Upgrading to 6.3.0 gives unexpected results

Open xavierfoucrier opened this issue 6 years ago • 3 comments

Which version of lesshint are you using? 6.3.0

How are you running lesshint? CLI, Node.js API, Grunt/Gulp plugin? linter-lesshint

What's your .lesshintrc configuration?

"singleLinePerSelector": {
  "enabled": true,
  "style": "none"
},
"spaceAroundComma": {
  "enabled": true,
  "allowNewline": false,
  "style": "after"
}

If you're reporting a bug, please show us some code that's failing.

&:hover, // error occurs here
&:focus {
  &::before {
    width: 40px;
  }
}

What did you expect to happen? pass

What's the actual result? Error: lesshint: spaceAroundComma: Commas should be followed by one space

xavierfoucrier avatar Jan 18 '19 16:01 xavierfoucrier

Hi! Thanks for the report and for using the template!

Which version were you using previously? Because I think this is the expected behaviour with allowNewline set to false.

jwilsson avatar Jan 18 '19 19:01 jwilsson

I think I was previously using 5.3 on Atom linter, no errors was thrown.

Using the same configuration as before, this two rules seems to be completely incompatible: singleLinePerSelector are forcing &:focus to be on its own line while spaceAroundComma forces the &:hover line to follow space around comma convention.

I also have a rule to force trailing whitespace to be removed at end of line 😜

Hre is a sample code I don't want to be valid:

&:hover, &:focus {
  .test {
    font-family: 'Arial',
      'Segoe UI',
      'Sans serif';
  }
}

And here a code that should be validate by linter:

&:hover,
&:focus {
  .test {
    font-family: 'Arial', 'Segoe UI', 'Sans serif';
  }
}

Hope this help ✌

xavierfoucrier avatar Jan 18 '19 23:01 xavierfoucrier

@xavierfoucrier Thanks! I'll see what I can find.

jwilsson avatar Jan 19 '19 12:01 jwilsson

Closing the issue due to project inactivity.

Feel free to reopen again when needed.

xavierfoucrier avatar Apr 18 '23 22:04 xavierfoucrier