{"id":25677,"library":"grunt-lesslint","title":"grunt-lesslint","description":"Grunt task that compiles LESS files and runs CSS Lint on the generated CSS, mapping errors back to the original LESS lines. Version 5.0.0 is the current stable release; the project is in maintenance mode with infrequent updates. Key differentiators: integrates CSS Lint rules with LESS source mapping for line-accurate error reporting, supports failOnWarning/failOnError options for staged rule adoption, and allows configuration of LESS parser options. Alternative tools (e.g., stylelint, lesshint) are more actively maintained.","status":"maintenance","version":"5.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/jgable/grunt-lesslint","tags":["javascript","css","grunt","gruntplugin","less","lint"],"install":[{"cmd":"npm install grunt-lesslint","lang":"bash","label":"npm"},{"cmd":"yarn add grunt-lesslint","lang":"bash","label":"yarn"},{"cmd":"pnpm add grunt-lesslint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; requires Grunt >=0.4.5 to load and run tasks.","package":"grunt","optional":false}],"imports":[{"note":"Grunt plugins are registered via grunt.loadNpmTasks in the Gruntfile, not via require().","wrong":"require('grunt-lesslint')","symbol":"grunt-lesslint","correct":"grunt.loadNpmTasks('grunt-lesslint')"},{"note":"Task name is 'lesslint', not the package name.","wrong":"grunt.initConfig({ 'grunt-lesslint': { ... } })","symbol":"lesslint (task)","correct":"grunt.initConfig({ lesslint: { src: ['src/**/*.less'] } })"},{"note":"CSS Lint options go under 'csslint', LESS parser options under 'less', and import linting under 'imports'.","wrong":"lesslint: { options: { csslint: { 'known-properties': false, paths: ['includes'] } } }","symbol":"options (csslint, less, imports)","correct":"lesslint: { options: { csslint: { 'known-properties': false }, less: { paths: ['includes'] }, imports: false } }"}],"quickstart":{"code":"// Gruntfile.js\nmodule.exports = function(grunt) {\n  grunt.initConfig({\n    lesslint: {\n      src: ['src/**/*.less'],\n      options: {\n        csslint: {\n          'known-properties': false,\n          csslintrc: '.csslintrc'\n        },\n        less: {\n          paths: ['includes']\n        },\n        imports: false,\n        failOnWarning: false\n      }\n    }\n  });\n\n  grunt.loadNpmTasks('grunt-lesslint');\n\n  grunt.registerTask('default', ['lesslint']);\n};","lang":"javascript","description":"Example Gruntfile configuration to lint LESS files with custom CSS Lint rules, LESS include paths, import linting disabled, and warnings not failing the build."},"warnings":[{"fix":"Migrate to a more modern linter like stylelint with less syntax support.","message":"CSS Lint is no longer actively maintained; consider switching to stylelint or lesshint.","severity":"deprecated","affected_versions":"all"},{"fix":"Add `imports: true` to lesslint options.","message":"By default, imported files are not linted. Must set `options.imports: true` to lint imports.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `failOnWarning: false` if you only want to allow warnings without failing.","message":"Setting `failOnError: false` overrides both warnings and errors; task never fails.","severity":"gotcha","affected_versions":">=5.0.0"},{"fix":"Update any scripts parsing task output to expect the new format.","message":"Version 5.0.0 changed the summary output format and introduced `failOnWarning` option. Old summary format (e.g., '58 lint issues in 167 files (0 errors, 58 warnings)') is now used instead of previous format.","severity":"breaking","affected_versions":">=5.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Set `failOnWarning: false` to allow warnings without failure, or fix the lint issues.","cause":"Lint errors or warnings are present and failOnWarning defaults to true.","error":"Warning: Task \"lesslint\" failed. Use --force to continue."},{"fix":"Run `npm install grunt-lesslint --save-dev` and ensure `grunt.loadNpmTasks('grunt-lesslint')` is in Gruntfile.","cause":"Package not installed or not properly loaded.","error":"Cannot find module 'grunt-lesslint'"},{"fix":"Install csslint: `npm install csslint --save-dev`.","cause":"Missing peer dependency csslint or incompatible version installed.","error":"Fatal error: Unable to find a valid version for CSS Lint."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}