grunt-coffeelint-cjsx
raw JSON → 0.1.0 verified Fri May 01 auth: no javascript deprecated
Grunt plugin to lint CoffeeScript files with CoffeeLint and React CJSX syntax support. Version 0.1.0, last updated in 2015. Requires Grunt ~0.4 and coffeelint-cjsx ^2.0. Designed for React 0.12 CJSX syntax. No longer maintained; alternatives include eslint-plugin-react for modern React projects.
Common errors
error Warning: Task "coffeelint" not found. ↓
cause grunt.loadNpmTasks('grunt-coffeelint-cjsx') not called or package not installed.
fix
Run
npm install grunt-coffeelint-cjsx --save-dev and add grunt.loadNpmTasks('grunt-coffeelint-cjsx'); to Gruntfile. error Cannot find module 'coffeelint-cjsx' ↓
cause Peer dependency coffeelint-cjsx not installed.
fix
Run
npm install coffeelint-cjsx@^2.0 --save-dev. error Fatal error: Unable to load task 'coffeelint' because of error: TypeError: grunt.file.expand is not a function ↓
cause Incompatible with newer Grunt versions (Grunt 1.x changed internal APIs).
fix
Pin Grunt to ~0.4.x or use an alternative linter.
Warnings
deprecated Package is unmaintained since 2015. Uses outdated CoffeeLint fork for React 0.12 CJSX syntax. ↓
fix Migrate to ESLint with eslint-plugin-react for modern React projects, or use coffeelint directly for CoffeeScript.
breaking Peer dependency coffeelint-cjsx is required and may not be compatible with newer Node.js versions. ↓
fix Ensure coffeelint-cjsx ^2.0 is installed and compatible with your Node.js version (likely Node < 10).
gotcha Configuration key is 'coffeelint' inside grunt.initConfig, not 'coffeelint-cjsx'. ↓
fix Use grunt.initConfig({ coffeelint: { ... } }) as shown in README.
Install
npm install grunt-coffeelint-cjsx yarn add grunt-coffeelint-cjsx pnpm add grunt-coffeelint-cjsx Imports
- default wrong
require('grunt-coffeelint-cjsx')correctgrunt.loadNpmTasks('grunt-coffeelint-cjsx') in Gruntfile.js - coffeelint task wrong
grunt.initConfig({ lint: { ... } })correctgrunt.initConfig({ coffeelint: { ... } })
Quickstart
// In Gruntfile.js
module.exports = function(grunt) {
grunt.initConfig({
coffeelint: {
options: {
configFile: 'coffeelint.json',
force: false
},
app: ['app/**/*.coffee', 'src/**/*.cjsx']
}
});
grunt.loadNpmTasks('grunt-coffeelint-cjsx');
grunt.registerTask('default', ['coffeelint']);
};
// Run: grunt coffeelint