CSSLint

A lint tool performs static analysis of source code and flags patterns that might be errors or otherwise cause problems for the developer.

Version

1.0.5

Runtime

Node.js v6.9.5 npm 3.10.10

Supported Languages

CSS

Official Documentation

https://github.com/CSSLint/csslint/wiki

YAML Configuration

csslint:

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

    --errors=<rule[,rule]+>                  Indicate which rules to include as errors.
    --warnings=<rule[,rule]+>                Indicate which rules to include as warnings.
    --ignore=<rule[,rule]+>                  Indicate which rules to ignore completely.
    --exclude-list=<file|dir[,file|dir]+>    Indicate which files/directories to exclude from being linted.
    --config=<file>                          Reads csslint options from specified file.
  • 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 --config option
        • If none of the above configuration files are found:
          • **/.csslintrc

YAML Examples

  • With default options:

    inspecode:
      csslint: default
  • With custom machine:

    inspecode:
      csslint:
        machine:
          cpu: 1.5 # 1.5 CPU, 5760 MiB RAM
  • With custom options:

    inspecode:
      csslint:
        options:
          --exclude-list:
            - css/external
          --ignore:
            - order-alphabetical
            - ids
  • With a configuration file:

    inspecode:
      csslint:
        config-file: ./my-csslintrc

    The above configuration is equivalent to:

    inspecode:
      csslint:
        options:
          --config: ./my-csslintrc

Configuration File Detection

If no configuration files are specified via config-file or options field, Inspecode first lets CSSLint to find configuration files in your repository. See https://github.com/CSSLint/csslint/wiki/Command-line-interface#configuration-files about how CSSLint looks for configuration files.

In addition, if CSSLint cannot find any configuration files, Inspecode also walks the file tree in lexical order in your repository to find a configuration file named .csslintrc and specifies the file first found to CSSLint 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:
  csslint:
    config-file: ""

results matching ""

    No results matching ""