# coffeelint

> Lint your CoffeeScript

Latest version **2.1.0** (published 2018-02-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install coffeelint
pnpm add coffeelint
yarn add coffeelint
bun add coffeelint
```

Provides the command `coffeelint`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2018-02-16 |
| First published | 2011-12-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6.9.1 |
| Dependencies | 6 |
| Unpacked size | 153.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1210 |
| Author | Matthew Perpick |
| Maintainers | swang |
| Keywords | lint, coffeescript, coffee-script |

## Links

- npm: https://www.npmjs.com/package/coffeelint
- Repository: https://github.com/clutchski/coffeelint
- Homepage: http://www.coffeelint.org
- Issues: https://github.com/clutchski/coffeelint/issues
- npm.io page: https://npm.io/package/coffeelint

## Dependencies (6)

- [glob](https://npm.io/package/glob.md) ^7.0.6
- [ignore](https://npm.io/package/ignore.md) ^3.0.9
- [resolve](https://npm.io/package/resolve.md) ^0.6.3
- [optimist](https://npm.io/package/optimist.md) ^0.6.1
- [coffeescript](https://npm.io/package/coffeescript.md) ^2.1.0
- [strip-json-comments](https://npm.io/package/strip-json-comments.md) ^1.0.2

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 2.1.0 (latest) — 2018-02-16
- 1.16.2 (1.6-republish) — 2018-02-17
- 2.0.7 — 2017-10-28
- 2.0.6 — 2017-10-05
- 2.0.5 — 2017-10-04
- 2.0.4 — 2017-10-04
- 2.0.3 — 2017-10-02
- 2.0.0 — 2017-10-02
- 1.16.0 — 2016-10-02
- 1.15.7 — 2016-04-22
- 1.15.2 — 2016-04-20
- 1.15.1 — 2016-04-19
- 1.15.0 — 2016-03-06
- 1.14.2 — 2015-12-07
- 1.14.1 — 2015-11-19
- … 65 more at https://npm.io/package/coffeelint/versions

## README

CoffeeLint
==========

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

For guides on installing, using and configuring CoffeeLint, head over
[here](http://www.coffeelint.org).

To suggest a feature, report a bug, or general discussion, head over
[here](http://github.com/clutchski/coffeelint/issues/).

## Team

Current:

- [Shuan Wang](https://github.com/swang)

Past:

- [Asa Ayers](https://github.com/AsaAyers) - [You Don't Need CoffeeScript](https://gist.github.com/AsaAyers/d09e4de118b8d6b5e2d8fa3e38e496e0)
- [Matt Perpick](https://github.com/clutchski)

## Contributing

* 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. `no_foo.coffee` is used for many tests designed to catch specific errors, whereas `foo.coffee` is used for tests that are designed to enforce formatting and syntax.

### Steps

1. Fork the repo locally.
2. Run `npm install` to get dependencies.
3. Create your rule in a single file as `src/rules/your_rule_here.coffee`, using the existing
   rules as a guide.
   You may examine the AST and tokens using
   [http://asaayers.github.io/clfiddle/](http://asaayers.github.io/clfiddle/).
4. Add your test file `my_test.coffee` to the `test` directory.
5. Register your rule in `src/coffeelint.coffee`.
6. Run your test using `npm run testrule test/your_test_here.coffee`.
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](https://secure.travis-ci.org/clutchski/coffeelint.svg)](http://travis-ci.org/clutchski/coffeelint)

### 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:
```coffeescript
module.exports = class NoComment

    rule:
        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:
```html
description: '''
	Disallows any comment in the code. This code would not pass:
	<pre>
	<code>### Some code with comments
	foo = ->
		# some other comments
		bar()
	</code>
	</pre>
	'''
```
[Coffeelint's website](http://www.coffeelint.org/) 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.

---
_Source: https://npm.io/package/coffeelint · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
