0

I have 4 space indentation in my coffee files and when I am compiling those I am getting errors:

CoffeeLint: YourFile.coffee compilation failed: CoffeeLint: Line contains inconsistent indentation; context: Expected 2 got 4

I found that http://www.coffeelint.org/ actually provides option to configure indentation and in Web Essentials menu there is option to edit Global CofeeLint settings. So I changed that option to be:

"indentation": {
    "name": "indentation",
    "value": 4,
    "level": "error"
}

(changed value from 2 to 4)

But it makes no difference I even tried to change level from error to ignore still no success. I even tried to restart VS and Windows, What I am doing wrong?

Update 1.

As requested in comments here is code I have:

if 1
    0

And also screenshot of it with View White Space ON:

enter image description here

fracz
  • 20,536
  • 18
  • 103
  • 149
Vladimirs
  • 8,232
  • 4
  • 43
  • 79
  • @SLaks I've updated my question. Also I have only one coffeelint.json on my PC (it isn't overridden) and I tried to restart my PC =) – Vladimirs Jun 18 '14 at 16:13

1 Answers1

0

If you are using coffeelint and you want to change the indentation value to 2 spaces then you must edit the coffeelint/lib/coffeelint.js file and change the value of the "value" to 2 as follows:

module.exports = Indentation = (function() {
  Indentation.prototype.rule = {
    name: 'indentation',
    value: 2,
    level: 'error',
    message: 'Line contains inconsistent indentation',
    description: "This rule imposes a standard number of spaces to be used for\nindentation. Since whitespace is significant in CoffeeScript, it's\ncritical that a project chooses a standard indentation format and\nstays consistent. Other roads lead to darkness. <pre> <code>#\nEnabling this option will prevent this ugly\n# but otherwise valid CoffeeScript.\ntwoSpaces = () ->\n  fourSpaces = () ->\n      eightSpaces = () ->\n            'this is valid CoffeeScript'\n\n</code>\n</pre>\nTwo space indentation is enabled by default."
  };

The file you edited is probably a generated file that is of no consequence.

l3x
  • 30,760
  • 1
  • 55
  • 36