CSSLint / csslint

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

Pass options through to rule verification #695

Open hrobertking opened 7 years ago

hrobertking commented 7 years ago
frvge commented 7 years ago

@hrobertking , can you add an example test case where the options parameter is used inside a rule to change behavior?

hrobertking commented 7 years ago

@frvge , I'm unclear regarding what is needed here.

My intention is to (in a different PR) modify the rules-max rule to allow a different number to be used for the maximum number of rules, and allow more configurable rules to be written. This change makes passing those configurations into rules (like rules-max) possible. You can see a specific example of how that will work on my fork at https://github.com/hrobertking/csslint/commit/e58fed325cda61ba5ecd423d3303dc9ad10fb416 where I've modified rules-max to accept a number rather than just using 500.

If you're looking for a test, I'm not sure I could conceive of one that would work within the existing framework, because it would require a rule to be modified to add the options parameter.