SCSS-Lint

SCSS-Lint is a tool to help keep your SCSS files clean and readable by running it against a collection of configurable linter rules.

Version

0.53.0

Runtime

Ruby 2.3.7

Supported Languages

CSS

Official Documentation

https://github.com/brigade/scss-lint/blob/v0.50.3/README.md

YAML Configuration

scss-lint:

  • input:

    Patterns to include in execution and reports.

  • ignore:

    Patterns to exclude from execution and reports.

  • auto-fix:

    N/A

  • config-file:

    Alias of --config option.

  • machine:

    • cpu:

      Amount of CPU. The default machine has 0.25 CPU with 960 MiB RAM.

  • options:

    Below is the list of options that are supported:

    -r, --require path               Require Ruby file
    -i, --include-linter linter,...  Specify which linters you want to run
    -x, --exclude-linter linter,...  Specify which linters you don't want to run
    -c, --config config-file         Specify which configuration file you want to use
    -e, --exclude file,...           List of file names to exclude
  • experimental:

    • incremental:

      true/false

      Note: The incremental analysis is disabled if any kinds of configuration files are changed. The files recognized as configuration files are as follows:

      • Configuration files:
        • Files specified in config-file field
        • Files specified to -c, --config options
        • If none of the above configuration files are found:
          • **/.scss-lint.yml

YAML Examples

  • With default options:

    inspecode:
      scss-lint: default
  • With custom machine:

    inspecode:
      scss-lint:
        machine:
          cpu: 1.5 # 1.5 CPU, 5760 MiB RAM
  • With custom options:

    inspecode:
      scss-lint:
        options:
          --exclude:
            - scss/external/**
          --exclude-linter:
            - PropertySortOrder
            - SpaceAfterComma
            - SpaceAfterComment
  • With a configuration file:

    inspecode:
      scss-lint:
        config-file: ./my-scss-lint.yml

    The above configuration is equivalent to:

    inspecode:
      scss-lint:
        options:
          --config: ./my-scss-lint.yml

Configuration File Detection

If no configuration files are specified via config-file or options field, Inspecode first lets SCSS-Lint to find configuration files in your repository. See https://github.com/brigade/scss-lint/blob/v0.53.0/README.md#configuration about how SCSS-Lint looks for configuration files.

In addition, if SCSS-Lint cannot find any configuration files, Inspecode also walks the file tree in lexical order in your repository to find a configuration file named .scss-lint.yml and specifies the file first found to SCSS-Lint automatically via --config option.

Note: Inspecode ignores specific configuration files while searching. See Configuration > Tool Configuration > Field: config-file for detail.

If the configuration file detected by Inspecode is not the one you want to use or you do not want to use any configuration files, you can disable Inspecode from detecting configuration files by explicitly setting an empty string to config-file field like below:

inspecode:
  scss-lint:
    config-file: ""

results matching ""

    No results matching ""