Git Product home page Git Product logo

coffeelint-limit-newlines's Introduction

CoffeeLint - Limit number of newlines

Description

This CoffeeLint plugin checks to make sure there aren't to many blank newlines in your coffeescript file.

Installation

npm install coffeelint-limit-newlines

Usage

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

"limit_newlines": {
    "module": "coffeelint-limit-newlines",
    "level": "error",
    "value": 5 //number of newlines allowed
}

Configuration

The only configuration option specific to this plugin is the value property.

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.

coffeelint-limit-newlines's People

Contributors

brianlavall avatar asaayers avatar

Watchers

James Cloos avatar Brian Egan avatar

Forkers

asaayers jekuno

coffeelint-limit-newlines's Issues

Do not treat comments as blank lines

I set limit of blank lines to 5, as in example. The following code fails linting:

class SearchService
    ###
    * Queries backend for people matching the given criteria.
    *
    * @param {Object}
    *            body criteria object (may contain name, surname,
    *            pesel params)
    *
    ###
  findPersonQuery: (body, successCallback, errorCallback) ->
    @Restangular.all('search/person').getList(body).then(successCallback, errorCallback)

Invalid violation when there is empty line in block comment

Hi again!

The following code:

class MyClass  
  ###
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas eget lacinia velit. 
  Morbi elit lacus, ornare sit amet rhoncus eu, pharetra ut ipsum. Fusce consequat maximus diam,
  non sodales nibh mollis non.

  Example:
  <span class="...">lorem</span> ipsum

  See provided tests for more details.
  ###
  myFunction: ->

causes violation when set max blank lines to 1 (it's fine when I set it to 2). In my opinion, it shouldn't. Indicates the line with an "Example:".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.