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",
AI 代码解读

内容

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'],
      },
    ],
  },
};
AI 代码解读
目录
打赏
0
0
1
0
67
分享
相关文章
|
7月前
|
Stylelint—— Expected class selector ".nut-popup--top" to be kebab-case selector-class-pattern
新项目制定规范接入了stylelint,并通过husky在git提交时去触发检测修复,因为使用的是NutUi,所以无法直接调整组件对应的类名称,只好在stylelint.config.js中加入相应的rules进行配置。
214 0
成功解决FATAL ERROR in native method: JDWP on getting class status, jvmtiError=JVMTI_ERROR_WRONG_PHASE
成功解决FATAL ERROR in native method: JDWP on getting class status, jvmtiError=JVMTI_ERROR_WRONG_PHASE
Unknown custom element: <add-employee> - did you register the component correctly? For red cursive c
原因: 1.组件名没写对(导入和注册不对应) 2.components少写了个s 3.组件命名最好是驼峰命名 4.导入时语法错误 5.代码中有两个components,后一个的值把前一个覆盖了 6.组件直接循环套用了
116 0
A configuration error occurred during startup.Please verify the preference field with the prompt: To
A configuration error occurred during startup.Please verify the preference field with the prompt: To
| ERROR: [2] bootstrap checks failed. You must address the points described in the following [2] lin
| ERROR: [2] bootstrap checks failed. You must address the points described in the following [2] lin
1030 0
ERROR: 2 matches found based on name: network product-server_default is ambiguous
ERROR: 2 matches found based on name: network product-server_default is ambiguous
187 0
解决g++编译C++报错unresolved external... (undefined reference ...)
解决g++编译C++报错unresolved external... (undefined reference ...)
362 0
解决g++编译C++报错unresolved external... (undefined reference ...)
报错解决:Reason: Failed to determine a suitable driver class
报错解决:Reason: Failed to determine a suitable driver class
2595 0
报错解决:Reason: Failed to determine a suitable driver class
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等