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

简介: 新项目制定规范接入了stylelint,并通过husky在git提交时去触发检测修复,使用`:deep()`的时候却发现了报错;

前言

新项目制定规范接入了stylelint,并通过husky在git提交时去触发检测修复,stylelint版本信息如下:

    "stylelint": "^16.8.1",
    "stylelint-config-standard": "^36.0.1",
    "stylelint-less": "^3.0.1",
    "stylelint-order": "^6.0.4",

内容

stylelint.config.js中加入相应的rules进行配置;

module.exports = {
   
  defaultSeverity: 'error',
  extends: ['stylelint-config-standard'],
  plugins: ['stylelint-less'],
  overrides: [
    {
   
      files: ['**/*.html', '**/*.vue'],
      customSyntax: 'postcss-html',
    },
    {
   
      files: ['**/*.less'],
      customSyntax: 'postcss-less',
    },
  ],
  rules: {
   
    'selector-pseudo-class-no-unknown': [
      true,
      {
   
        ignorePseudoClasses: ['deep'],
      },
    ],
  },
};
目录
相关文章
|
3月前
|
开发工具 git
Stylelint—— Expected class selector ".nut-popup--top" to be kebab-case selector-class-pattern
新项目制定规范接入了stylelint,并通过husky在git提交时去触发检测修复,因为使用的是NutUi,所以无法直接调整组件对应的类名称,只好在stylelint.config.js中加入相应的rules进行配置。
87 0
Unknown custom element: <add-employee> - did you register the component correctly? For red cursive c
原因: 1.组件名没写对(导入和注册不对应) 2.components少写了个s 3.组件命名最好是驼峰命名 4.导入时语法错误 5.代码中有两个components,后一个的值把前一个覆盖了 6.组件直接循环套用了
|
11月前
|
JavaScript
[Vue warn]: Unknown custom element: <Top> - did you register the component correctly?
[Vue warn]: Unknown custom element: <Top> - did you register the component correctly?
|
JavaScript
[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent .(一)
大致意思就是props接收到的从父组件传过来的tableData不能直接修改。
129 0
|
JavaScript
[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent .(二)
1.在data中声明一个变量接收props的值,然后再去改变data里的这个值 2. 用computed属性 3.用data保存数据,watch监听
|
iOS开发
Xcode报错Expected selector for Objective-C and Expected method body
Xcode报错Expected selector for Objective-C and Expected method body
217 0
Xcode报错Expected selector for Objective-C and Expected method body
解决办法:Type safety: The expression of type List needs unchecked conversion to conform
解决办法:Type safety: The expression of type List needs unchecked conversion to conform
318 0
No injector for custom defined data type的解决办法
No injector for custom defined data type的解决办法
248 0
No injector for custom defined data type的解决办法