• 屏蔽作者: Nordon
  • 举报
Unexpected unknown pseudo-element selector "::v-deep" (selector-pseudo-element-no-unknown)

在Vue中使用样式穿透::v-deep时,stylelint会报错 Unexpected unknown pseudo-element selector "::v-deep" (selector-pseudo-element-no-unknown)

### .stylelintignore

创建 .stylelintignore 文件

```
build/*.js
src/assets
*.zip
package.json
# .stylelintignore
# 旧的不需打包的样式库
*.min.css

# 其他类型文件
*.js
*.jpg
*.woff

# 测试和打包目录
/test/
/dist/

# 忽略的目录
*element-variables.css
```

### .stylelintrc.js

创建 .stylelintrc.js 文件、并安装依赖

```shell
$ npm install --save-dev stylelint stylelint-scss stylelint-config-standard stylelint-csstree-validator stylelint-config-prettier
```

配置内容:

```js
module.exports = {
extends: ["stylelint-config-standard", "stylelint-config-prettier"],
rules: {
"selector-pseudo-element-no-unknown":null
},
};
```