sass - Stylelint 禁用规则, "no-descending-specificity"

无法通过在 stylelintric.json 文件中分配 null 值来禁用 stylint 规则“no-descending-specificity”

"rules": {
    "no-descending-specificity": null
 }

相反,我不得不将下面这行写到我的 scss 文件的顶部

/* stylelint-disable no-descending-specificity */

Stylint doc但是允许使用 null 来关闭任何规则。这里可能出了什么问题?

我的eslint版本是4.19.1。

最佳答案

What could be wrong here?

Stylelint 可能没有使用您添加了 "no-descending-specificity": null 的配置对象。

检查:

  • 您只有一个 .stylelintrc 文件、stylelint.config.js 文件或 package.jsonstylelint 属性 文件(参见 docs )
  • 如果使用文件,请确保其命名正确,例如.stylelintrc.json(注意文件的前导句号和拼写 姓名)
  • 该文件位于您项目的根目录中

一个更完整的配置对象,应该是这样的:

{ 
  "extends": ["stylelint-config-standard"],
  "rules": {
    "no-descending-specificity": null
   }
}

关于sass - Stylelint 禁用规则, "no-descending-specificity"null 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68335343/

相关文章:

scala - Spark : Why execution is carried by a mast

node.js - 修复创建新 Angular 项目时的上游依赖冲突

python - 我的损失函数在训练期间没有得到更小的值

c - 为什么 GTK 4 报告 "assertion ' GTK_IS_WIDGET(部件 )'

javascript - A 帧动画框在特定区域随机移动

sql - 如何获得日期 + 时间的确定性计算值

azure-devops - Azure Devops 管道 NPM 审计

python - 多次拟合时 keras fit() 的历史

javascript - 如何减少 GridStack 网格元素的最小高度和重量?

schema - Protocol Buffer 架构无效。导入 "google/protobuf/