{"id":26666,"library":"xl-gulp-lesshint","title":"gulp-lesshint","description":"Gulp plugin for linting .less files using lesshint. Current stable version is 4.1.3. It runs the lesshint linter on source files and provides reporter and failOnError functionality for Gulp pipelines. Key differentiators: integrates smoothly with Gulp, supports custom config path, maxWarnings, and multiple reporters. Compared to other Less linters (e.g., stylelint with less syntax), it is dedicated to Less and uses lesshint's own rules.","status":"active","version":"4.1.3","language":"javascript","source_language":"en","source_url":"https://github.com/lesshint/gulp-lesshint","tags":["javascript","gulp","gulpplugin","less","lesshint","lint","linter"],"install":[{"cmd":"npm install xl-gulp-lesshint","lang":"bash","label":"npm"},{"cmd":"yarn add xl-gulp-lesshint","lang":"bash","label":"yarn"},{"cmd":"pnpm add xl-gulp-lesshint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core dependency for creating Gulp plugin errors","package":"plugin-error","optional":false},{"reason":"Used for logging messages in the Gulp stream","package":"fancy-log","optional":false},{"reason":"Peer dependency for linting Less files","package":"lesshint","optional":false}],"imports":[{"note":"CommonJS module; use require in Node.js environments. ESM named import is not supported.","wrong":"import lesshint from 'gulp-lesshint'; // This package does not export a default ESM export.","symbol":"default (lesshint function)","correct":"const lesshint = require('gulp-lesshint');"},{"note":"Reporter can be a string (name of npm package) or a custom reporter function.","wrong":".pipe(lesshint.reporter()) // Works, but uses default stylish. Accepts string or function.","symbol":"lesshint.reporter","correct":".pipe(lesshint.reporter('stylish'))"},{"note":"Call as a function: failOnError(). No arguments.","wrong":"none","symbol":"lesshint.failOnError","correct":".pipe(lesshint.failOnError())"}],"quickstart":{"code":"const gulp = require('gulp');\nconst lesshint = require('gulp-lesshint');\n\nfunction lint() {\n  return gulp.src('src/**/*.less')\n    .pipe(lesshint({ configPath: '.lesshintrc' }))\n    .pipe(lesshint.reporter('lesshint-reporter-stylish'))\n    .pipe(lesshint.failOnError());\n}\n\nexports.lint = lint;","lang":"javascript","description":"This example shows how to set up a Gulp task that lints all .less files in the src directory using a custom config file, reports errors with the stylish reporter, and fails the task on any error."},"warnings":[{"fix":"Ensure Gulp is installed and Gulp tasks are properly defined.","message":"This package is a Gulp plugin and requires Node.js and Gulp. It is not a standalone linter.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Explicitly pass 'stylish' or a custom reporter name.","message":"lesshint.reporter() without arguments still uses default 'lesshint-reporter-stylish' but may be deprecated in future versions.","severity":"deprecated","affected_versions":">=4.0.0"},{"fix":"Upgrade Node.js to version 10 or higher.","message":"Version 4.x drops support for Node.js <10.","severity":"breaking","affected_versions":">=4.0.0 <5.0.0"},{"fix":"Remove any arguments passed to failOnError() call.","message":"lesshint.failOnError() no longer accepts arguments since v4.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Run: npm install lesshint --save-dev","message":"lesshint must be installed separately as a peer dependency; it is not bundled.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run: npm install gulp-lesshint --save-dev","cause":"Package is not installed in node_modules.","error":"Error: Cannot find module 'gulp-lesshint'"},{"fix":"Use: const lesshint = require('gulp-lesshint');","cause":"Module may be imported incorrectly (e.g., trying to use default import instead of require).","error":"TypeError: lesshint.reporter is not a function"},{"fix":"Install the reporter package: npm install lesshint-reporter-<name> --save-dev","cause":"The specified reporter name does not correspond to an installed package or invalid name.","error":"Error: No reporter found for '<reporter-name>'"},{"fix":"Update to the latest version: npm install gulp-lesshint@latest --save-dev","cause":"Using an older version of this plugin (<4.0.0) where failOnError may not exist.","error":"TypeError: lesshint.failOnError is not a function"},{"fix":"Run: npm install lesshint --save-dev","cause":"lesshint peer dependency not installed.","error":"Error: lesshint is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}