stylelint构造及规则了解

4,656 阅读21分钟
原文链接: blog.csdn.net

    这篇文章主要是对stylelint的构造和规则,根据官网的英文文档, 我花了点时间进行了简单的翻译工作,把主要的意思大概写了一下,算是一篇笔记吧。具体的规则方面有些我就直接用有道翻译的,因为量太大了,我自己主要翻译的就是前半段,加上规则的部分内容,有道翻译的没翻译好的,我顺道给改了改。自己写的demo还没有完善好,等找时间,我完善之后上传下。

    其实吧,这个stylelint用起来基本上跟eslint差不多,也可以跟gulp一块用,这个方面我还没有开始研究,可能明天或者后天会进行研究。然后后续也可能再补上一篇文。感觉时间好不够用,这一天研究研究,就过去了。好希望一天是240小时。大家看这篇文章要是有啥不懂的可以去官网查看查看,其实里面有不少内容我自己也没有弄清楚呢,还有待研究,大家要是有兴趣的可以跟我一起讨论讨论。

stylelint configuration(构造)

加载配置对象

    从工程中查找和加载配置项,一般会从当前的工作目录中,以下面的顺序查找可能的来源:

  • package.json里面的stylelint属性
  • 一个单独的.stylelintrc文件
  • 一个stylelint.config.js到处JS对象的文件

    .stylelintrc文件格式可以是JSON,可以是YAML格式的,你也可以添加文件扩展名来指定文件内容格式是JSON,YAML,或者是JS格式。.stylelintrc.json, .stylelintrc.yaml, .stylelintrc.js

    你可能需要使用扩展,使你的文本编辑器,可以更好地解释文件,并帮助语法检查和高亮。

    一旦其中之一被发现和解析,搜索将停止,该对象将被使用。

配置对象

    配置对象可以有下面这些属性

rules

1.基本格式

    个人认为规则算是检查器里极其重要的配置项了,stylelint有超过一百五十条的规则,这些规则没有是默认打开的,都需要自己根据自己的需要进行设置开启。

    规则属性是一个对象,它的键是规则的名称,值是规则配置。每个规则配置符合下列格式之一:

  • 单个值(primary option)
  • 一个有两个值的数组([primary option,secondary option])
  • null (关闭规则)

示例:

{
    "rules": {
        "block-no-empty": null,
        "color-no-invalid-hex": true,
        "comment-empty-line-before": [ "always", {
            "ignore": ["stylelint-commands", "between-comments"],
        } ],
        "declaration-colon-space-after": "always",
        "indentation": ["tab", {
            "except": ["value"]
        }],
        "max-empty-lines": 2,
        "rule-nested-empty-line-before": [ "always", {
            "except": ["first-nested"],
            "ignore": ["after-comment"],
        } ],
        "unit-whitelist": ["em", "rem", "%", "s"]
    }   
}

指定了一个primary option就是打开了一个规则。

2.在css文件中关闭规则

    在css文件中,你可以暂时关闭某条规则,也可以关闭所有规则:

/* stylelint-disable */
a {}
/* stylelint-enable */

    你也可以关闭个别规则:

/* stylelint-disable selector-no-id, declaration-no-important   */
#id {
    color: pink !important;
}
/* stylelint-enable */

    在你不需要明确地重新启用的规则处,你也可以通过/* stylelint-disable-line */关闭个别行:

#id { /* stylelint-disable-line */
    color: pink !important; /* stylelint-disable-line declaration-no-important */
}

    当然你也可以通过/* stylelint-disable-next-line */来关闭那些你不需要明确重新启用的下一行规则:

#id {
    /* stylelint-disable-next-line declaration-no-important */
    color: pink !important;
}

    有些复杂的,重叠的禁用和启用模式同样支持:

/* stylelint-disable */
/* stylelint-enable foo */
/* stylelint-disable foo */
/* stylelint-enable */
/* stylelint-disable foo, bar */
/* stylelint-disable baz */
/* stylelint-enable baz, bar */
/* stylelint-enable foo */
3.严重程度:error & warning

    跟eslint差不多,stylelint也有严重程度的分别,默认情况下,所有的规则都有一个error级别的严重程度,你可以在配置中通过添加defaultSeverity属性来改变默认值

    要调整任何具体规则的严重程度,使用辅助选项severity,可获得的值有

  • warning
  • error

