json Stylelint

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了json Stylelint相关的知识,希望对你有一定的参考价值。

{
    "plugins": [
        "stylelint-scss",
        "stylelint-order",
        "stylelint-selector-bem-pattern",
        "stylelint-declaration-strict-value",
        "stylelint-high-performance-animation",
        "stylelint-no-indistinguishable-colors",
        "stylelint-images"
    ],
    "rules": {
        "order/order": [
            "custom-properties",
            "declarations"
        ],
        "plugin/selector-bem-pattern": {
            "componentName": "[A-Z]+",
            "componentSelectors": {
                "initial": "^\\.{componentName}(?:-[a-z]+)?$",
                "combined": "^\\.combined-{componentName}-[a-z]+$"
            },
            "utilitySelectors": "^\\.util-[a-z]+$"
        },
        "scale-unlimited/declaration-strict-value": "color",
        "plugin/no-low-performance-animation-properties": true,
        "order/properties-alphabetical-order": true,
        "scss/selector-no-redundant-nesting-selector": true,
        "plugin/stylelint-no-indistinguishable-colors": true,
        "images/broken": true,
        "images/prefer-data-uri": 256,
        "indentation": 4,
        "selector-list-comma-newline-after": "always",
        "declaration-colon-space-after": "always",
        "declaration-colon-space-before": "never",
        "declaration-block-single-line-max-declarations": 1,
        "rule-empty-line-before": [
            "always",
            {
                "ignore": [
                    "after-comment"
                ]
            }
        ],
        "comment-empty-line-before": [
            "always",
            {
                "ignore": [
                    "stylelint-commands"
                ]
            }
        ],
        "declaration-property-value-blacklist": {
            "/^border/": [
                "none"
            ]
        },
        "at-rule-blacklist": [
            "extend"
        ],
        "max-line-length": 120,
        "max-nesting-depth": 12,
        "selector-class-pattern": "cx-[a-z]+|js-[a-z]+",
        "declaration-no-important": true,
        "selector-max-compound-selectors": 6,
        "selector-no-qualifying-type": true,
        "no-duplicate-selectors": true,
        "block-no-empty": true,
        "at-rule-empty-line-before": [
            "always",
            {
                "ignoreAtRules": [
                    "import",
                    "first-nested"
                ],
                "ignore": [
                    "after-comment",
                    "first-nested",
                    "inside-block",
                    "blockless-after-same-name-blockless",
                    "blockless-after-blockless"
                ]
            }
        ],
        "at-rule-name-case": "lower",
        "color-hex-case": "upper",
        "color-hex-length": "short",
        "color-no-invalid-hex": true,
        "string-quotes": "double",
        "value-no-vendor-prefix": true,
        "value-list-comma-space-after": "always-single-line",
        "shorthand-property-no-redundant-values": true,
        "comment-whitespace-inside": "always",
        "function-comma-space-after": "always-single-line",
        "function-comma-space-before": "never",
        "length-zero-no-unit": true,
        "number-no-trailing-zeros": true,
        "declaration-block-trailing-semicolon": "always",
        "declaration-block-no-duplicate-properties": true,
        "declaration-block-semicolon-newline-after": "always",
        "block-closing-brace-empty-line-before": "never",
        "block-closing-brace-newline-before": "always",
        "block-closing-brace-newline-after": ["always-multi-line", { "exceptAtRules": ["if", "else", "else if"] }],
        "block-opening-brace-space-before": [
            "always",
            {
                "ignoreAtRules": [
                    "for"
                ]
            }
        ],
        "at-else-closing-brace-newline-after": "always-last-in-chain"
    }
}

以上是关于json Stylelint的主要内容,如果未能解决你的问题,请参考以下文章

json Stylelint

json 我首选的stylelint配置。

stylelint

这应该是 stylelint 中对于 CSS 的一个 bug

配置eslint流程

text [Stylelint测试#1]测试可能的10up Stylelint规则