4

Not able to disable the styelint rule "no-descending-specificity" by assigning null value within the stylelintric.json file

"rules": {
    "no-descending-specificity": null
 }

Instead I had to write the below line to the top of my scss file

/* stylelint-disable no-descending-specificity */

Stylint doc however allows usage of null to turn off any rule. What could be wrong here?

My eslint version is 4.19.1.

techloris_109
  • 547
  • 5
  • 13

1 Answers1

4

What could be wrong here?

Stylelint may not be using the configuration object that you added "no-descending-specificity": null to.

Check that:

  • you only have one .stylelintrc file, stylelint.config.js file or stylelint property in your package.json file (see docs)
  • if using a file, ensure it's named correctly, e.g. .stylelintrc.json (note the leading period and spelling of the file name)
  • the file is in the root of your project

A more complete configuration object, should look like:

{ 
  "extends": ["stylelint-config-standard"],
  "rules": {
    "no-descending-specificity": null
   }
}
jeddy3
  • 3,451
  • 1
  • 12
  • 21