Skip to content

quotes in comments break stylelint in less mode #145

Description

@Zae

Hi,

I noticed that stylelint does not handle single quotes in // comments well.

This might be a duplicate of #130 but i'm still having this issue.

I can sort of reproduce it in the demo environment, but not really. Locally the quote causes the linenumbers to start at 0 at the quote again, so errors following the quote will have incorrect linenumbers.

In the demo the duplicate selector isn't found by stylelint, but only if the quote if on the end of the line, locally it doesn't matter where the quote is in the comment.

/* */ comments work fine btw.

Version: 9.10.1 and 11.1.1 (did not test any other versions)

@evilebottnawi asked me to open an issue (stylelint/stylelint#4411) here as he thinks the issue is caused by postcss-less.

  • Node Version: v10.15.0 (but i don't think it matters)
  • NPM Version: 6.4.1 (but i don't think it matters)
  • YARN Version: 1.19.1 (but i don't think it matters)
  • postcss Version: ^7.0.14
  • postcss-less Version: ^3.1.4

LESS

a {
  color: #FFF;
}

p {
  color: #ASDASD;
  // Dont do this it breaks'
}

a {
  color:#BROKEN;
}

Expected Behavior

Stylelint shows the correct line

Actual Behavior

Stylelint resets the linenumbers when a quote is found in a single line comment.

How can we reproduce the behavior?

Try to stylelint the provided less

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions