@coffeelint/cli
Lint your CoffeeScript
Last updated 10 days ago by tonybrix .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @coffeelint/cli 
SYNC missed versions from official npm registry.

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.

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

Team

Current:

Past:

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/.
  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. Submit a pull request.

Github Actions

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

    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:

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 generates each rule's documentation based on this description property.

Current Tags

  • 3.2.6                                ...           latest (10 days ago)
  • 1.16.2                                ...           old (4 months ago)

17 Versions

  • 3.2.6                                ...           10 days ago
  • 3.2.5                                ...           11 days ago
  • 3.2.4                                ...           a month ago
  • 3.2.3                                ...           2 months ago
  • 3.2.2                                ...           2 months ago
  • 3.2.1                                ...           2 months ago
  • 3.2.0                                ...           2 months ago
  • 3.1.3                                ...           2 months ago
  • 3.1.2                                ...           2 months ago
  • 3.1.1                                ...           2 months ago
  • 1.16.2                                ...           4 months ago
  • 1.6.4                                ...           4 months ago
  • 3.1.0                                ...           4 months ago
  • 3.0.2                                ...           4 months ago
  • 3.0.1                                ...           4 months ago
  • 3.0.0                                ...           5 months ago
  • 2.1.0                                ...           5 months ago
Downloads
Today 17
This Week 17
This Month 17
Last Day 0
Last Week 0
Last Month 38
Dependencies (6)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |