参考 Google Style

    1. {
    2. // 标签名小写
    3. "tagname-lowercase": true,
    4. // 属姓名小写
    5. "attr-lowercase": false,
    6. // 属性值使用双引号
    7. "attr-value-double-quotes": true,
    8. // 属性值可以为空
    9. "attr-value-not-empty": false,
    10. // 不能有重复属性值
    11. "attr-no-duplication": true,
    12. // 不需要声明
    13. "doctype-first": false,
    14. // 需要关闭所有非空元素<p></p>
    15. "tag-pair": true,
    16. // 需要关闭所有空元素<br/> <img /> <input />
    17. "tag-self-close": true,
    18. // 需要转义特殊字符"&" "<" ">" ...
    19. "spec-char-escape": true,
    20. // ID不能重复
    21. "id-unique": true,
    22. // src值不能为空
    23. "src-not-empty": true,
    24. // 不需要每个html文件都拥有title元素
    25. "title-require": false,
    26. // 如果存在alt属性,则需要添加alt属性值
    27. "alt-require": true,
    28. // 不需要每个html文件都声明doctype
    29. "doctype-html5": false,
    30. // id, class的值以中划线分隔
    31. "id-class-value": false,
    32. // 不允许添加<style type="text/css"></style>标签
    33. "style-disabled": true,
    34. // 不允许添加行内css值<div style="color:red"></div>
    35. "inline-style-disabled": true,
    36. // 允许行内js脚本
    37. "inline-script-disabled": false,
    38. // 使用2space代替tab
    39. "space-tab-mixed-disabled": "space2",
    40. // 允许idclass出现ad值,注含有adid或者class会被adblock软件block
    41. "id-class-ad-disabled": false,
    42. // 允许href属性值使用相对和绝对路径
    43. "href-abs-or-rel": false,
    44. // 不允许属性值使用不安全的字符
    45. "attr-unsafe-chars": true,
    46. // 不允许在head标签中使用script标签
    47. "head-script-disabled": true
    48. }