示例:

// error-level severity examples
{ "indentation": 2 }
{ "indentation": [2] }

// warning-level severity examples
{ "indentation": [2, { "severity": "warning" } ] }
{ "indentation": [2, {
        "except": ["value"],
        "severity": "warning"
    }]
}

不同的情况会使用不同的严重级别。例如不同的显示,或者不同的退出过程等等。

4.自定义消息

    如果您想在一个规则被违反,提供自定义消息,你可以用两种方式做到这一点:提供一个message选项,或者写一个自定义格式。

    所有的规则都接受一个次要选项message,如果提供了该选项,意味着将会取代任何默认提供的标准信息。举个例子,以下规则配置将替代几个自定义消息:

{
    "color-hex-case": [ "lower", {
        "message": "Lowercase letters are easier to distinguish from numbers"
    } ],
     "indentation": [ 2, {
         "ignore": ["block"],
         "message": "Please use 2 spaces for indentation. Tabs make The Architect grumpy.",
        "severity": "warning"
     } ]
}

如果你想最大程度的进行控制,你应该写自定义格式的规则。(自定义消息部分的思想我大概理解,但是不怎么会翻译。。尴尬。。。)

扩展

    你的配置可以扩展一个现有的配置,无论这个配置是你自己的还是第三方的。当一个配置扩展了另一个配置,它在被扩展的配置项开始的时候开始,并且添加在其之后或者直接覆盖当前配置。

    你也可以扩展现有配置的阵列,优先于阵列中的各项(因此第一项压倒一切,第二个项目压倒一切除了第一项,以此类推。个人理解就是你一个草民扩展了,你当皇帝了,那你就是老大,比谁都牛,你要是宰相呢,那你就是除了皇帝以外,比谁都厉害,你要是什么七品芝麻官,除了比你级别高的,你比下面的人都厉害等等。)。

    举个例子,扩展下stylelint-config-standard改变缩进的标签,并且关闭number-leading-zero规则:

{
    "extends": "stylelint-config-standard",
    "rules": {
        "indentation": "tab",
        "number-leading-zero": null
    }
}

或者用stylelint-config-standard开始,然后在这顶部把myExtendableConfig分层,然后覆盖缩进规则

{
    "extends": [
        "stylelint-config-standard",
        "./myExtendableConfig"
    ],
    "rules": {
        "indentation": "tab"
    }
}

extends的值是locater,最终是require(),所以它可以适合用noderequire.resolve()算法的任何格式。这就意味着locater可以是:

  • node_modules模块的名称。
  • 绝对文件路径。
  • 名为.js或者以.json扩展名的文件的相对路径,相对于参考配置。

plugins(插件)

    插件是支持方法,工具集,非标准CSS功能,或者非常具体的用例规则或套由社区建立规则。

    想要使用插件,就添加plugins阵列配置项到你的配置文件中,值可以是一个npm模块的名字,可以使一个绝对路径,也可以是一个调用配置文件的相对路径。

{
    "plugins": [
        "../special-rule.js"
    ],
    "rules": {
        "plugin/special-rule": "everything"
    },
}

    一个插件可以提供一个规则或者一组规则,如果你用的插件提供了一组规则,只需调用模块中的插件配置值,并且使用它在rules中提供的规则。

{
    "plugins": [
        "../some-rule-set.js"
    ],
    "rules": {
        "some-rule-set/first-rule": "everything",
        "some-rule-set/second-rule": "nothing",
        "some-rule-set/third-rule": "everything"
    },
}

Processors(处理器)

    处理器是挂钩到stylelint的管道,修改的道路上的代码到stylelint并就其出路改变结果的功能。

    处理器只能与CLI和节点的API,而不是与PostCSS插件使用。 (该PostCSS插件会忽略它们。)

    使用的话,添加processors阵列配置项到配置文件中,用起来跟扩展差不都多。

