CSSLint / csslint

Automated linting of Cascading Stylesheets
http://csslint.net
Other
4.77k stars 483 forks source link

Ignore parts of code in a final CSS file #406

Open emagnier opened 11 years ago

emagnier commented 11 years ago

I'm using Sass to compile my CSS, and also use a CSS framework (like Bootstrap, Foundation or Inuit.css).

When I'm using CssLint with Grunt on my final CSS, it gives me some errors / recommandations on the CSS code from the Framework.

Because I don't want to modify these frameworks / libraries, it should be good to add special comments to define certain regions CssLint will ignore.

e.g.:

/*# cssLintIgnoreArea=begin */
@import "../bower_components/bourbon/_bourbon.scss";
@import "../bower_components/inuit.css/_inuit.scss";
/*# cssLintIgnoreArea=end */

@import "_my-custom-code.scss";

With this I will be able to use efficiently CssLint on all my Sass projects.

aleemb commented 11 years ago

Yes please. When using third-party frameworks this is an absolute must. Right now we want to have CSS linter run as a pre-commit hook but due to the number of warnings coming from a third-party framework (we are using Inuit.CSS) the warnings/errors within our own project are overwhelmed. This reduces the efficacy of CSS linter for pragmatic use.

emagnier commented 10 years ago

Any news, opinions or comments about this one? I would love to use csslint, but can't because of this issue ;-(

selenite29 commented 10 years ago

:+1: Yes, it would be useful. Meantime I plan to split up my Css files with a naming convention and to lint only those generated from my Less files free of any call of third-party mixins....

adi-ads commented 10 years ago

There is another use case here.

I just added http://css-tricks.com/transitions-only-after-page-load/

And now get (universal-selector) warning. Though the warning is correct I want it to ignore it for this specific case only. Don't want to set the flag for the rule to be false as I still want to lint for that rule anywhere else in the code.

/* csslint ignore:start / .preload * { -webkit-transition: none !important; -moz-transition: none !important; transition: none !important; } / csslint ignore:end*/

Another use case is for css3 properties that come back as undefined. Would provide a way to ignore them until they are added to list.

Here is one example https://github.com/nzakas/parser-lib/issues/104

AndyHitchman commented 10 years ago

+1. Want to use this in my build stream, but Sass warnings bury app-specific problems.

lhwparis commented 10 years ago

+1 for this. i realy need this to use csslint in my daily projects

jscti commented 10 years ago

+1 really need this to enable csslint

pstanoev commented 10 years ago

+1 need this also.

xavierdutreilh commented 10 years ago

@nschonni, is there some plan to design and implement this feature at this point? If it is not the case, would a pull request for this change be welcomed?

marcochavezf commented 9 years ago

+1

bdgamble commented 9 years ago

+1

lorenz068 commented 9 years ago

+1: I need this feature too, please :

Newnab commented 9 years ago

+1

himedlooff commented 9 years ago

:+1:

frvge commented 8 years ago

I think PR #564 will do what you need.

laurentperroteau commented 8 years ago

+1