Giter Club home page Giter Club logo

Comments (13)

CITguy avatar CITguy commented on September 25, 2024

It should be trivial to implement // lesshint ignore:line as it would be a matter of removing lines from the incoming css before parsing with gonzales (similar to how we already normalize line endings). This way, the entire line is completely excluded from the resulting AST.

Rule-specific disabling may be trickier as we would have to walk the sibling nodes until we encounter a singlelineComment + newline, then parse the comment to check if the rule is ignored.

from lesshint.

kokarn avatar kokarn commented on September 25, 2024

I think we should go for // lesshint ignore:importantRule. It's a really
nice feature and I see no reason to go half-assed.

On Sun, Aug 30, 2015 at 8:57 PM Ryan Johnson [email protected]
wrote:

It should be trivial to implement // lesshint ignore:line as it would be
a matter of removing lines from the incoming css before parsing with
gonzales (similar to how we already normalize line endings
https://github.com/lesshint/lesshint/blob/master/lib/linter.js#L76).
This way, the entire line is completely excluded from the resulting AST.

Rule-specific disabling may be trickier as we would have to walk the
sibling nodes until we encounter a singlelineComment + newline, then
parse the comment to check if the rule is ignored.


Reply to this email directly or view it on GitHub
#55 (comment).

from lesshint.

jwilsson avatar jwilsson commented on September 25, 2024

I agree with @kokarn, we should definitely take the time to work this out properly since I think it's a real "must-have" feature.

from lesshint.

shellscape avatar shellscape commented on September 25, 2024

Carried over from #57, declaring per-file options in a comment at the top of a file goes along with this. Since the other was closed, perhaps renaming this for both type of inline/infile options is appropriate.

from lesshint.

shellscape avatar shellscape commented on September 25, 2024

@kokarn jshint syntax, which I think works really well in this case, follows their .jshintrc syntax. eg:

.somerule { background: url(...); } /* lesshint urlQuotes: false */

or

/* lesshint urlQuotes: false */
.somerule { background: url(...); } 

that makes configuring lesshint uniform wherever you choose to; .lesshintrc, inline, etc.

from lesshint.

kokarn avatar kokarn commented on September 25, 2024

Yeah, that seems like a good way to do this. 👍

from lesshint.

shellscape avatar shellscape commented on September 25, 2024

Starting work on this one. Tracking on https://github.com/gilt/lesshint/tree/inline-rules

from lesshint.

kaiyoma avatar kaiyoma commented on September 25, 2024

Would love to see this in action as well. For our project, we always alphabetize our properties, but there are a couple cases where it makes sense to not do this:

  • display: none comes first (usually with a comment explaining why)
  • Browser-specific properties usually mess up the ordering of things

Any status update?

from lesshint.

jwilsson avatar jwilsson commented on September 25, 2024

Totally forgot about this one. I don't think anyone's working on it but I'll be happy to do so unless someone else is interested (@shellscape?).

What I'm proposing is basically what we discussed earlier so we're consistent with .lesshintrc.

Disable rule for a single line (add any type of trailing comment):

.somerule { background: url(...); } /* lesshint urlQuotes: false */ or // lesshint urlQuotes: false

Disable rule for the whole file (add a any type of comment at the top):

/* lesshint urlQuotes: false */ or // lesshint urlQuotes: false
.somerule { background: url(...); } 

from lesshint.

kaiyoma avatar kaiyoma commented on September 25, 2024

Sounds good to me. 👍

from lesshint.

shellscape avatar shellscape commented on September 25, 2024

I had started poking at this but got distracted by the PostCSS LESS syntax thing. And then our company got purchased so it's been a little crazy on my end. Should even out after this month - but please do take a look at that branch and continue on in the mean time!

from lesshint.

adam-lynch avatar adam-lynch commented on September 25, 2024

Definitely need this 👍

from lesshint.

jwilsson avatar jwilsson commented on September 25, 2024

Some feedback over in #138 would be greatly appreciated 😄

from lesshint.

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.