我应该如何使用 stylelint 检查 SASS 文件中的缩进?

How I should check indentation in SASS file with stylelint?

我尝试使用 stylelint 检查我的 SASS 文件。当我设置规则

"indentation": "tab"

stylelint 抛出下一个错误

 2:1   ✖  Expected indentation of 1 tab   indentation
 3:1   ✖  Expected indentation of 1 tab   indentation
 5:1   ✖  Expected indentation of 1 tab   indentation
 8:3   ✖  Expected indentation of 1 tab   indentation
11:3   ✖  Expected indentation of 1 tab   indentation
14:3   ✖  Expected indentation of 1 tab   indentation
....

如何正确检查缩进?

更新: 样式顶部:

@import "theme/bootstrap"
@import "theme/bootstrap-theme"
@import "theme/theme"

@keyframes hide-notifi

    0%
        top: 0

    75%
        top: 0

    100%
        top: -100%

stylelint 目前与基于空格的 SASS 语法不兼容。

引用stylelint.io网站:

Understands CSS-like syntaxes: The linter is powered by PostCSS, so it understands any syntax that PostCSS can parse, including SCSS, SugarSS, and experimental support for Less.

您可以采用 SugarSS, which is a whitespace-based syntax. When combined with the precss PostCSS plugin pack,您将拥有与基于空白的 SASS 相媲美的东西。

另一种选择是向 PostCSS 社区贡献一个 SASS 解析器。

或者,您可以使用 SASS-lint,它支持 SASS 语法,但具有与 stylelint 不同的一组功能。