{
    "processors": ["stylelint-html-processor"],
    "rules": {..},
}

如果你的处理器有选项,其第一个项目是“定位”和第二项是选择对象。

{
    "processors": [
        "stylelint-html-processor",
        [ "some-other-processor", { "optionOne": true, "optionTwo": false } ]
    ],
    "rules": {..}
}

ignoreFiles

    提供一个glob或globs数组忽略特定文件。

    另一种方法是使用一个.stylelintignore文件,描述如下。

    如果glob是绝对路径,它们就这样用。如果他们是相对的,它们是相对于分析

  • configBasedir
  • 配置文件的路径,如果配置是stylelint发现的一个加载的文件
  • process.cwd()

这个属性呢,从扩展配置剥离:只有root级别的配置可以忽略文件。

defaultSeverity

    默认严重级别

  • error
  • warning

.stylelintignore

    你可以使用.stylelintignore文件(或者指定另一个忽略模式的文件)来忽略特定文件。(另一种方法是使用一个config.ignoreFiles,如上所述)

    在你.stylelintignore文件中的模式必须匹配.gitignore语法。(之后,node-ignore会解析你的模式),这其中的一个含义是,在你文件中的模式总是相对于process.cwd()进行分析

    stylelint会在process.cwd()中寻找一个.stylelintignore文件,你还可以指定你的忽略模式的文件路径(绝对或相对于process.cwd())使用–ignore路径(在CLI)和ignorePath(在JS)选项。

stylelint rules

    stylelint rules官方地址

    规则专注于规范化css,旨在作用于广大用户。除了规则呢,还有插件,插件是由社区建立,可以支持方法,工具集,非标准CSS功能,或者非常具体的用例规则。

    每一条规则是独立的,默认情况下关闭。规则也没有默认值。

规则列表

Color

  • color-hex-case: 指定大写或小写十六进制的颜色。
  • color-hex-length: 指定十六进制颜色长或短的符号。
  • color-named: 需要(如果可能)或不允许命名的颜色。
  • color-no-hex: 不允许十六进制的颜色。
  • color-no-invalid-hex: 禁止无效的十六进制颜色。

font-family

  • font-family-name-quotes:指定是否引号应该围绕字体系列名称中使用。

function

  • function-blacklist:指定不允许的功能黑名单
  • function-calc-no-unspaced-operator:计算的函数中禁止的unspaced执行
  • function-comma-newline-after:要求一个新行或函数的逗号后禁止空白。
  • function-comma-newline-before: 要求一个新行或函数的逗号之前不允许空白。
  • function-comma-space-after: 要求一个空格或函数的逗号后禁止空白。
  • function-comma-space-before:要求一个空格或函数的逗号前禁止空白。
  • function-linear-gradient-no-nonstandard-direction:禁止在线性梯度方向值(),根据标准语法是无效的呼叫。
  • function-max-empty-lines: 限制方法中相邻的空行数
  • function-name-case: 指定大写或小写的函数名。
  • function-parentheses-newline-inside:要求一个新行或函数的括号内不允许空白。
  • function-parentheses-space-inside: 要求一个空格或函数的括号内不允许空白。
  • function-url-data-uris: 要求或禁止数据的URI的URL
  • function-url-no-scheme-relative:不允许文档相对的URL。
  • function-url-quotes: 要求或禁止对于网址报价
  • function-url-scheme-whitelist: 指定允许URL方案的白名单。
  • function-whitelist: 指定允许的功能的白名单。
  • function-whitespace-after: 要求方法后不允许空白。

Number

  • number-leading-zero:要求或分数低于1的数字禁止前导零。
  • number-max-precision:限制允许的小数位数的数目。
  • number-no-trailing-zeros: 禁止在数量尾随零。

String

  • string-no-newline: 禁止在字符串(转义)换行。
  • string-quotes: 指定字串,单或双引号。

Length

  • length-zero-no-unit: 禁止单位零长度。

Time

  • time-no-imperceptible: 禁止动画和过渡小于或等于100毫秒。

