-
Notifications
You must be signed in to change notification settings - Fork 479
Added support for embedded rulesets. Resolves #336. #338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for embedded rulesets. Resolves #336. #338
Conversation
Can you explain a little bit about how this works? Specifically, if you have command-line options, a .csslintrc file, and in-file rules specified, how do those get resolved? |
The modifications were limited to the In your example use case, if file-level rules are specified, the command-line options and .csslintrc options are ignored for that file. The included test-case demonstrates this behavior. |
I believe JSHint uses specificity instead of ignoring them:
|
Figuring out how the various settings interact is important. We basically
I don't think having one completely overrule the others is the correct On Mon, Jan 14, 2013 at 1:27 PM, Nick Schonning [email protected]:
Nicholas C. Zakas Author, Professional JavaScript for Web Developers |
Reworking the cascade of csslint rules as a whole is outside the scope of this issue, if needed at all. But I can see the case for having the file-level rules modify, rather than override, the ruleset passed into |
+1 This is very useful and necessary to make this a serious tool for our CI environment |
I think this is a good first step. We can label this feature as experimental and see what feedback we get. |
Added support for embedded rulesets. Resolves #336.
@nzakas Thank you, sir! |
Awesome turnaround, thanks @nzakas & @shannonmoeller |
Implements feature requested in #336. (Sorry for the trailing-whitespace changes. I have vim set to nuke those.)
Update: For posterity, this pull request adds the ability to override csslint rules on a per-file basis by embedding the rules in a special comment. It follows the jslint and jshint convention in style and meaning (defaults to warn, false is ignore, true is error).
/*csslint adjoining-classes:false, box-sizing:false, universal-selector:true */