if (preg_match('/^v(\d\.\d\.\d)$/', $stdout, $matches)) {
return $matches[1];
} else {
return false;
}
}
protected function getMandatoryFlags() {
return array(
'--format=json',
'--no-color',
);
}
protected function getDefaultFlags() {
return $this->flags;
}
public function getLinterConfigurationOptions() {
$options = array(
'eslint.config' => array(
'type' => 'optional string',
'help' => pht('Use configuration from this file or shareable config. (https://eslint.org/docs/user-guide/command-line-interface#-c---config)'),
),
'eslint.cwd' => array(
'type' => 'optional string',
'help' => pht('Specify a project sub-directory for both the local eslint-cli install and the sub-directory to lint within.'),
),
'eslint.env' => array(
'type' => 'optional string',
'help' => pht('Specify environments. To specify multiple environments, separate them using commas. (https://eslint.org/docs/user-guide/command-line-interface#--env)'),
),
'eslint.fix' => array(
'type' => 'optional bool',
'help' => pht('Specify whether eslint should autofix issues. (https://eslint.org/docs/user-guide/command-line-interface#fixing-problems)'),