Registry / testing / eslint-plugin-coffee

eslint-plugin-coffee

JSON →
library0.1.15jsnpmunverified

An ESLint plugin that provides a custom parser and rules for linting CoffeeScript source files. Version 0.1.15 requires CoffeeScript >=2.5.0 and ESLint >=6.0.0. It adapts the CoffeeScript compiler's AST to be compatible with ESLint, enabling many existing ESLint rules to work with CoffeeScript, and also supplies CoffeeScript-specific rules and compatible versions of rules from popular plugins like eslint-plugin-react, eslint-plugin-import, eslint-plugin-react-native, and eslint-plugin-jsx-a11y. The project is actively maintained with recent fixes for code path analysis and shorthand-this rule.

npm install eslint-plugin-coffee
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-COFF
E
eslint-plugin-coffee
testingjavascriptv0.1.15
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

plugin
// In .eslintrc: { "plugins": ["coffee"], "parser": "eslint-plugin-coffee/parser" }
Using require('eslint-plugin-coffee') as a parser without specifying plugin
This package exposes a custom parser at 'eslint-plugin-coffee/parser' and a plugin. Configure both in ESLint config.
parser
import parser from 'eslint-plugin-coffee/parser'
const parser = require('eslint-plugin-coffee/parser')
The parser is an ESM module; use import or configure via parser path in ESLint config (automatic).
rules
// Access rules via 'eslint-plugin-coffee' plugin, e.g., rules: { 'coffee/rule-name': 'error' }
Direct import of rules: import { rules } from 'eslint-plugin-coffee'
Rules are part of the plugin and should be configured under 'coffee/' prefix, not imported directly.

Configures ESLint to lint CoffeeScript files using the custom parser and the eslint-plugin-coffee plugin, with a mix of CoffeeScript-specific and standard ESLint rules.

// Install dependencies: // npm install --save-dev coffeescript@^2.5.0 eslint@^6.0.0 eslint-plugin-coffee // .eslintrc.json { "parser": "eslint-plugin-coffee/parser", "plugins": ["coffee"], "rules": { "coffee/boolean-keywords": "error", "coffee/no-danger-with-children": "warn", "coffee/shorthand-this": "error", "semi": "error", "no-unused-vars": "error" } } // Example CoffeeScript file (test.coffee): # This will lint with ESLint rules x = 5 console.log x // To lint: // npx eslint test.coffee
Debug
Known issues
deprecatedThe `id-length` rule was changed to not be recommended (v0.1.13).
fix
If you relied on `id-length` being recommended, you must explicitly enable it: `'coffee/id-length': 'error'`.
affects: >=0.1.13
gotchaNot all ESLint rules work out of the box; many require CoffeeScript-compatible custom alternatives provided by this plugin.
fix
Check the supported rules list in the README before enabling standard rules. Use `'coffee/rule-name'` for compatible versions.
affects: >=0.1.0
breakingRequires CoffeeScript >=2.5.0 and ESLint >=6.0.0; does not work with older versions.
fix
Ensure your project uses CoffeeScript 2.5.0+ and ESLint 6.0.0+.
affects: >=0.1.0
gotchaThe parser may not fully support the latest CoffeeScript syntax or all ES modern features.
fix
Refer to the README for supported CoffeeScript version and be aware that some newer CoffeeScript features might not be linted correctly.
affects: >=0.1.0
deprecatedThe `no-danger-with-children` rule now handles spread props correctly since v0.1.13.
fix
Update to v0.1.13 or later to get proper handling of spread props.
affects: <0.1.13
breakingESLint code path analysis monkeypatching issue was fixed in v0.1.14.
fix
Update to v0.1.14 or later to avoid potential crashes with code path analysis.
affects: <0.1.14
gotchaThe plugin only supports CommonJS modules for now; ESM projects may need transpilation.
fix
Use CommonJS or transpile your CoffeeScript project before linting.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'eslint-plugin-coffee/parser'
The parser module is not installed or cannot be resolved.
fix
Ensure `eslint-plugin-coffee` is installed as a dev dependency: `npm install --save-dev eslint-plugin-coffee`.
ESLint configuration error: "coffee" plugin not found
The plugin was not added to the `plugins` array.
fix
Add `"plugins": ["coffee"]` to your ESLint config.
Parsing error: Unexpected token
The CoffeeScript file might have syntax that the parser does not support, or the parser is not configured correctly.
fix
Ensure you have set `"parser": "eslint-plugin-coffee/parser"` in your ESLint config and that your CoffeeScript version is >= 2.5.0.
Cannot find module 'coffeescript'
CoffeeScript is not installed or the version is too old.
fix
Run `npm install --save-dev coffeescript@^2.5.0`.
Upgrade
Version history
0.1.15latest on npm
Audit
Dependencies
eslintrequiredpeer dependency: requires ESLint >=6.0.0 to function as a plugin
Agent activity
6 hits · last 30 days
node
6
Resources
eslint-plugin-coffee — npm install eslint-plugin-coffee · libregistry