diff --git a/src/lint/linter/ArcanistJSHintLinter.php b/src/lint/linter/ArcanistJSHintLinter.php index ea286bc1..c81da407 100644 --- a/src/lint/linter/ArcanistJSHintLinter.php +++ b/src/lint/linter/ArcanistJSHintLinter.php @@ -31,6 +31,13 @@ final class ArcanistJSHintLinter extends ArcanistExternalLinter { protected function getDefaultMessageSeverity($code) { if (preg_match('/^W/', $code)) { return ArcanistLintSeverity::SEVERITY_WARNING; + } else if (preg_match('/^E043$/', $code)) { + // TODO: If JSHint encounters a large number of errors, it will quit + // prematurely and add an additional "Too Many Errors" error. Ideally, we + // should be able to pass some sort of `--force` option to `jshint`. + // + // See https://github.com/jshint/jshint/issues/180 + return ArcanistLintSeverity::SEVERITY_DISABLED; } else { return ArcanistLintSeverity::SEVERITY_ERROR; } diff --git a/src/lint/linter/__tests__/jshint/too-many-errors.lint-test b/src/lint/linter/__tests__/jshint/too-many-errors.lint-test new file mode 100644 index 00000000..6dbea1f9 --- /dev/null +++ b/src/lint/linter/__tests__/jshint/too-many-errors.lint-test @@ -0,0 +1,5 @@ +/* jshint maxerr: 1 */ +console.log('foobar') +~~~~~~~~~~ +disabled:2:22 +warning:2:22