pugjs / pug-lint

An unopinionated and configurable linter and style checker for Pug
ISC License
228 stars 51 forks source link

Option to ignore specific rules / all rules for a line / element / file #115

Open jdforsythe opened 8 years ago

jdforsythe commented 8 years ago

I cannot find any docs about this feature, if it exists...

Other linters (jshint, eslint, etc.) allow you to disable all or specific rules for a line, function (in this case, element), or a file.

My use case is this - I disallow static class attributes, however I am using Angular to interpolate a class attribute (I know, ng-class but this is a special case...) and I'd like to ignore that rule for only that particular element.

Something like:

//- puglint-ignore-element disallowClassAttributeWithStaticValue
div(class="{{ interpolation }}")
b12f commented 8 years ago

Just stumbled upon a case where we could really use this feature. Devs, is this on the roadmap? Otherwise we'll have to look at changing our rules, which I'd rather not do.

geersch commented 7 years ago

Having the same issue.

div(class="block-element--{{modifier}}")

The linter will complain that it should be written as a class literal, but this is not possible. So for these exception an option to ignore it would be useful.

dimkov41 commented 2 years ago

Hello,

Five years later I faced the same issue. Is there any solution to this ?

markel-official commented 2 years ago

Same. Is there any anything?