module Pronto
class ESLintNpm < Runner
CONFIG_FILE = '.pronto_eslint_npm.yml'.freeze
- CONFIG_KEYS = %w[eslint_executable files_to_lint].freeze
+ CONFIG_KEYS = %w[eslint_executable files_to_lint cmd_line_opts].freeze
- attr_writer :eslint_executable
+ attr_writer :eslint_executable, :cmd_line_opts
def eslint_executable
@eslint_executable || 'eslint'
@files_to_lint || /(\.js|\.es6)$/
end
+ def cmd_line_opts
+ @cmd_line_opts || ''
+ end
+
def files_to_lint=(regexp)
@files_to_lint = regexp.is_a?(Regexp) && regexp || Regexp.new(regexp)
end
end
def eslint_command_line(path)
- "#{eslint_executable} #{Shellwords.escape(path)} -f json"
+ "#{eslint_executable} #{cmd_line_opts} #{Shellwords.escape(path)} -f json"
end
def clean_up_eslint_output(output)