Unit

  • unit-blacklist: 指定不允许使用单位的黑名单。
  • unit-case: 指定大写或小写的单位。
  • unit-no-unknown: 禁止未知的单位。
  • unit-whitelist: 指定允许单位的白名单>

Value

  • value-keyword-case: 指定大写或小写关键字的值。
  • value-no-vendor-prefix: 不允许供应商前缀值。

Value list

  • value-list-comma-newline-after: 逗号后需要一个换行符或不允许空白值列表。
  • value-list-comma-newline-before: 逗号前需要一个换行符或不允许空白值列表。
  • value-list-comma-space-after: 需要一个空格或者逗号后不允许空白值列表。
  • value-list-comma-space-before:需要一个空格或者逗号前不允许空白值列表。
  • value-list-max-empty-lines: 限制相邻的数量值列表内空行。

Custom property

  • custom-property-empty-line-before: 自定义属性之前equire或不允许空行。
  • custom-property-no-outside-root: 不允许自定义属性以外的:根规则。
  • custom-property-pattern: 为自定义属性指定一个模式。

Shorthand property

  • shorthand-property-no-redundant-values:不允许在简写属性冗余值。

Property

  • property-blacklist: 指定一个不允许属性的黑名单。
  • property-case: 为属性指定小写或大写。
  • property-no-unknown: 不允许未知属性。
  • property-no-vendor-prefix: 不允许前缀的属性。
  • property-whitelist: 指定一个白名单允许属性。

Keyframe declaration

  • keyframe-declaration-no-important: 不允许!important在关键帧声明。

Declaration

  • declaration-bang-space-after: bang声明之后需要一个空格或者不允许空白
  • declaration-bang-space-before: bang声明之前需要一个空格或者不允许空白
  • declaration-colon-newline-after: 冒号后的声明需要一个换行符或不允许空白。
  • declaration-colon-space-after: 冒号后的声明需要一个空格或不允许空白。
  • declaration-colon-space-before: 冒号之前的声明需要一个空格或不允许空白。
  • declaration-empty-line-before: 要求声明前不允许空一行。
  • declaration-no-important: 不允许!important声明。
  • declaration-property-unit-blacklist: 指定一个黑名单内不允许声明属性。
  • declaration-property-unit-whitelist: 指定一个白名单内允许声明属性。
  • declaration-property-value-blacklist: 指定一个黑名单,不允许在声明属性和值对。
  • declaration-property-value-whitelist: 指定一个允许属性和值对声明的白名单。

Declaration block

  • declaration-block-no-duplicate-properties: 不允许复制属性块中声明
  • declaration-block-no-ignored-properties:不允许被忽略是因为另一个属性值的属性值相同的规则。
  • declaration-block-no-redundant-longhand-properties: 不允许手写属性,可以组合成一个简写属性。
  • declaration-block-no-shorthand-property-overrides: 不允许简写属性覆盖相关手写属性声明块。
  • declaration-block-properties-order: 声明块中指定的顺序属性。
  • declaration-block-semicolon-newline-after: 要求一个换行符或不允许空白块分号后。
  • declaration-block-semicolon-newline-before: 要求一个换行符或不允许空白块分号之前的声明。
  • declaration-block-semicolon-space-after: 要求一个空间或不允许空白块分号后的声明。
  • declaration-block-semicolon-space-before: 要求一个空间或不允许空白块分号之前的声明
  • declaration-block-single-line-max-declarations: 限制声明在一行声明块的数量
  • declaration-block-trailing-semicolon: 要求或不允许在声明块后面的分号。

Block

  • block-closing-brace-empty-line-before: 要求或不允许关闭括号前空一行。
  • block-closing-brace-newline-after: 需要一个换行符或不允许关闭括号后的空白。
  • block-closing-brace-newline-before: 需要一个换行符或不允许空白关闭括号前的块。
  • block-closing-brace-space-after: 需要一个空间或不允许关闭括号后的空白块。
  • block-closing-brace-space-before: 在关闭括号前的块需要一个空格或者不允许空白。
  • block-no-empty: 不允许空块
  • block-no-single-line: 不允许单行块
  • block-opening-brace-newline-after: 开括号的块之后需要新的一行。
  • block-opening-brace-newline-before: 开括号的块之后需要一个换行符或不允许空白
  • block-opening-brace-space-after: 开括号的块之后需要一个空格或不允许空白。
  • block-opening-brace-space-before: 开括号的块之前需要一个空格或不允许空白。

