Git Product home page Git Product logo

grunt-coffeelint's Introduction

build status

grunt-coffeelint

Lint your CoffeeScript with CoffeeLint.

Installation

Install npm package, next to your project's Gruntfile.js file:

npm install grunt-coffeelint

Add this line to your project's Gruntfile.js:

grunt.loadNpmTasks('grunt-coffeelint');

Options

A few additional options are supported:

force

Type: Boolean Default value: false

Set force to true to report CoffeeLint errors but not fail the task.

Configuration

coffeelint is a multitask, so you can use it similary to lint, watch etc...

grunt.initConfig({
    ...
    coffeelint: {
      app: ['app/*.coffee', 'scripts/*.coffee']
    },
    ...
});

Options per target

grunt.initConfig({
    ...
    coffeelint: {
      app: ['app/*.coffee', 'scripts/*.coffee'],
      tests: {
        files: {
          src: ['tests/*.coffee']
        },
        options: {
          'no_trailing_whitespace': {
            'level': 'error'
          }
        }
      }
    },
    ...
});

Global - default options

grunt.initConfig({
    ...
    coffeelint: {
      options: {
        'no_trailing_whitespace': {
          'level': 'error'
        }
      }
    },
    ...
});

Loading external config

grunt.initConfig({
    ...
    coffeelint: {
      options: {
        configFile: 'coffeelint.json'
      }
    },
    ...
});

Task options take precedence over configFile options.

For available options see coffeelint homepage.

grunt-coffeelint's People

Contributors

adrianlee44 avatar appleboy avatar c089 avatar danielkcz avatar darky avatar es128 avatar janraasch avatar jayharris avatar kburson avatar lukasrychtecky avatar mwittig avatar peterdavehello avatar scips avatar sdornan avatar sioked avatar sparanoid avatar vladikoff avatar vojtajina avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grunt-coffeelint's Issues

Publish npm and fix versions

The version currently published to npm is 0.0.4, while there is no version 0.0.4 in the entire repository (0.0.2, 0.0.3 that is all there is) and the sha referenced in the package.json isn't available on github: c6b9f005dd51a253ea998c16b11e4acdc338f801

Also the version published on npm still isn't grunt 0.4.0 compatible.

Please fix the confusing versioning and publish the latest version to npm, thanks!

Grunt 0.4 Release

I'm posting this issue to let you know that we will be publishing Grunt 0.4 on Monday, February 18th.

If your plugin is not already Grunt 0.4 compatible, would you please consider updating it? For an overview of what's changed, please see our migration guide.

If you'd like to develop against the final version of Grunt before Monday, please specify "grunt": "0.4.0rc8" as a devDependency in your project. After Monday's release, you'll be able to use "grunt": "~0.4.0" to actually publish your plugin. If you depend on any plugins from the grunt-contrib series, please see our list of release candidates for compatible versions. All of these will be updated to final status when Grunt 0.4 is published.

Also, in an effort to reduce duplication of effort and fragmentation in the developer community, could you review the grunt-contrib series of plugins to see if any of your functionality overlaps significantly with them? Grunt-contrib is community maintained with 40+ contributors—we'd love to discuss any additions you'd like to make.

Finally, we're working on a new task format that doesn't depend on Grunt: it's called node-task. Once this is complete, there will be one more conversion, and then we'll never ask you to upgrade your plugins to support our changes again. Until that happens, thanks for bearing with us!

If you have any questions about how to proceed, please respond here, or join us in #grunt on irc.freenode.net.

Thanks, we really appreciate your work!

Support custom rules

in my coffeelint grunt-task i'd like to setup custom rules. so far, i have found no way to make this happen unfortunately :(

Match the output by coffeelint (@ok = '✓' / @warn = '⚡' / @err = '✗')

I see no real reason to reformat the ouptut created by coffeelint official.

I would like to see the output the way coffeelint creates it:

✗ ./Gruntfile.coffee
   ✗ #85: Line exceeds maximum allowed length. Length is 86, max is 80.

This looks much more readable than:

[error] Gruntfile.coffee:11 Line exceeds maximum allowed length (max_line_length)

Add versions.md?

It would be nice if there was some information in the project about what's changed from one version to another. For example I'd like to know what's new in 0.0.7.

fix Travis Ci runner

Currently Travis fails not because of test fails but because of some setup errors.

Possible bug working with grunt-watch

Hello,
I'm using coffeelint along with grunt watch for my code. The watch command also has several other tasks, such as compiling coffee to js, and concatenating the js into one file, etc.

When I add coffeelint to the grunt watch's tasklist, only coffeelint runs. And even after running successfully (all files lint free), other tasks are not executing.

Here is my config:

    coffeelint:
      app: ['src/apps/**/*.coffee']
      options:
        force: true
        max_line_length:
          value: 80
          level: 'warn'
        indentation:
          value: 2
          level: 'warn'

    watch:
      common:
        files: ['src/apps/*', 'src/apps/common/**/*']
        tasks: ['requirejs:common']
        options:
          nospawn: true

      angular:
        files: ['src/apps/client/**/*']
        tasks: ['requirejs:angular']
        options:
          nospawn: true

      css:
        files: ['src/sass/**/*']
        tasks: ['compass:dev']
        options:
          nospawn: true

      lint:
        files: ['src/apps/**/*.coffee']
        tasks: ['coffeelint']
        options:
          nospawn: true

Here, nothing else executes after coffeelint if I make changes and save coffee files.

doesn't work with grunt-notify

I've read #11, but do you have any suggestions for a simple way to get coffeelint warnings to create growl notifications? I haven't really looked into it substantially yet, but why not behave the same way the jshint plugin does?

Need help maintaining this project?

It's been 5 months since the last activity in this repo. CoffeeLint is now at a stable v1.0 version, but grunt-coffeelint is still stuck at v0.5.

I volunteer to help maintain this project if you don't mind adding me as a contributor to the repo. There are probably others who would also be willing to help keep the project healthy as well.

npm install broken with NPMv3

NPMv3 dropped support for peerDependencies, so projects using grunt-coffeelint breaks when upgrading.

Workaround is to add the dependency on grunt and coffeelint in the parent project.

Please support option "ignore"

Thanks for your wonderful plugin! I really like it.

Unfortunately it does not respect CoffeeLint's ignore level. From the CoffeeLint Options:

To enable an option, set its level to "error", and to disable an option, set its level to "ignore".

I have the following configuration in my coffeelint.json:

"max_line_length": {
  "name": "max_line_length",
  "value": 120,
  "level": "ignore",
  "limitComments": false
}

But this causes "grunt-coffeelint" to take a default max line length of "80", so it still shows a warning instead of skipping the "max_line_length" check completly.

Cannot install via Bower

When trying to install grunt-coffeelint via bower, I receive "ENOTFOUND Package grunt-coffeelint not found". Would be useful to have this accessible via bower.

filename not indicated

I removed a right paren from a line and ran coffeelint on it.
It reports the missing paren as a warning, but doesn't tell me which file is missing it.
In my case I can guess because I only have one .coffee file, but this would be an issue if there were many files being evaluated.

Publish latest version to npm

#44 Updates to include CoffeeLint ~1.1, which in turn supports CoffeeScript 1.7.

The version on npm runs an older version of CoffeeLint (1.0.8), which only supports CoffeeScript 1.6

Can the latest version please be released to npm so we can easily lint CS1.7 in our projects

Thanks

Set all errors to be warnings

I would like to run grunt-coffeelint as the task of regarde. If grunt-coffeelint throws an error when it detects a problem, it'll stop grunt and I have to restart the watch manually. Is there a way to globally set everything to the "warning" instead of "error" log level? If not, would you be amenable to a PR enabling it?

grunt.log.error / emit events - to hook for Growl support

We're trying to get some additional dev feedback with Growl (like we have with Testacular) for the things we care about most. One of those things is coffee linting.

One way to do this is with hooker.hook over the grunt.fail API.

['warn', 'fatal'].forEach(function(level) {
  grunt.util.hooker.hook(grunt.fail, level, function(opt) {
    var target = grunt.option('target') || 'dev';
    if (target !== 'dev') { return; }
    // https://github.com/theabraham/growly#growlynotifytext-opts-callback
    growly.notify(opt.name, { title: opt.message, sticky: true });
  });
});

However, this won't help us with grunt-coffeelint since you're not using that API. I could try and hook grunt.log.error, but you're not using that either.

I'm wondering your thoughts on a PR to either

Strange output with interpolated strings about operator spacing

Consider following input

moo = 'meow'
foo = ' :D'
console.log "The cow says #{if moo then "#{moo}!" else ''}#{foo}"

with the coffeelint.json pasted here and no special magic in Gruntfile.coffee and this output

.../bug.coffee
  ✖  line 3  Operators must be spaced properly  +

I see that there's some freaky string interpolation going on, but this error message is misleading.

I don't have the time to investigate where this issue is rooted. I report here because grunt-coffelint is the thing I'm importing.

New release ?

It's been 2 months since anything happened here. Could you please possibly make a new a release ? I was wondering why force: true option doesn't work. NPM is not updated with it yet.

Should not invoke no_unnecessary_fat_arrows warning when binding current value of this for calls to super

class MyClass
  constructor: ->
    @foo = 'foo'
  getFoo: ->
    console.log @foo
  callback: (cb) ->
    cb()

class YourClass extends MyClass
  constructor: ->
    super

  getFoo: ->
    @callback ->
      super

obj = new YourClass
obj.getFoo() #outputs undefined

The above code will correctly output 'undefined' because @foo is indeed undefined in this context. This is solved by using the fat arrow in the function passed to @callback, but grunt-coffeelint flags this with a no_unnecessary_fat_arrows warning.

Add handing of this situation.

EmailConfirmed.get(email: value).$then(
  (response) ->
    result = response.data.api.result

    if result
      deferred.resolve result
   else
      deferred.reject()
   ->
     deferred.reject()

Coffelint is throwing an "arrow_spacing" error even though there should not be.

Auto Upgrade Hurts When Trying To Have Reproducible Builds

Newer versions of coffee lint has some new feature/bug that causes my build to be broken. See this issue for details:
clutchski/coffeelint#504

I believe this is due to the liberal upgrade policy in the devDependencies section of package.json:

"devDependencies": {
    "grunt": "~0.4",
    "grunt-bump": "~0.0.7",
    "grunt-npm": "~0.0.2",
    "grunt-auto-release": "0.0.6",
    "coffeelint": "^1"
  },

My suggestion is to specify the dependency versions without auto upgrade so that transient dependencies won't brake the dependants of this package.

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.