重现问题的步骤:
$ yarn create nuxt-app nuxt-project1
$ cd nuxt-project1
$ yarn dev
这是错误:
在配置中找不到规则。您是否提供了“规则”属性?
您需要在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"
]
}
}
我解决了简单地将rules
属性添加到styleling.config.js
.
前
后
module.exports = {
// add your custom config here
// https://stylelint.io/user-guide/configuration
rules: {},
};