Selector

  • selector-attribute-brackets-space-inside: 在括号里的属性选择器需要一个空格或者不允许空白。
  • selector-attribute-operator-blacklist: 指定一个黑名单不允许属性的操作符。
  • selector-attribute-operator-space-after: 需要一个空间或不允许空格后运营商在属性选择器。
  • selector-attribute-operator-space-before: 需要一个空间或不允许空格内运营商之前属性选择器。
  • selector-attribute-operator-whitelist: 指定一个属性允许运营商的白名单。
  • selector-attribute-quotes: 需要或不允许引用属性值。
  • selector-class-pattern: 指定一个模式类选择符。
  • selector-combinator-space-after: 需要一个空间或不允许空格后的组合子选择器。
  • selector-combinator-space-before: 需要一个空间或不允许空格前的组合子选择器。
  • selector-descendant-combinator-no-non-space: 不允许的字符的后代组合子选择器进行技术改造。
  • selector-id-pattern: 指定一个模式,id选择器。
  • selector-max-compound-selectors: 在一个选择器里面限制复合选择器的数量。
  • selector-max-specificity: 限制的特异性选择器。
  • selector-nested-pattern: 指定一个模式选择器的规则嵌套规则。
  • selector-no-attribute: 不允许属性选择器。
  • selector-no-combinator: 不允许在选择器组合。
  • selector-no-id: 不允许id选择器。
  • selector-no-qualifying-type: 不允许符合条件的选择器的类型。
  • selector-no-type: 不允许类型选择器。
  • selector-no-universal: Disallow the universal selector.
  • selector-no-vendor-prefix: 不允许选择器的前缀。
  • selector-pseudo-class-blacklist: 指定一个黑名单禁止伪类选择器。
  • selector-pseudo-class-case: 为伪类选择器指定小写或大写。
  • selector-pseudo-class-no-unknown: 不允许未知的伪类选择器。
  • selector-pseudo-class-parentheses-space-inside: 需要一个空格或不允许空格在括号里面的伪类选择器。
  • selector-pseudo-class-whitelist: 伪类选择器允许指定一个白名单。
  • selector-pseudo-element-case: 为伪元素选择器指定小写或大写。
  • selector-pseudo-element-colon-notation: 为适用的伪元素指定单引号或双冒号符号。
  • selector-pseudo-element-no-unknown: 不允许未知的伪元素选择器。
  • selector-root-no-composition: 在选择器不允许根的构成。
  • selector-type-case: 指定小写或大写类型选择器。
  • selector-type-no-unknown: 不允许未知类型选择器。
  • selector-max-empty-lines: 限制内相邻的空行选择器的数量。

Selector list

  • selector-list-comma-newline-after: 需要一个换行符或不允许空白选择逗号后的列表。
  • selector-list-comma-newline-before: 逗号前需要一个换行符或不允许空白选择器列表。
  • selector-list-comma-space-after: 需要一个空格或者逗号后不允许空格选择器列表。
  • selector-list-comma-space-before: 需要一个空格或者逗号前不允许空格选择器列表。

Root rule

  • root-no-standard-properties: 根规则内不允许标准属性。

Rule

  • rule-nested-empty-line-before: 需要或不允许嵌套规则前空一行。
  • rule-non-nested-empty-line-before: 需要或不允许non-nested规则前空一行。

