Registry / testing / grunt-sass-lint

grunt-sass-lint

JSON →
library0.2.4jsnpmunverified

Grunt plugin for Node Sass Lint. Version 0.2.4 (latest as of 2021) is the final release; the package is unmaintained and sass-lint is deprecated in favor of stylelint. It allows linting .scss and .sass files with configurable rules, provides multiple formatters (stylish, junit, etc.), and integrates directly into Grunt workflows. However, both the plugin and its underlying linter are no longer active; stylelint with scss plugin is the recommended replacement.

npm install grunt-sass-lint
INSTALL
IMPORT
SIG · GRUNT-SASS-LINT
G
grunt-sass-lint
testingjavascriptv0.2.4
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-sass-lint
grunt.loadNpmTasks('grunt-sass-lint');
grunt.loadNpmTasks('grunt-sasslint');
The task name in Grunt is 'sasslint', but the NPM package is 'grunt-sass-lint'.
sasslint
grunt.initConfig({ sasslint: { ... } });
grunt.initConfig({ sasslint: { ... } });
The Grunt task name is 'sasslint' (without hyphen).
options
sasslint: { options: { configFile: '.sass-lint.yml', formatter: 'junit' }, target: ['src/**/*.scss'] }
sasslint: { options: { configFile: '.sass-lint.yml' } }
The 'target' property is required; without it, no files are linted.

Basic Grunt task configuration to lint all .scss files in src/ using .sass-lint.yml config.

module.exports = function(grunt) { grunt.initConfig({ sasslint: { options: { configFile: '.sass-lint.yml', formatter: 'stylish' }, target: ['src/**/*.scss'] } }); grunt.loadNpmTasks('grunt-sass-lint'); grunt.registerTask('default', ['sasslint']); };
Debug
Known issues
deprecatedsass-lint is deprecated; use stylelint with @stylelint/stylelint-scss instead.
fix
Migrate to stylelint and use stylelint-scss plugin for SCSS linting.
affects: >=0.1.0
deprecatedGrunt-sass-lint is no longer maintained; no updates since 2018.
fix
Move to a different task runner or use stylelint directly via CLI or Grunt-stylelint plugin.
affects: >=0.2.0
gotchaconfigFile option falls back to .sass-lint.yml in project root or 'sasslintConfig' in package.json, but if none exist, the task fails silently.
fix
Always specify a configFile option or create a .sass-lint.yml file.
affects: >=0.1.0
gotchaThe 'target' property must be an array of file patterns; passing a string causes unexpected behavior.
fix
Always use an array: target: ['src/**/*.scss'].
affects: >=0.1.0
breakingNode.js >=0.10.0 required; versions below 4.0 lack error handling for some sass-lint output.
fix
Use Node.js >=4.0.0 for reliable error reporting.
affects: <4.0.0
Errors
Common errors & fixes
Running "sasslint" task Fatal error: Unable to find a valid config file format.
No .sass-lint.yml found and no configFile option set.
fix
Add configFile: '.sass-lint.yml' to the sasslint options.
Warning: Task "sasslint" not found. Use --force to continue.
grunt.loadNpmTasks('grunt-sass-lint') missing or package not installed.
fix
Run `npm install grunt-sass-lint --save-dev` and add `grunt.loadNpmTasks('grunt-sass-lint');` to Gruntfile.
Fatal error: Cannot find module 'sass-lint'
sass-lint peer dependency not installed.
fix
Run `npm install sass-lint --save-dev` alongside grunt-sass-lint.
Upgrade
Version history
0.2.4latest on npm
Audit
Dependencies
sass-lintrequiredCore linting engine; required for all functionality.
Agent activity
4 hits · last 30 days
node
4
Resources
grunt-sass-lint — npm install grunt-sass-lint · libregistry