Registry / testing / grunt-lesshint

grunt-lesshint

JSON →
library2.0.0jsnpmunverified

Lint LESSCSS files with Grunt. Version 2.0.0 requires Node >= 4.0.0 and Grunt ~0.4.5. This plugin integrates the lesshint linter into the Grunt build system, providing a task named 'lesshint' for checking LESS files. Options include force (continue on errors), reporter (custom error formatting), lesshintrc (configuration file), and allowWarnings (allow warnings without failure). Release history shows updates to lesshint v3.0.0 and support for custom reporters and allowing warnings. Less frequently updated; last release 2017.

npm install grunt-lesshint
INSTALL
IMPORT
SIG · GRUNT-LESSHINT
G
grunt-lesshint
testingjavascriptv2.0.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-lesshint task
grunt.loadNpmTasks('grunt-lesshint');
const lesshint = require('grunt-lesshint');
Grunt plugin, not a Node module. Load via grunt.loadNpmTasks.
LesshintTaskConfig
// Define task in grunt.initConfig lesshint: { options: {}, your_target: { src: ['**/*.less'] } }
grunt.initConfig({ lesshint: { ... } }) is correct; no separate import for config type.
Configuration is plain object, not a class.

Gruntfile configuration for grunt-lesshint task linting all .less files in src/.

// Install: npm install grunt-lesshint --save-dev // In Gruntfile: module.exports = function(grunt) { grunt.loadNpmTasks('grunt-lesshint'); grunt.initConfig({ lesshint: { options: { force: true, lesshintrc: true }, all: { src: ['src/**/*.less'] } } }); grunt.registerTask('default', ['lesshint']); };
Debug
Known issues
gotchaTask 'lesshint' fails build on lint errors by default.
fix
Set 'force: true' in options to continue despite errors.
affects: >=0.0.0
gotchaRequires Grunt ~0.4.5; incompatible with Grunt 1.x?
fix
Check package.json peerDependencies; use Grunt 0.4.5 or later but note v1.2.0+ compatible with Grunt 1.0.0.
affects: >=2.0.0
deprecatedNot updated since 2017; lesshint may have breaking changes.
fix
Consider migrating to standalone lesshint or an alternative linter.
affects: >=1.5.1
Errors
Common errors & fixes
Warning: Task "lesshint" not found.
Forgot to call grunt.loadNpmTasks('grunt-lesshint');
fix
Add grunt.loadNpmTasks('grunt-lesshint'); in Gruntfile.
Fatal error: lesshint is not a function
Incompatible lesshint version or missing peer dep.
fix
npm install lesshint@3.0.0 --save-dev and ensure version matches plugin.
Upgrade
Version history
2.0.0latest on npm
Audit
Dependencies
lesshintrequiredCore linting logic; peer dependency
gruntrequiredGrunt plugin; peer dependency
Agent activity
4 hits · last 30 days
node
4
Resources
grunt-lesshint — npm install grunt-lesshint · libregistry