Get unlimited public & private packages + package-based permissions with npm Pro.Get started »


2.0.2 • Public • Published


CoffeeLint is a style checker that helps keep CoffeeScript code clean and consistent.

This fork adds support for React and CJSX syntax.

v2.0.0 of coffeelint-cjsx uses coffee-react-transform 2.x, which is suitable for React 0.12. It also updates browserify dependencies.

v1.7.0 of coffeelint-cjsx uses coffee-react-transform 1.x, which is suitable for React 0.11

We may merge these changes back into the original clutchski/coffeelint project when a suitable solution has been found.

For guides on installing, using and configuring CoffeeLint, head over here.

To suggest a feature, report a bug, or general discussion, head over here.





  • New rules should be set to a warn level. Developers will expect new changes to NOT break their existing workflow, so unless your change is extremely usefull, default to warn. Expect discussion if you choose to use error.

  • Look at existing rules and test structures when deciding how to name your rule. is used for many tests designed to catch specific errors, whereas is used for tests that are designed to enforce formatting and syntax.


  1. Fork the repo locally.
  2. Run npm install to get dependencies.
  3. Create your rule in a single file as src/rules/, using the existing rules as a guide. You may examine the AST and tokens using
  4. Add your test file to the test directory.
  5. Register your rule in src/
  6. Run your test using ./vowsrunner.js --spec test/
  7. Run the whole tests suite using npm test.
  8. Check that your rule's documentation is generated properly (see Updating documentation when adding a new rule below).
  9. Squash all commits into a single commit when done.
  10. Submit a pull request.

Build Status

Updating documentation when adding a new rule

When adding a new rule, its documentation is specified by setting a description property within its rule property:

module.exports = class NoComment

        name: 'no_comment'
        level: 'ignore'
        message: 'No comment'
        description: """
            Disallows any comment in the code

    tokens: ['#', '###']

    lintToken : (token, tokenApi) ->
        return {context: "Found '#{token[0]}'"}

The description property is a string that can embed HTML code:

description: """
    Disallows any comment in the code. This code would not pass:
    <code>### Some code with comments
    foo = ->
        # some other comments

Coffeelint's website generates each rule's documentation based on this description property.

When adding a new rule, it is suggested that you check that the documentation for your new rule is generated correctly. In order to do that, you should follow these steps:

  • Checkout the branch that contains the changes adding the new rule.
  • Run npm run compile.
  • Checkout the gh-pages branch: git checkout origin/gh-pages.
  • Run cp lib/coffeelint.js js/coffeelint.js.
  • Regenerate the HTML documentation: rake updatehtml. Note that you will probably need to install rake.
  • Open the index.html file with your favorite browser and make sure that your rule's documentation is generated properly.


npm i coffeelint-cjsx

DownloadsWeekly Downloads






Last publish


  • avatar