上一篇说到要修改JSLint的一些配置,如缩进indent, 找了半天找到一个
{
// jslint
"jslint_options": "--browser --node --indent 4 --predef YUI",
// run on save
"run_on_save": true,
// debug flag.
"debug": true
}
试了下没什么效果, 最后找到下面这篇文章https://github.com/janraasch/Sublime-JSLint , 最后终于修改成功,保存,重启,生效.
{
// an array of options to pass to jslint, e.g.
// ["--white", "--vars"] or maybe ["--indent", "2", "--node", "false"]
// see https://github.com/reid/node-jslint
// or http://www.jslint.com/lint.html#options.
"options" : [
// assume node.js to predefine node globals,
// defaults to true in `node-jslint`.
"--node", "false"
// ES5 syntax should be allowed,
// defaults to true in `node-jslint`.
,"--es5", "false"
// tolerate missing 'use strict' pragma
// do not use this pragma unless you know what you are doing.
// ,"--sloppy"
// suggest an indent level of two spaces.
,"--indent", "4"
// tolerate unfiltered for in.
// ,"--forin"
// tolerate dangling _ in identifiers.
// ,"--nomen"
// tolerate many var statements per function.
// ,"--vars"
// tolerate ++ and --.
// ,"--plusplus"
// tolerate stupidity.
// ,"--stupid"
]
// if true, run jslint on save.
,"run_on_save" : true
// a regex string to determine whether jslint
// should be run on a file.
// if a match is found (i.e. re.search(filename_filter, filename)),
// the file will be linted.
,"filename_filter": "(\\.js)$"
// jslint command you want to run as an array of strings.
// E.g.: ["jslint"] or ["/usr/local/bin/jslint"] or ["node", "mylinter.js"]
// Default is
// * Linux: ["node", "~/.config/sublime-text-2/Packages/JSLint/node_modules/jslint/bin/jslint"]
// * Mac: ["node", "~/Library/Application Support/Sublime Text 2/Packages/JSLint/node_modules/jslint/bin/jslint"]
// * Windows: ["node", "%APPDATA%/Sublime Text 2/Packages/JSLint/node_modules/jslint/bin/jslint"]
// using node-jslint v0.1.9. https://github.com/reid/node-jslint/tree/v0.1.9
// ,"jslint" : ["jslint"]
// if your own personal choice of jslint has an output
// different from the standard which comes with this package,
// you may have to change line_regex and file_regex
// check http://docs.sublimetext.info/en/latest/reference/build_systems.html
// to find out how these regular expressions work. The defaults are:
// ,"line_regex" : ".*// Line ([0-9]*), Pos ([0-9]*)$"
// ,"file_regex" : "(^[^# ]+.*$)"
}