Registry / testing / coffeelint-cjsx

coffeelint-cjsx

JSON →
library2.0.2jsnpmunverified

A fork of CoffeeLint that adds support for React's CJSX syntax. Version 2.0.2 is the latest stable release; it uses coffee-react-transform 2.x, compatible with React 0.12. The package has irregular releases tied to React version changes. Key differentiators: enables CoffeeScript linting with JSX-like syntax, useful for legacy React projects using CoffeeScript. Current maintainer: Evan Morikawa. Note: This is a fork of the original coffeelint, aiming to merge back when possible.

npm install coffeelint-cjsx
INSTALL
IMPORT
SIG · COFFEELINT-CJSX
C
coffeelint-cjsx
testingjavascriptv2.0.2
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.

CoffeeLint
import CoffeeLint from 'coffeelint-cjsx'
const CoffeeLint = require('coffeelint-cjsx')
Package uses CommonJS, but import works in bundlers. Use require for Node.
lint
import { lint } from 'coffeelint-cjsx'
Named export available for programmatic linting.
CoffeeLint
const CoffeeLint = require('coffeelint-cjsx')
import CoffeeLint from 'coffeelint-cjsx'
CommonJS require is the native import style for this package.

Shows how to require coffeelint-cjsx, lint a CJSX string with custom config, and output errors.

const CoffeeLint = require('coffeelint-cjsx'); const source = '<div>Hello</div>'; const config = { no_plusplus: { level: 'error' } }; try { const errors = CoffeeLint.lint(source, config); errors.forEach(e => console.log(`${e.line}: ${e.message}`)); } catch (err) { console.error('Lint error:', err.message); }
coffeelint --version
Debug
Known issues
breakingv2.0.0 uses coffee-react-transform 2.x, which drops support for React <0.12. Upgrade your React version or use v1.x.
fix
Update React to >=0.12 or stay on coffeelint-cjsx@1.x.
affects: >=2.0.0
deprecatedCoffeeScript itself is deprecated in favor of modern JavaScript/TypeScript. This package is no longer actively developed.
fix
Consider migrating from CoffeeScript to JavaScript or TypeScript.
affects: all
gotchaThe package expects a 'coffeelint.json' config file in the project root; otherwise uses defaults. Missing config may cause unexpected linting errors.
fix
Create a 'coffeelint.json' file with desired rule configurations.
affects: all
gotchaGlobal installation may conflict with other CoffeeLint variants (e.g., original coffeelint). Use local devDependencies.
fix
Install as devDependency: npm install --save-dev coffeelint-cjsx
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'coffee-react-transform'
Missing peer dependency coffee-react-transform.
fix
Run: npm install coffee-react-transform
ReferenceError: CoffeeLint is not defined
Incorrect import or require statement (e.g., using `import` in Node without transpilation).
fix
Use const CoffeeLint = require('coffeelint-cjsx');
Syntax error: unexpected <
CJSX syntax not recognized by CoffeeScript parser; npm install coffee-react-transform might be missing or outdated.
fix
Ensure coffee-react-transform >= 2.0.0 is installed.
coffeelint: command not found
CLI tool not installed globally or in PATH.
fix
Run via npx: npx coffeelint-cjsx or install locally: npm install --save-dev coffeelint-cjsx
Upgrade
Version history
2.0.2latest on npm
Audit
Dependencies
coffee-scriptrequiredRuntime dependency for CoffeeScript parsing
coffee-react-transformrequiredTransforms CJSX to CoffeeScript for linting
globrequiredUsed for file matching in CLI
Agent activity
8 hits · last 30 days
node
6
Amazon
1
OpenAI (training)
1
Resources
coffeelint-cjsx — npm install coffeelint-cjsx · libregistry