"function-linear-gradient-no-nonstandard-direction": true, "function-url-quotes": "always", "function-whitespace-after": "always", "number-leading-zero": "never", "number-no-trailing-zeros": true, "string-no-newline": true, "string-quotes": "double", "unit-case": "lower", "unit-n...
Allows strings to use single-quotes or double-quotes so long as the string contains a quote that would have to be escaped otherwise. For example, with "single", { "avoidEscape" : false }. The following patterns are considered problems: ...
'function-url-quotes': 'always', 'string-quotes': 'single', 'unit-case': null, 'color-hex-case': 'lower', 'color-hex-length': 'long', 'rule-empty-line-before': 'never', 'font-family-no-missing-generic-family-keyword': null, 'selector-type-no-unknown': null, 'block-opening-br...
"string-quotes": "double", "value-no-vendor-prefix": true } 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 最后,建议读一下 stylelint 的官方配置文档,在其基础上做一些个性化的设置。接下来,让我们将这些审查规则融入到构建流程中。
lintStyleOnBuild: true, // 添加了插件(@ascendancyy/vue-cli-plugin-stylelint), 所以需要配置 stylelint: { fix: true, // boolean (default: true) files: ['src/**/*.vue', 'src/assets/styles/*.l?(e|c)ss'] // string | [string] (default: ['src/**/*.{vue,htm,html,css,sss,les...
从工程中查找和加载配置项,一般会从当前的工作目录中,以下面的顺序查找可能的来源: package.json里面的stylelint属性 一个单独的.stylelintrc文件 一个stylelint.config.js到处JS对象的文件 .stylelintrc文件格式可以是JSON,可以是YAML格式的,你也可以添加文件扩展名来指定文件内容格式是JSON,YAML,或者是JS格式。.sty...
配置stylelint StyleLint是『一个强大的、现代化的CSS检测工具』, 与ESLint类似, 是通过定义一系列的编码风格规则帮助我们避免在样式表中出现错误. (1)安装stylelint、stylelint-config-standard,stylelint-config-standard继承stylelint-config-recommended,提供一些常用的CSS规则,是stylelint推荐的配置 ...
{"rules": {"at-rule-blacklist": string|[],"at-rule-empty-line-before": "always"|"never","at-rule-name-case": "lower"|"upper","block-no-empty":null, ... } } 除了规则本身的取值之外,Stylelint还支持一些自定义配置,允许给规则传递一个数组,数组第一项是规则取值,第二项是自定义配置。
"function-url-quotes": "always", // 要求或禁止 URL 的引号 "always(必须加上引号)"|"never(没有引号)" "string-quotes": "double", // 指定字符串使用单引号或双引号 "unit-case": null, // 指定单位的大小写 "lower(全小写)"|"upper(全大写)" "color-hex-case": "lower", // 指定 16 进...