Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Validate a newline policy after every function definition
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src updated typos
.gitignore inital commit Update
coffeelint.json inital commit

Coffeelint - Newline after Function

Validate a newline policy after every function definition


This CoffeeLint plugin verifies whether or not your function definitions are followed by a newline. You can customise the number of newlines.


[sudo] npm install -g coffeelint-newline-after-function

Note: Right now a Coffeelint plugin cannot be installed as a project dependency and must be installed globally. Perhaps this will be improved in a future version of Coffeelint. If you would like to track progress on this enhancement head over here.


Insert the below configuration into coffeelint.json that you use for linting your scripts:

"newline_after_function": {
    "module": "coffeelint-newline-after-function"
    "value": 1,
    "level": "error",


This code will lint without errors:

class TestClass

  foo : ->


  bar : =>

      console.log("foo bar")

But this will fail:

class TestClass

  foo : ->
    console.log("Oh no! I have linting errors.")


The only configuration option specific to this plugin is the value property. Change this to the number of newlines that you like to be inforced.

By default, Coffeelint will report errors if this rule is not satisfied. You may want to relax this by setting the level to warn in your configuration.


MIT © scalable minds

Something went wrong with that request. Please try again.