解决方案:
要配置的CoffeeScript一旦安装会有在C默认coffeelint.json:\ Users \ [用户名] \ .vscode \扩展文件夹。这是无用的,改变配置在这里没有任何作用(至少在我的情况下)。
要解决此问题,请在项目的根目录中创建一个新的coffeelint.json,或者在您的package.json中添加一个coffeelintConfig部分。无论哪种方式,配置都完全相同。如果CoffeeLint没有为当前项目找到任何配置,它将检查要使用的$ HOME/coffeelint.json。
在此之后的示例配置低于:
的package.json
{
"name": "your-project",
"version": "0.0.0",
"coffeelintConfig": {
"indentation" : {
"level" : "error",
"value" : 4
},
"line_endings" : {
"value" : "unix",
"level" : "error"
}
}
}
coffeelint.json
{
"indentation" : {
"level" : "error",
"value" : 4
},
"line_endings" : {
"value" : "unix",
"level" : "error"
}
}
现在,您可以编辑这个配置皮棉你的CoffeeScript :)
你的“用户文件夹”是什么意思?我相信代码coffeelint扩展从您打开的工作区的根目录读取coffeelint.json。这是你添加这些行的文件吗? – Llewey