2014-05-22 100 views
0

我有4个空格缩进在我的咖啡文件,当我编译那些我收到错误:Coffeelint压痕2013

CoffeeLint:YourFile.coffee编译失败:CoffeeLint:行包含不一致的压痕;上下文:预计2得到4

我发现http://www.coffeelint.org/实际上提供了配置缩进的选项,并且在Web Essentials菜单中有编辑Global CofeeLint设置的选项。所以我改变了选项是:

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

(改值2〜4)

但它没有什么区别我甚至试图从errorignore仍然没有成功改变level。我甚至试图重新启动VS和Windows,我做错了什么?

更新1

正如在这里意见中的要求是代码我有:它

if 1 
    0 

而且还用截图查看白色空间:

enter image description here

+0

向我们显示您的代码。 – SLaks

+0

@SLaks我更新了我的问题。另外我的电脑上只有一个coffeelint.json(它没有被覆盖),我试着重新启动我的电脑=) – Vladimirs

回答

0

如果您使用的是coffeelint,并且想要将缩进值更改为2个空格,则必须进行编辑它coffeelint/lib目录/ coffeelint.js文件和“值”的值更改为2如下:

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." 
    }; 

你编辑的文件可能是一个生成的文件,该文件是没有结果的。