vue3 and stylelint ,how to fix --Unexpected unknown pseudo-class selector,":deep"

Viewed 1342

I config stylelintrc.js like this:

rules: {
    "selector-pseudo-element-no-unknown": [true, {
      "ignorePseudoClasses": ["deep",""]
    }]
  } 

but not ok, my vue file is here link

the error is:

Unexpected unknown pseudo-class selector selector-pseudo-class-no-unknown
":deep"

the error image is here link

2 Answers

add ignorePseudoClasses sub rule

If this problem occurs, you can simply modify the rules in [stylelint.config.js]:

add ignorePseudoClasses rule item naming [deep]

According to documentation Stylelint uses cosmiconfig to find and load your configuration object. And there is defined sequence where it is going to search for your config. In my project I had both a stylelint property in package.json and as well a .stylelintrc file. When I added rule to package.json file which has higher priority everything started to work as it should.

Related