Registry / testing / grunt-scss-lint

grunt-scss-lint

JSON →
library0.5.0jsnpmunverified

A Grunt plugin that wraps the Ruby scss-lint gem (scss_lint) to validate .scss files. Version 0.5.0 is the last release before deprecation; requires Ruby >= 1.9, scss_lint gem, and Grunt >= 0.4.0. Provides options like bundleExec, colorizeOutput, compact reporting, config, gemVersion, exclude, reporterOutput, emitError/emitSuccess, and failOnWarning. It runs the Ruby gem as a child process, so it's slower than pure JS linters like stylelint; it relies on an external Ruby dependency and is unmaintained.

npm install grunt-scss-lint
INSTALL
IMPORT
SIG · GRUNT-SCSS-LINT
G
grunt-scss-lint
testingjavascriptv0.5.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

grunt-scss-lint
grunt.loadNpmTasks('grunt-scss-lint');
require('grunt-scss-lint');
This is a Grunt plugin, not a Node.js module. It is loaded via loadNpmTasks in Gruntfile, not required.
scsslint task
grunt.initConfig({ scsslint: { all: { src: ['src/**/*.scss'] } } });
grunt.initConfig({ 'grunt-scss-lint': { ... } });
The task name is 'scsslint', not the package name. Configure it under the 'scsslint' key.
Options
scsslint: { options: { config: '.scss-lint.yml' }, all: { src: ['*.scss'] } }
scsslint: { config: '.scss-lint.yml', all: { ... } }
Options must be nested under an 'options' key within the target or at the task level.

Basic Gruntfile configuration to lint all .scss files with scss-lint using the grunt-scss-lint plugin.

// Install: npm install grunt-scss-lint --save-dev // In Gruntfile.js module.exports = function(grunt) { grunt.loadNpmTasks('grunt-scss-lint'); grunt.initConfig({ scsslint: { all: { src: ['src/**/*.scss'], options: { config: '.scss-lint.yml', colorizeOutput: true, failOnWarning: true } } } }); grunt.registerTask('default', ['scsslint']); };
grunt --version
Debug
Known issues
deprecatedThis plugin is unmaintained and deprecated. The scss-lint gem is also deprecated; use stylelint or Dart Sass instead.
fix
Migrate to stylelint with scss plugin: https://github.com/stylelint-scss/stylelint-scss
affects: >=0
breakingRequires Ruby and scss_lint gem. If Ruby is not installed or the gem is missing, the task fails with 'Cannot find scss-lint'.
fix
Install Ruby and run 'gem install scss_lint' or ensure bundler is configured correctly.
affects: >=0
breakingThe gem was renamed from scss-lint to scss_lint. Older versions may try to execute the wrong command.
fix
Upgrade to version 0.3.7+ or set the 'gemVersion' option to avoid confusion.
affects: <0.3.7
gotchaOn Windows, colorizeOutput requires extra gems (windows-pr, win32console). Output may be garbled if those are missing.
fix
Set colorizeOutput: false on Windows or install 'gem install windows-pr win32console'.
affects: >=0
gotchaThe 'config' option default points to a bundled YAML file inside node_modules. Override to use your own configuration.
fix
Explicitly set config: '.scss-lint.yml' in your Gruntfile options.
affects: >=0
breakingBy default, task fails on warnings (failOnWarning: true). Many users expect only errors to cause failure.
fix
Set failOnWarning: false in options to fail only on errors.
affects: >=0.5.0
Errors
Common errors & fixes
Warning: Cannot find module 'grunt-scss-lint' Use --force to continue.
Missing npm package installation or loadNpmTasks with wrong name.
fix
Run 'npm install grunt-scss-lint --save-dev' and ensure grunt.loadNpmTasks('grunt-scss-lint') is called.
Warning: Cannot find scss-lint. Use --force to continue.
The Ruby gem scss_lint is not installed or not in PATH.
fix
Install the gem: 'gem install scss_lint' or use bundleExec with Bundler.
Fatal error: scss-lint exited with code 1.
SCSS file has lint errors or warnings (and failOnWarning is true).
fix
Fix the reported issues in your .scss files or disable failOnWarning if warnings are acceptable.
Warning: The --compact flag is not supported by your version of scss-lint.
The installed scss_lint gem version does not support the compact output option.
fix
Set compact: false in options, or update the scss_lint gem to a compatible version.
Upgrade
Version history
0.5.0latest on npm
Audit
Dependencies
gruntrequiredGrunt plugin: requires Grunt >=0.4.0 as a peer dependency
rubyrequiredRequires Ruby runtime to execute the scss_lint gem
scss_lintrequiredThe actual linting engine; must be installed as a Ruby gem
Agent activity
4 hits · last 30 days
node
4
Resources
grunt-scss-lint — npm install grunt-scss-lint · libregistry