gulp-sass-lint
raw JSON → 1.4.0 verified Fri May 01 auth: no javascript maintenance
Gulp plugin for Sass Lint that lints SCSS/SASS files during a Gulp build. Current stable version is 1.4.0, with last release in 2017. It wraps sass-lint and provides Gulp-compatible streaming, formatting, and fail-on-error functionality. Key differentiators: integrates directly into Gulp pipelines, supports custom config files, inline rule disabling via source comments. Compared to stylelint or gulp-stylelint, it is specific to Sass (not PostCSS) and relies on the older sass-lint, which is no longer maintained. Release cadence: low/inactive.
Common errors
error TypeError: gulpSassLint is not a function ↓
cause Using ES import incorrectly expecting named export.
fix
Use default import: import sassLint from 'gulp-sass-lint'
error Cannot find module 'sass-lint' ↓
cause Missing peer dependency sass-lint.
fix
npm install sass-lint --save-dev
error Error: Invalid config file format ↓
cause Config file is not valid YAML or missing required keys.
fix
Ensure .sass-lint.yml is valid and follows sass-lint config spec.
Warnings
deprecated sass-lint is deprecated in favor of stylelint with scss plugin. ↓
fix Migrate to stylelint + @stylistic/stylelint-scss or sass-lint-auto-fix.
gotcha Options object nesting: rules must be inside top-level 'rules', not under 'options.rules'. ↓
fix Pass rules at top level: sassLint({ rules: { 'no-ids': 1 } })
gotcha Config file format: .sass-lint.yml is expected, not .sasslintrc or JSON. ↓
fix Create a .sass-lint.yml file in project root or specify configFile path.
breaking Node.js version support: dropped support for Node <4 in v1.3.0. ↓
fix Use Node.js >=4 or stick to v1.2.x.
Install
npm install gulp-sass-lint yarn add gulp-sass-lint pnpm add gulp-sass-lint Imports
- sassLint wrong
const sassLint = require('gulp-sass-lint').default;correctimport sassLint from 'gulp-sass-lint' - sassLint.format wrong
sassLint.format(writable)correctsassLint.format() - sassLint.failOnError
sassLint.failOnError()
Quickstart
import gulp from 'gulp';
import sassLint from 'gulp-sass-lint';
export default function lint() {
return gulp.src('sass/**/*.scss')
.pipe(sassLint())
.pipe(sassLint.format())
.pipe(sassLint.failOnError());
}