schorfES / node-lintspaces

A validator for checking different kinds of whitespaces in your files.
https://npmjs.com/package/lintspaces
MIT License
30 stars 17 forks source link

Confusion between ignore `js-comments` and `newlineMaximum` #8

Closed yfr closed 9 years ago

yfr commented 10 years ago

When i use

options: {
  ignore: [
    "js-comments"
  ],
  newlineMaximum: 1
}

the ignored comments are counted as new lines. And i get an newlineMaximum error.

Example code:

var app = app || {};

/**
 * Methods for handling the header
 */
app.Header = new Model({

  /**
   * Initialize the model
   */
  init: function() {}

});
…

When i use the settings like above an newlineMaximum error raises. If i remove the first comment, the second comment then becomes the error.

What can i do?

schorfES commented 10 years ago

I've created a gist for this. When i run the code in the gist i didn't get any kind of error. Can you check this example?

schorfES commented 10 years ago

Are you still having trouble with this issue? Can you test the gist above on your system using grunt-lintspaces?

yfr commented 10 years ago

Oh man, this is embarrassing!

This was just a stupid typo on my side. Sorry for that!

yfr commented 10 years ago

Ah ok. I feel better now. Just saw that it's not entirely my fault. The Readme is not correct. The examples are using the ignores option but i had to use ignore.

I tried to fix this in a fork but there are to much ignores/ignore options. I don't really know where to start ...

schorfES commented 9 years ago

After a deeper look into the code I didn't found any discrepancies to the documentation. The option is called: ignores. Take a look into the default values of lintspaces.