Media feature

  • media-feature-colon-space-after: 需要一个空间或不允许空格在冒号之后媒体的特性。
  • media-feature-colon-space-before: 需要一个空间或不允许空格在冒号之前媒体的特性。
  • media-feature-name-case: 为媒体特性名称指定小写或大写。
  • media-feature-name-no-unknown: 不允许未知的媒体功能的名字。
  • media-feature-name-no-vendor-prefix: 不允许媒体特性名称的前缀。
  • media-feature-no-missing-punctuation: 不允许标点non-boolean媒体功能
  • media-feature-parentheses-space-inside: 需要一个空间或不允许空格在括号里面的媒体功能。
  • media-feature-range-operator-space-after: 需要一个空间或不允许空白范围运算符后媒体的特性。
  • media-feature-range-operator-space-before: 之前需要一个空间或不允许空格符范围在媒体功能。

Custom media

  • custom-media-pattern: 为定制媒体查询名称指定一个模式。

Media query list

  • media-query-list-comma-newline-after: 需要一个换行符或不允许空格后媒体查询的逗号分隔列表。
  • media-query-list-comma-newline-before: 需要一个换行符或不允许空格之前媒体查询的逗号分隔列表
  • media-query-list-comma-space-after: 需要一个空间或不允许空格后媒体查询的逗号分隔列表。
  • media-query-list-comma-space-before:需要一个空间或不允许空格之前媒体查询的逗号分隔列表。

At-rule

  • at-rule-blacklist: 不允许at-rules指定一个黑名单。
  • at-rule-empty-line-before: 需要或不允许at-rules前空一行。
  • at-rule-name-case: 指定at-rules小写或大写的名字。
  • at-rule-name-newline-after: at-rule名称后需要一个换行符。
  • at-rule-name-space-after: 需要一个空格后at-rule名称。
  • at-rule-no-unknown: 不允许at-rules不明。
  • at-rule-no-vendor-prefix: 不允许at-rules前缀。
  • at-rule-semicolon-newline-after: 需要一个换行符之后at-rules的分号。
  • at-rule-whitelist: 指定允许at-rules的白名单。

stylelint-disable comment

  • stylelint-disable-reason: 需要一个理由stylelint-disable之前或之后的评论发表评论。

Comment

  • comment-empty-line-before: 需要或不允许评论之前一个空行。
  • comment-no-empty: 不允许空的评论。
  • comment-whitespace-inside:需要或不允许空格里面的注释标记。
  • comment-word-blacklist: 指定一个黑名单内不允许的话评论。

General / Sheet

  • indentation: 指定缩进。
  • max-empty-lines: 限制数量的相邻的空行。
  • max-line-length: 限制线的长度。
  • max-nesting-depth: 限制的深度嵌套。
  • no-browser-hacks: 不允许浏览器黑客,无关你目标的浏览器。
  • no-descending-specificity: 不允许选择器之后覆盖选择器的低特异性更高的特异性。
  • no-duplicate-selectors: 不允许重复的选择器。
  • no-empty-source: 不允许空的来源。
  • no-eol-whitespace: 不允许行尾空白。
  • no-extra-semicolons: 不允许额外的分号。
  • no-indistinguishable-colors: 不允许产品极其接近的颜色相同。
  • no-invalid-double-slash-comments: 不允许双斜杠注释(/ /…)不支持CSS。
  • no-missing-end-of-source-newline: 不允许丢失end-of-source换行。
  • no-unknown-animations: 不允许动画名称不对应@keyframes声明。
  • no-unsupported-browser-features: 不允许功能的浏览器不支持的目标。

官方配置标准文件

stylelint-config-standard

