Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15410878
D9112.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D9112.diff
View Options
diff --git a/src/lint/linter/ArcanistJSHintLinter.php b/src/lint/linter/ArcanistJSHintLinter.php
--- a/src/lint/linter/ArcanistJSHintLinter.php
+++ b/src/lint/linter/ArcanistJSHintLinter.php
@@ -5,6 +5,9 @@
*/
final class ArcanistJSHintLinter extends ArcanistExternalLinter {
+ private $jshintignore;
+ private $jshintrc;
+
public function getInfoName() {
return 'JSHint';
}
@@ -74,9 +77,48 @@
}
protected function getMandatoryFlags() {
- return array(
- '--reporter='.dirname(realpath(__FILE__)).'/reporter.js',
+ $options = array();
+
+ $options[] = '--reporter='.dirname(realpath(__FILE__)).'/reporter.js';
+
+ if ($this->jshintrc) {
+ $options[] = '--config='.$this->jshintrc;
+ }
+
+ if ($this->jshintignore) {
+ $options[] = '--exclude-path='.$this->jshintignore;
+ }
+
+ return $options;
+ }
+
+ public function getLinterConfigurationOptions() {
+ $options = array(
+ 'jshint.jshintignore' => array(
+ 'type' => 'optional string',
+ 'help' => pht('Pass in a custom jshintignore file path.'),
+ ),
+ 'jshint.jshintrc' => array(
+ 'type' => 'optional string',
+ 'help' => pht('Custom configuration file.'),
+ ),
);
+
+ return $options + parent::getLinterConfigurationOptions();
+ }
+
+ public function setLinterConfigurationValue($key, $value) {
+ switch ($key) {
+ case 'jshint.jshintignore':
+ $this->jshintignore = $value;
+ return;
+
+ case 'jshint.jshintrc':
+ $this->jshintrc = $value;
+ return;
+ }
+
+ return parent::setLinterConfigurationValue($key, $value);
}
protected function getDefaultFlags() {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 20, 8:38 AM (1 d, 4 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7545268
Default Alt Text
D9112.diff (1 KB)
Attached To
Mode
D9112: Add some `.arclint` configuration options for `ArcanistJSHintLinter`.
Attached
Detach File
Event Timeline
Log In to Comment