Sass Lint

A Node-only Sass linter for both sass and scss syntax!

Version

1.12.1

Runtime

Node.js v10.15.3 npm 6.4.1

Supported Languages

CSS

Official Documentation

https://github.com/sasstools/sass-lint/tree/v1.11.1

YAML Configuration

sass-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 -c, --config options.

  • 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:

    -c, --config [path]       path to custom config file
    -i, --ignore [pattern]    pattern to ignore. For multiple ignores, separate each pattern by `, ` within a string
    -s, --syntax [syntax]     syntax to evaluate the file(s) with (either sass or scss)
    

    Note: Specifying the --max-warnings option has no effect on Inspecode, therefore the option is deprecated. Instead, consider using num-issues: as described below for telling Inspecode the threshod of the number of warnings.

  • thresholds:

    • num-issues:

      No tool specific severity levels are available.

  • 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:
          • **/.sass-lint.yml
          • **/.sasslintrc
          • Files specified to sasslintConfig option in package.json at the repository root

YAML Examples

  • With default options:

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

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

    inspecode:
      sass-lint:
        options:
          --ignore:
            - tests/**/*.scss
            - dist/other.scss
    
  • With a configuration file:

    inspecode:
      sass-lint:
        config-file: app/config/.sass-lint.yml
    

    The above configuration is equivalent to:

    inspecode:
      sass-lint:
        options:
          --config: app/config/.sass-lint.yml
    
  • With a threshold of the number of warnings (the alternative to --max-warnings 100):

    inspecode:
      sass-lint:
        thresholds:
          num-issues:
            warning: 100
    

Configuration File Detection

If no configuration files are specified via config-file or options field, Inspecode first lets Sass Lint to find configuration files in your repository. See https://github.com/sasstools/sass-lint/tree/v1.11.1#configuring about how Sass Lint looks for configuration files.

In addition, if Sass Lint cannot find any configuration files, Inspecode also walks the file tree in lexical order in your repository to find a configuration file named .sass-lint.yml or .sasslintrc and specifies the file first found to Sass 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:
  sass-lint:
    config-file: ""

results matching ""

    No results matching ""