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

前言

新项目制定规范接入了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'],
      },
    ],
  },
};
posted @ 2024-08-27 09:47:23 王洋 阅读(185) 评论(0)
发表评论
昵称
邮箱
网址