json 我首选的stylelint配置。

Posted

tags:

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

{
  "rules": {
    "at-rule-name-space-after": "always",
    "at-rule-semicolon-space-before": "never",
    "at-rule-semicolon-newline-after": "always",
    "at-rule-no-vendor-prefix": true,
    "block-no-empty": true,
    "block-closing-brace-newline-after": [
      "always",
      "ignoreAtRules": [
        "if",
        "else"
      ]
    ],
    "block-closing-brace-newline-before": "always",
    "block-opening-brace-newline-after": "always",
    "block-opening-brace-space-before": "always",
    "color-no-invalid-hex": true,
    "color-hex-case": "lower",
    "color-hex-length": "short",
    "comment-no-empty": true,
    "comment-empty-line-before": [
      "always",
      "except": [
        "first-nested"
      ],
      "ignore": [
        "after-comment",
        "stylelint-commands"
      ]
    ],
    "comment-whitespace-inside": "always",
    "declaration-bang-space-after": "never",
    "declaration-bang-space-before": "always",
    "declaration-block-semicolon-newline-after": "always",
    "declaration-block-semicolon-space-before": "never",
    "declaration-block-trailing-semicolon": "always",
    "declaration-block-no-duplicate-properties": true,
    "declaration-block-no-redundant-longhand-properties": true,
    "declaration-block-no-shorthand-property-overrides": true,
    "declaration-block-single-line-max-declarations": 1,
    "declaration-colon-newline-after": "always-multi-line",
    "declaration-colon-space-before": "never",
    "declaration-no-important": true,
    "no-extra-semicolons": true,
    "font-family-name-quotes": "always-where-recommended",
    "font-family-no-duplicate-names": true,
    "font-weight-notation": "numeric",
    "function-calc-no-unspaced-operator": true,
    "function-name-case": "lower",
    "function-comma-space-after": "always",
    "function-comma-space-before": "never",
    "function-max-empty-lines": 0,
    "function-parentheses-space-inside": "never",
    "function-whitespace-after": "always",
    "indentation": 2,
    "keyframe-declaration-no-important": true,
    "length-zero-no-unit": true,
    "max-empty-lines": 4,
    "max-line-length": 120,
    "media-feature-colon-space-after": "always",
    "media-feature-colon-space-before": "never",
    "media-feature-name-case": "lower",
    "media-feature-parentheses-space-inside": "never",
    "media-feature-range-operator-space-after": "always",
    "media-feature-range-operator-space-before": "always",
    "media-query-list-comma-space-after": "always-single-line",
    "media-query-list-comma-space-before": "never",
    "number-leading-zero": "never",
    "number-no-trailing-zeros": true,
    "no-eol-whitespace": true,
    "no-missing-end-of-source-newline": true,
    "property-case": "lower",
    "property-no-unknown": true,
    "rule-empty-line-before": [
      "always",
      "except": [
        "after-single-line-comment",
        "first-nested"
      ]
    ],
    "selector-attribute-brackets-space-inside": "never",
    "selector-attribute-operator-space-after": "never",
    "selector-attribute-operator-space-before": "never",
    "selector-attribute-quotes": "always",
    "selector-combinator-space-after": "always",
    "selector-combinator-space-before": "always",
    "selector-descendant-combinator-no-non-space": true,
    "selector-list-comma-newline-after": "always",
    "selector-list-comma-newline-before": "never-multi-line",
    "selector-list-comma-space-after": "always-single-line",
    "selector-list-comma-space-before": "never",
    "selector-max-empty-lines": 0,
    "selector-max-id": 0,
    "selector-no-qualifying-type": [
      true,
      "ignore": [
        "attribute"
      ]
    ],
    "selector-pseudo-class-case": "lower",
    "selector-pseudo-class-no-unknown": true,
    "selector-pseudo-class-parentheses-space-inside": "never",
    "selector-pseudo-element-case": "lower",
    "selector-pseudo-element-colon-notation": "double",
    "selector-pseudo-element-no-unknown": [
      true,
      "ignorePseudoElements": [
        "/ng-deep/"
      ]
    ],
    "selector-type-case": "lower",
    "selector-type-no-unknown": [
      true,
      "ignoreTypes": [
        "/ts-/"
      ]
    ],
    "shorthand-property-no-redundant-values": true,
    "string-no-newline": true,
    "string-quotes": "single",
    "unit-case": "lower",
    "unit-no-unknown": true,
    "value-keyword-case": "lower",
    "value-list-comma-space-after": "always",
    "value-list-comma-space-before": "never",
    "value-list-max-empty-lines": 0,
    "value-no-vendor-prefix": true,
  }
}

以上是关于json 我首选的stylelint配置。的主要内容,如果未能解决你的问题,请参考以下文章

stylelint

json stylelint规则 - 属性 - 订单example.json

json Stylelint

配置eslint流程

在 Nuxt js 项目中配置 stylelint 文件

在Nuxt js项目中配置stylelint文件