2

重现问题的步骤:

$ yarn create nuxt-app nuxt-project1

$ cd nuxt-project1

$ yarn dev

这是错误:

在配置中找不到规则。您是否提供了“规则”属性?

4

2 回答 2

2

您需要在stylelint.config.js文件中添加一些规则,例如:取自https://stylelint.io/user-guide/configuration网站

module.exports = {
  "rules": {
    "block-no-empty": null,
    "color-no-invalid-hex": true,
    "comment-empty-line-before": [
      "always", {
        "ignore": [
          "stylelint-commands",
          "after-comment"
        ]
      }
    ],
    "declaration-colon-space-after": "always",
    "indentation": [
      "tab", {
        "except": [ "value" ]
      }
    ],
    "max-empty-lines": 2,
    "rule-empty-line-before": [
      "always",
      {
        "except": [ "first-nested" ],
        "ignore": [ "after-comment" ]
      }
    ],
    "unit-whitelist": [
      "em",
      "rem",
      "%",
      "s"
    ]
  }
}
于 2019-12-10T20:35:57.970 回答
0

我解决了简单地将rules属性添加到styleling.config.js.

module.exports = {
  // add your custom config here
  // https://stylelint.io/user-guide/configuration
  rules: {},
};

于 2020-02-09T13:35:36.030 回答