stylelint *.css --fix没有按预期工作。错误报告运行良好,但文件未修复。
包.json
{
"devDependencies": {
"stylelint": "^11.1.1",
"stylelint-config-recess-order": "^2.0.3"
}
}
Run Code Online (Sandbox Code Playgroud)
.stylelintrc.json
{
"extends": "stylelint-config-recess-order"
}
Run Code Online (Sandbox Code Playgroud)
style.css(丑陋的顺序属性)
{
"devDependencies": {
"stylelint": "^11.1.1",
"stylelint-config-recess-order": "^2.0.3"
}
}
Run Code Online (Sandbox Code Playgroud)
命令
{
"extends": "stylelint-config-recess-order"
}
Run Code Online (Sandbox Code Playgroud)
输出
.test {
height: 100%;
margin: auto;
width: 100%;
}
Run Code Online (Sandbox Code Playgroud)
错误报告很好。
我希望自动修复适用于文件。
小智 10
To check the errors first:
npx stylelint "**/*.{css,scss}"
Run Code Online (Sandbox Code Playgroud)
To fix the issues for all files (auto-correct options)
npx stylelint "**/*.{css,scss}" --fix
Run Code Online (Sandbox Code Playgroud)
If you want to change it for a specific file.
/npx stylelint src/index.css --fix
[your file name and path may need to be modified according to your one]
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3413 次 |
| 最近记录: |