lunixbochs/linters — pull request #4 by karolyi (2013-11-02 02:12:49+00:00)
Title: Javascript JSHint/JSLint/jsl availability, fixes #56

Hi,

updated the javascript linter to work with the most used 3 code linters. Since I couldn't find how the default configuration is created, I'll just paste my configuration here, so you see how it can be configured. The rest is up to you.

Oh, this is for ST3, but I think it'll work with ST2 too.

Here's the config:
```
{
"user": {
"debug": false,
"plugins": {
"AppleScript": {},
"C": {
"args": [
"-xc",
"-fsyntax-only",
"-std=c99",
"-Werror",
"-pedantic"
],
"cmd": [
"clang"
],
"include": []
},
"CPP": {
"args": [
"-xc++",
"-fsyntax-only",
"-std=c++11",
"-Werror",
"-pedantic"
],
"cmd": [
"clang++"
],
"include": []
},
"CSS": {
"cmd": [
"csslint"
]
},
"Coffee": {
"cmd": [
"coffee",
"--compile",
"--stdio"
]
},
"Eclim": {
"cmd": [
"eclim",
"-command",
"java_src_update"
],
"disable": true
},
"EmbeddedJS": {},
"Golang": {
"cmd": [
"go",
"build",
"-gcflags",
"-e -N"
]
},
"HAML": {
"cmd": [
"haml",
"-c"
]
},
"HTML": {
"cmd": [
"tidy",
"-q",
"-e",
"-utf8"
]
},
"Java": {
"cmd": [
"javac",
"-Xlint"
],
"disable": true
},
"JavaScript": {
// // jsl configuration
// "regex-config": {
// "multiline": false,
// "regex": "^\\((?P\\d+)\\):\\s+(?P.+)"
// },
// "cmd": [
// "jsl",
// "-stdin"
// ]

// // jsLint configuration
// "regex-config": {
// "multiline": true,
// "regex": [
// "^(\\s*?)#(\\d)\\s(?P.+)$\\W",
// "^.*// Line (?P\\d+), Pos (?P\\d+)$"
// ]
// },
// "cmd": [
// "jslint",
// "/dev/stdin"
// ]

// jsHint configuration
"regex-config": {
"multiline": false,
"regex": "^(.*?): line (?P\\d+), col (?P\\d+),\\s(?P.+)$"
},
"cmd": [
"jshint",
"-"
]
},
"Lua": {
"cmd": [
"luac",
"-p"
]
},
"Nasm": {
"cmd": [
"nasm",
"-X",
"gnu",
"-I.",
"-o",
"/dev/null"
]
},
"PHP": {
"cmd": [
"php",
"-l",
"-n",
"-d display_errors=On"
]
},
"Perl": {
"cmd": [
"perl",
"-c"
]
},
"Puppet": {
"cmd": [
"puppet",
"parser",
"validate",
"--color=false"
]
},
"Python": {
"cmd": "pyflakes"
},
"Ruby": {
"cmd": [
"ruby",
"-wc"
]
},
"TODO": {},
"XML": {
"cmd": [
"xmllint",
"-noout",
"-"
]
}
}
}
}
```

This pull request fixes https://github.com/lunixbochs/sublimelint/issues/56.

Cheers,
Laszlo