mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-12-01 19:22:41 +01:00
get jshint error codes
Summary: makes jshint slightly more useful by printing out error numbers. I love memorizing numbers. Sorry about the crappy getLintMessageName(). There was no list of error names, just the long descriptions that are already rendered as 'reason'. Test Plan: Verify that the numbers are mezmorizing. Been tested on OSX with jshint v2.1.11 Reviewers: epriestley Reviewed By: epriestley CC: Korvin, aran Differential Revision: https://secure.phabricator.com/D7213
This commit is contained in:
parent
587addfd94
commit
4e892e7269
2 changed files with 12 additions and 6 deletions
|
@ -54,6 +54,12 @@ final class ArcanistJSHintLinter extends ArcanistLinter {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// placeholder if/until we get a map code -> name map
|
||||||
|
// jshint only offers code -> description right now (parsed as 'reason')
|
||||||
|
public function getLintMessageName($code) {
|
||||||
|
return "JSHint".$code;
|
||||||
|
}
|
||||||
|
|
||||||
public function getLintNameMap() {
|
public function getLintNameMap() {
|
||||||
return array(
|
return array(
|
||||||
self::JSHINT_ERROR => "JSHint Error"
|
self::JSHINT_ERROR => "JSHint Error"
|
||||||
|
@ -163,7 +169,7 @@ final class ArcanistJSHintLinter extends ArcanistLinter {
|
||||||
$this->raiseLintAtLine(
|
$this->raiseLintAtLine(
|
||||||
$err->line,
|
$err->line,
|
||||||
$err->col,
|
$err->col,
|
||||||
self::JSHINT_ERROR,
|
$err->code,
|
||||||
$err->reason);
|
$err->reason);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,12 +4,12 @@ module.exports = {
|
||||||
|
|
||||||
results.forEach(function (result) {
|
results.forEach(function (result) {
|
||||||
var error = result.error;
|
var error = result.error;
|
||||||
|
|
||||||
report.push({
|
report.push({
|
||||||
'file': result.file,
|
'file' : result.file,
|
||||||
'line': error.line,
|
'line' : error.line,
|
||||||
'col': error.character,
|
'col' : error.character,
|
||||||
'reason': error.reason
|
'reason': error.reason,
|
||||||
|
'code' : error.code,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue