Search code examples
stylelint

Cannot set block-no-empty to false in stylelint


Given the following in package.json:

"stylelint": { "extends": "stylelint-config-standard", "rules": { "string-quotes": "single", "block-no-empty": false, "indentation": 2 } } I'm having trouble figuring out how to override block-no-empty. If I set it to false, I get the error:

Invalid Option: Unexpected option value "false" for rule "block-no-empty"

Am I missing some kind of override syntax?


Solution

  • Use null to turn a rule off e.g. "block-no-empty": null.

    More details can be found in the configuration guide.

    There is also an example in the stylelint-config-standard README showing how to extend the config and turn off a rule.