Visual studio 2013 2013年Web Essentials中的咖啡纤维缩进
我的咖啡文件中有4个空格缩进,当我编译这些文件时,会出现错误: CoffeeLint:YourFile.coffee编译失败:CoffeeLint:行包含不一致的缩进;上下文:预期2得到4 我发现它实际上提供了配置缩进的选项,并且在WebEssentials菜单中有编辑全局CofeeLint设置的选项。因此,我将该选项更改为:Visual studio 2013 2013年Web Essentials中的咖啡纤维缩进,visual-studio-2013,coffeescript,web-essentials,coffeelint,Visual Studio 2013,Coffeescript,Web Essentials,Coffeelint,我的咖啡文件中有4个空格缩进,当我编译这些文件时,会出现错误: CoffeeLint:YourFile.coffee编译失败:CoffeeLint:行包含不一致的缩进;上下文:预期2得到4 我发现它实际上提供了配置缩进的选项,并且在WebEssentials菜单中有编辑全局CofeeLint设置的选项。因此,我将该选项更改为: "indentation": { "name": "indentation", "value": 4, "level": "error" } (
"indentation": {
"name": "indentation",
"value": 4,
"level": "error"
}
(将值从2更改为4)
但这没有什么区别,我甚至尝试将级别
从错误
更改为忽略
仍然没有成功。我甚至尝试重新启动VS和Windows,我做错了什么
更新1。
根据评论中的要求,我有以下代码:
if 1
0
还有它的屏幕截图,上面有查看空白:
如果您正在使用coffeelint,并且希望将缩进值更改为2个空格,则必须编辑coffeelint/lib/coffeelint.js文件,并将“value”的值更改为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."
};
\默认情况下启用两个空间缩进。“
};
您编辑的文件可能是生成的文件,没有任何影响。@SLaks我已经更新了我的问题。而且我的电脑上只有一个coffeelint.json(它没有被覆盖),我尝试重新启动电脑=)