Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install SCSS-Lint with RubyGems, add a .scss-lint.yml file to control its rules, then run scss-lint against your SCSS files. It remains a workable option for existing Ruby Sass projects, but its repository warns that its Ruby Sass dependency limits future compatibility; for a new project, evaluate Stylelint.

What SCSS-Lint does

SCSS-Lint is a command-line linter for files written in SCSS syntax. It checks code against configurable style rules and reports issues with the file, location, severity, linter name, and explanation. It can scan directories and file patterns or read code from standard input. The project also documents hooks, build-tool tasks, and editor integrations. See the SCSS-Lint repository.

Install SCSS-Lint

The documented prerequisites are Ruby 2.4 or newer, Sass 3.5.5 or newer, and SCSS-formatted files. These requirements refer to the tool’s documented Ruby Sass environment, not indented Sass syntax.

Install globally

gem install scss_lint

Install for a project

Add the gem to your project’s Gemfile, then install the bundle:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
gem 'scss_lint', require: false
bundle install

Keep require: false: SCSS-Lint monkey-patches Sass while traversing its parse tree, so loading it broadly can interfere with other Sass users in the same process.

Run a first scan

Scan a directory

SCSS-Lint searches the directory recursively:

scss-lint app/assets/stylesheets/

Scan selected files

Use a glob to limit the scan to matching files:

scss-lint app/assets/stylesheets/**/*.css.scss

Lint standard input

When piping a file into the command, provide the path SCSS-Lint should associate with the input:

cat some-file.scss | scss-lint --stdin-file-path=path/to/treat/stdin/as/having.scss

The supplied path matters because configuration and exclusions can depend on where a file is located.

Configure rules with .scss-lint.yml

By default, SCSS-Lint looks for configuration in this order: a path supplied with --config, .scss-lint.yml in the current working directory, then .scss-lint.yml in the user’s home directory. It loads the first matching file; it does not merge these locations. Configuration extends the tool’s defaults.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For example, this configuration scopes linting to an application’s stylesheets, excludes plugins, disables a rule, and sets indentation to two spaces with warning severity:

scss_files: 'app/assets/stylesheets/**/*.css.scss'
exclude: 'app/assets/stylesheets/plugins/**'

linters:
  BorderZero:
    enabled: false
  Indentation:
    severity: warning
    width: 2

Each linter can be enabled or disabled, and many have rule-specific settings. Severity can be configured globally or for an individual linter. To generate a configuration that disables currently failing linters, use the Config formatter, for example scss-lint --format=Config with the files you want to check. This can help teams adopt rules incrementally.

Make a narrow inline exception

Use inline comments when a specific file, block, or line needs an exception. For example:

// scss-lint:disable BorderZero
// scss-lint:enable BorderZero

Keep exceptions as small as possible and explain unusual ones in code review.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use SCSS-Lint in scripts and CI

The default formatter is suited to local feedback. The project also documents JSON, TAP, Files, CleanFiles, and Config formatters. JSON can feed machine processing; Config can help build an initial baseline.

SCSS-Lint’s exit codes let automation distinguish outcomes:

Exit code Meaning
0 No lints
1 Warnings only
2 One or more errors
64 Invalid command usage
66 Missing files
69 Required library missing
70 Unexpected error
78 Invalid YAML or configuration
80 A glob matched no files

A gradual rollout can start by treating warnings as a baseline while the team tunes configuration, then make errors the failure threshold once the rules are established. That is a workflow choice based on the documented severities and exit codes, not a turnkey CI policy supplied by SCSS-Lint.

Connect it to an editor or build workflow

The project documents integrations for Vim/Syntastic, IntelliJ, Sublime Text, Atom, Emacs/Flycheck, TextMate 2, and Visual Studio Code. It also documents Git hooks through Overcommit, plus Rake and Maven integrations. Choose the integration that fits the repository’s existing toolchain rather than requiring every developer to adopt a new editor plugin.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

SCSS-Lint uses opinionated default rules for consistency and can load custom linters from repository directories or Ruby gems. Its repository documentation describes the available formatters and integrations.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Should a new project use SCSS-Lint or Stylelint?

The practical decision is usually between preserving compatibility in an existing Ruby Sass codebase and choosing a tool with a more current setup for a new project. The SCSS-Lint repository says the Sass core team is building Sass in Dart rather than Ruby and warns that SCSS-Lint’s dependency on Ruby Sass will eventually mean losing support for the latest Sass features and bug fixes. The repository lists version 0.60.0, released January 27, 2023, as its latest release.

Stylelint’s current getting-started guide recommends an npm setup with stylelint and stylelint-config-standard-scss, a stylelint.config.mjs configuration file, and a command like stylelint "**/*.scss". The SCSS configuration provides custom SCSS syntax and SCSS-specific rules. Stylelint’s overview says it parses SCSS, Sass, Less, and SugarSS and includes more than 100 built-in rules for modern CSS syntax. See the Stylelint getting-started guide and Stylelint project overview.

Consideration SCSS-Lint Stylelint
Runtime and package manager Ruby gem Node.js packages installed with npm in the current getting-started guide
Compatibility direction Depends on Ruby Sass; its repository warns this will limit support for newer Sass features and bug fixes Current setup uses the SCSS config package and supports modern CSS tooling
Configuration .scss-lint.yml, with configurable linters, severity, and rule options stylelint.config.mjs in the current getting-started guide, using stylelint-config-standard-scss
CI behavior Documented exit codes distinguish warnings, errors, and command or configuration failures not stated in the cited Stylelint getting-started guide
Editor integrations Project documents integrations for several editors and build workflows not stated in the cited Stylelint getting-started guide
Migration effort Existing rules and exceptions live in .scss-lint.yml Moving requires translating configuration and checking rule differences; direct compatibility is not established by the cited setup guides

For a maintained legacy repository already built around Ruby Sass and .scss-lint.yml, continuity may outweigh switching costs. For a new repository, the Ruby Sass maintenance warning makes Stylelint the stronger candidate to evaluate. A migration is not just a package swap: teams should map their existing rules and inline exceptions to the new configuration and verify behavior against their own files.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.