module.exports = {
    "rules": {
        "at-rule-empty-line-before": [ "always", {
        except: [
            "blockless-after-same-name-blockless",
            "first-nested",
            ],
            ignore: ["after-comment"],
        } ],
        "at-rule-name-case": "lower",
        "at-rule-name-space-after": "always-single-line",
        "at-rule-semicolon-newline-after": "always",
        "block-closing-brace-empty-line-before": "never",
        "block-closing-brace-newline-after": "always",
        "block-closing-brace-newline-before": "always-multi-line",
        "block-closing-brace-space-before": "always-single-line",
        "block-no-empty": true,
        "block-opening-brace-newline-after": "always-multi-line",
        "block-opening-brace-space-after": "always-single-line",
        "block-opening-brace-space-before": "always",
        "color-hex-case": "lower",
        "color-hex-length": "short",
        "color-no-invalid-hex": true,
        "comment-empty-line-before": [ "always", {
            except: ["first-nested"],
            ignore: ["stylelint-commands"],
        } ],
        "comment-no-empty": true,
        "comment-whitespace-inside": "always",
        "custom-property-empty-line-before": [ "always", {
             except: [
                "after-custom-property",
                "first-nested",
             ],
            ignore: [
                "after-comment",
                "inside-single-line-block",
            ],
        } ],
        "declaration-bang-space-after": "never",
        "declaration-bang-space-before": "always",
        "declaration-block-no-duplicate-properties": [ true, {
            ignore: ["consecutive-duplicates-with-different-values"],
        } ],
        "declaration-block-no-ignored-properties": true,
        "declaration-block-no-redundant-longhand-properties": true,
        "declaration-block-no-shorthand-property-overrides": true,
        "declaration-block-semicolon-newline-after": "always-multi-line",
        "declaration-block-semicolon-space-after": "always-single-line",
        "declaration-block-semicolon-space-before": "never",
        "declaration-block-single-line-max-declarations": 1,
        "declaration-block-trailing-semicolon": "always",
        "declaration-colon-newline-after": "always-multi-line",
        "declaration-colon-space-after": "always-single-line",
        "declaration-colon-space-before": "never",
        "declaration-empty-line-before": [ "always", {
            except: [
                "after-declaration",
                "first-nested",
            ],
            ignore: [
                "after-comment",
                "inside-single-line-block",
            ],
        } ],
        "function-calc-no-unspaced-operator": true,
        "function-comma-newline-after": "always-multi-line",
        "function-comma-space-after": "always-single-line",
        "function-comma-space-before": "never",
        "function-linear-gradient-no-nonstandard-direction": true,
        "function-max-empty-lines": 0,
        "function-name-case": "lower",
        "function-parentheses-newline-inside": "always-multi-line",
        "function-parentheses-space-inside": "never-single-line",
        "function-whitespace-after": "always",
        "indentation": 2,
        "keyframe-declaration-no-important": true,
        "length-zero-no-unit": true,
        "max-empty-lines": 1,
        "media-feature-colon-space-after": "always",
        "media-feature-colon-space-before": "never",
        "media-feature-name-case": "lower",
        "media-feature-name-no-unknown": true,
        "media-feature-no-missing-punctuation": true,
        "media-feature-parentheses-space-inside": "never",
        "media-feature-range-operator-space-after": "always",
        "media-feature-range-operator-space-before": "always",
        "media-query-list-comma-newline-after": "always-multi-line",
        "media-query-list-comma-space-after": "always-single-line",
        "media-query-list-comma-space-before": "never",
        "no-empty-source": true,
        "no-eol-whitespace": true,
        "no-extra-semicolons": true,
        "no-invalid-double-slash-comments": true,
        "no-missing-end-of-source-newline": true,
        "number-leading-zero": "always",
        "number-no-trailing-zeros": true,
        "property-case": "lower",
        "property-no-unknown": true,
        "rule-nested-empty-line-before": [ "always-multi-line", {
            except: ["first-nested"],
            ignore: ["after-comment"],
        } ],
        "rule-non-nested-empty-line-before": [ "always-multi-line", {
            ignore: ["after-comment"],
        } ],
        "selector-attribute-brackets-space-inside": "never",
        "selector-attribute-operator-space-after": "never",
        "selector-attribute-operator-space-before": "never",
        "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-space-before": "never",
        "selector-max-empty-lines": 0,
        "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,
        "selector-type-case": "lower",
        "selector-type-no-unknown": true,
        "shorthand-property-no-redundant-values": true,
        "string-no-newline": true,
        "unit-case": "lower",
        "unit-no-unknown": true,
        "value-list-comma-newline-after": "always-multi-line",
        "value-list-comma-space-after": "always-single-line",
        "value-list-comma-space-before": "never",
        "value-list-max-empty-lines": 0,
    },
}