grunt-coffeelint
raw JSON → 0.0.16 verified Fri May 01 auth: no javascript maintenance
Grunt plugin to lint CoffeeScript files using CoffeeLint. Current stable version is 0.0.16 (last released June 2016). The package is in maintenance mode with no active development. It supports multitask configuration, per-target options, external config files, and a force option to prevent task failure on lint errors. Unlike running coffeelint directly, this integrates with Grunt's build pipeline.
Common errors
error Warning: Task "coffeelint" not found. ↓
cause grunt.loadNpmTasks('grunt-coffeelint') not called or package not installed.
fix
Run npm install grunt-coffeelint --save-dev and add grunt.loadNpmTasks('grunt-coffeelint'); to Gruntfile.
error Fatal error: Unable to load task "coffeelint". ↓
cause Missing peer dependency grunt >=0.4.0.
fix
Ensure Grunt 0.4+ is installed: npm install grunt --save-dev.
error Running "coffeelint:all" (coffeelint) task Warning: coffeelint: Failed to load config file "coffeelint.json" ↓
cause Config file path is incorrect.
fix
Verify configFile path relative to Gruntfile or use absolute path.
Warnings
deprecated Package no longer maintained since 2016. ↓
fix Consider migrating to a modern linter or use coffeelint directly.
gotcha Peer dependency grunt >=0.4.0 required; not compatible with Grunt 0.3.x. ↓
fix Use Grunt 0.4 or later.
gotcha Options from configFile are overridden by task-level options. ↓
fix Be aware of precedence: task options > configFile.
Install
npm install grunt-coffeelint yarn add grunt-coffeelint pnpm add grunt-coffeelint Imports
- coffeelint task wrong
require('grunt-coffeelint');correctgrunt.loadNpmTasks('grunt-coffeelint'); - task configuration wrong
coffeelint: require('grunt-coffeelint').initConfig(...)correctgrunt.initConfig({ coffeelint: { ... } });
Quickstart
// Install: npm install grunt-coffeelint --save-dev
// In Gruntfile.js
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-coffeelint');
grunt.initConfig({
coffeelint: {
options: {
force: false
},
all: ['src/**/*.coffee']
}
});
grunt.registerTask('default', ['coffeelint']);
};