gulp-bemlinter

raw JSON →
2.0.0-beta.3 verified Fri May 01 auth: no javascript

A Gulp plugin to lint BEM component isolation in CSS/SCSS files. Version 2.0.0-beta.3, moderate release cadence. Wraps the base bemlinter package. Differentiators: specifically targets BEM methodology violations in SCSS files, integrates with Gulp task runners.

error TypeError: bemlinter(...).pipe is not a function
cause Calling bemlinter() without require correctly
fix
Ensure proper require: const bemlinter = require('gulp-bemlinter');
error Error: Cannot find module 'bemlinter'
cause Missing dependency bemlinter
fix
Run: npm install bemlinter
deprecated gulp-bemlinter is a wrapper around the deprecated bemlinter package
fix Consider migrating to a maintained linter like stylelint
breaking Breaking changes: 2.0.0-beta versions may have unstable API
fix Pin to exact version or use 1.x
gotcha Requires SCSS files; CSS-only files may not be analyzed correctly
fix Ensure file extensions are .scss
npm install gulp-bemlinter
yarn add gulp-bemlinter
pnpm add gulp-bemlinter

Shows basic Gulp task using gulp-bemlinter to lint SCSS files, format results, and fail on errors.

const gulp = require('gulp');
const bemlinter = require('gulp-bemlinter');

gulp.task('lint', () => {
  return gulp.src('styles/**/*.scss')
    .pipe(bemlinter())
    .pipe(bemlinter.format())
    .pipe(bemlinter.failOnError());
});

gulp.task('default', gulp.series('lint'));