【问题标题】:scss-lint.yml is not workingscss-lint.yml 不工作
【发布时间】:2016-08-29 21:56:17
【问题描述】:

我在使用 scss-lint 时遇到了小问题,我试图在一个简单的文件中运行,并且在更改了 scss-lint.yml 之后,仍然没有加载我的配置。

scss 文件:_headlines.scss

// Headlines

%headline-primary {
  @include rem-size(60px);
  color: palette(grey, light); 
  font-weight: $font-weight--book;
  line-height: $line-height-base;
  margin-top: 0;
}

scss-lint.yml

# Default application configuration that all configurations inherit from.

scss_files: "scss/**/*.scss"
plugin_directories: ['.scss-linters']

# List of gem names to load custom linters from (make sure they are already
# installed)
plugin_gems: []

# Default severity of all linters.
severity: warning

linters:
  ColorKeyword:
    enabled: false

  ColorVariable:
    enabled: false

使用的命令行:

 scss-lint scss/_headlines.scss 

文件结构:

scss/_headlines.scss:5:1 [W] TrailingWhitespace: Line contains trailing whitespace
scss/_headlines.scss:5:18 [W] ColorKeyword: Color `grey` should be written in hexadecimal form as `#808080`
scss/_headlines.scss:5:18 [W] ColorVariable: Color literals like `grey` should only be used in variable declarations; they should be referred to via variable everywhere else.
scss/_headlines.scss:9:1 [W] FinalNewline: Files should end with a trailing newline

ColorKeyword 在我的 scss-lint.yml 中被定义为 false 但仍在运行有人知道发生了什么?

【问题讨论】:

    标签: css sass scss-lint


    【解决方案1】:

    scss-lint documentation中,指定了以下内容:

    配置

    scss-lint 按以下优先顺序加载配置:

    1. 通过 --config 标志指定的配置文件
    2. 当前工作目录中 .scss-lint.yml 的配置(如果存在)
    3. 来自用户主目录中的 .scss-lint.yml 的配置(如果存在)

    所有配置都扩展了默认配置。

    您当前的工作目录scss-lint-test 中没有.scss-lint.yml。因此,它将使用默认配置。

    要解决此问题,请将您的 YML 文件移动到 scss-lint-test,或从 scss 文件夹运行 scss-lint

    【讨论】:

      猜你喜欢
      • 2015-09-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-27
      • 2016-11-08
      • 2022-01-06
      • 2013-07-10
      相关资源
      最近更新 更多