Comments (13)
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.
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.
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.
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.
@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.
Yeah, that seems like a good way to do this. 👍
from lesshint.
Starting work on this one. Tracking on https://github.com/gilt/lesshint/tree/inline-rules
from lesshint.
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.
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.
Sounds good to me. 👍
from lesshint.
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.
Definitely need this 👍
from lesshint.
Some feedback over in #138 would be greatly appreciated 😄
from lesshint.
Related Issues (20)
- Property order concentric
- Upgrade report on propertyOrder error
- Ordering bug
- "parse error: Missed semicolon" for variable body starting with `&` HOT 2
- Lesshint Throws Different Warnings for Single Line Comments HOT 1
- Several False Positives of stringQuotes Rule HOT 3
- An in-range update of rimraf is breaking the build 🚨 HOT 1
- Upgrading from 5.3.0 to 6.3.0 leads to many false positives HOT 6
- Upgrading to 6.3.0 gives unexpected results HOT 4
- newlineAfterBlock doesn't work properly HOT 2
- An in-range update of postcss-less is breaking the build 🚨 HOT 3
- Upgrading to 6.3.1 leads to incorrect newlineAfterBlock warnings HOT 4
- An in-range update of sinon is breaking the build 🚨 HOT 1
- Using a mixin causes inaccurate reporting of newlineAfterBlock HOT 8
- Rule proposal: spaceAroundChildCombinator HOT 1
- An in-range update of sinon is breaking the build 🚨 HOT 2
- An in-range update of mocha is breaking the build 🚨 HOT 1
- LESS "extend" syntax violates spaceAfterPropertyColon rule HOT 1
- An in-range update of coveralls is breaking the build 🚨 HOT 2
- TypeError: Cannot read property 'valueOf' of undefined HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lesshint.