pugjs / pug-lint

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

Should accept false options #119

Closed Ulrikop closed 8 years ago

Ulrikop commented 8 years ago

Hi, when I add explicitly a false to a rule, it throws an error. I think this should be an accepted value.

I like it when I can look at pug-lintrc to see what is configured without to know which rules are implicitly set. Ok, that is a nice to have for me. But now I have a situation at which I need it.

My company uses a pug-lintrc for all projects. But some projects changes some rules (for example I want to disable disallowClassAttributeWithStaticValue at a project where I use angular interpolation for class names, see #118 ).

So I added this at Gruntfile:

puglint: {
  options: {
    extends: `.pug-lintrc`,
    disallowClassAttributeWithStaticValue: false
  }
}

But now I get the error: disallowClassAttributeWithStaticValue option requires a true value or should be removed

When you really want to have that behavior, can you add an option to disable it?

Thank you

mrmlnc commented 8 years ago

You can specifically disable any rule by omitting it from your .pug-lintrc config file or by assigning it to null, like so:

https://github.com/pugjs/pug-lint#rules

Ulrikop commented 8 years ago

wow, that was a fast answer.

Thank you, it works.

TimothyGu commented 8 years ago

Duplicate of #102 (and see @mrmlnc's answer)