如何在Sublime Text 3中使用jsHint和Sublime Linter配置2个空格而不是制表符 [英] How to configure 2 spaces instead of tabs..WIth jsHint and Sublime Linter in Sublime Text 3
问题描述
我正在尝试将SublimeLinter配置为允许2个空格,而不是4个标签.这是我在SublimeLinter-打开用户设置...中的设置.
I'm trying to configure sublime linter to allow 2 spaces instead of 4 for tabs..This is my settings in SublimeLinter - Open User Settings...
"linters": {
"jshint": {
"@disable": false,
"args": [],
"excludes": []
}
}
我想添加缩进:2(我认为).所以我尝试了
I want to add indent: 2 (i think). So i tried
"linters": {
"jshint": {
"@disable": false,
"args": [ {indent: 4],
"excludes": []
}
}
但是我不确定如何插入这些选项,因为在尝试解析设置时出现错误:Packages/User/SublimeLinter.sublime-settings:20:28
But i am not sure how to insert these options because i get the error trying to parse settings: Expected value in Packages/User/SublimeLinter.sublime-settings:20:28
推荐答案
我认为第20行是"args"
行,因为它格式错误.试试
I assume that line 20 is the "args"
line, as it's malformed. Try
"linters": {
"jshint": {
"@disable": false,
"args": [ {"indent": 4 } ],
"excludes": []
}
}
相反.我不知道它会使jshint
达到您想要的目的(我读过 the文档),但至少是有效的 JSON .
instead. I don't know that it'll make jshint
do what you want it to do (I'd read the docs for that), but at least it's valid JSON.
这篇关于如何在Sublime Text 3中使用jsHint和Sublime Linter配置2个空格而不是制表符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!