以行业内主流风格指南为基础,编写符合自己团队的编码规范。
-
class和id单词全字母小写,单词间以-分隔。 -
元素
id必须保证页面唯一。
<!-- 注释内容 -->HTML 格式配置应用 WebStorm Code Style -> HTML 标准配置,拓展部分在下面补充。
遵循主流风格指南,拓展部分在下面补充。
HtmlLint 详细规则请参考 https://github.com/htmllint/htmllint/wiki/Options
.htmllintrc 配置示例:
{
"force": true,
"tag-name-lowercase": false,
"disable-inline-style": true,
"indent-width": 2
}