Giter Site home page Giter Site logo

Comments (8)

kevinsawicki avatar kevinsawicki commented on July 30, 2024

Yeah, definitely sounds good, the current approach is definitely not precise due to what less currently outputs as originating lines.

from grunt-lesslint.

kevinsawicki avatar kevinsawicki commented on July 30, 2024

Looked into this a bit, and ran into the following problem for some less like:

body {
  #test {
    color: blue;
  }
}

The css would be:

body #test {
  color: blue;
}

But csslint reports the Don't use IDs in selectors. error at line 1, column 1. And when reversing that back through the source map it will come out as line 1 instead of line 2 in the less file since the position reported by the error refers to the body part, not the #test part of the line of the css.

May need to open an issue/pr on csslint to make the error reporting more precise on the column so the source map lookup goes to the right line.

from grunt-lesslint.

 avatar commented on July 30, 2024

You're right. Definitely open up an issue. csslint (sadly) has tons of open issues, but it seems like they started to merge pull requests again.

from grunt-lesslint.

 avatar commented on July 30, 2024

By the way, how do you currently solve this problem?

As far as I can see findPropertyLineNumber solves this. We could keep this for the time being.

from grunt-lesslint.

kevinsawicki avatar kevinsawicki commented on July 30, 2024

Yeah, I was just hoping to switch to source maps 100% and remove the old hacky comment based line number mapping code.

from grunt-lesslint.

 avatar commented on July 30, 2024

Yea.

from grunt-lesslint.

jgable avatar jgable commented on July 30, 2024

I took another look at this and also came to the same road block as @kevinsawicki. The ID results are not as accurate as they could be, but it's still semi relevant. I put a PR in to the csslint project to use the column of the first found ID in the selector, if they do not accept it I may have to try and put a hack in just for that rule.

I have an implementation of the reporting working with source maps and will put a PR in for it in a little bit.

from grunt-lesslint.

jgable avatar jgable commented on July 30, 2024

This is now published as 1.0.0. It will report the body { line for now, if csslint doesn't merge my PR I'll update with something to hack it in our project.

from grunt-lesslint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.