【发布时间】:2020-02-21 18:05:06
【问题描述】:
stylelint *.css --fix 没有按预期工作。错误报告效果很好,但文件未修复。
package.json
{
"devDependencies": {
"stylelint": "^11.1.1",
"stylelint-config-recess-order": "^2.0.3"
}
}
.stylelintrc.json
{
"extends": "stylelint-config-recess-order"
}
style.css(难看的属性)
.test {
height: 100%;
margin: auto;
width: 100%;
}
命令
$ npx stylelint style.css --fix
输出
style.css
4:3 ✖ Expected "width" to come before "margin" order/properties-order
错误报告很好。
我希望自动修复适用于文件。
【问题讨论】:
-
相同的设置和配置在我的电脑(macOS)上运行良好,没有报告但丑陋的顺序属性在运行后已修复。
-
谢谢,@ahgood。正如我在下面发布的那样,它已解决。
-
我也有同样的问题!应用了您的答案,但没有任何效果!我正在使用 Webstorm!
标签: stylelint