diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pronto/eslint_npm.rb | 10 | ||||
-rw-r--r-- | lib/pronto/eslint_npm/version.rb | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/pronto/eslint_npm.rb b/lib/pronto/eslint_npm.rb index 63a215b..6a9c00c 100644 --- a/lib/pronto/eslint_npm.rb +++ b/lib/pronto/eslint_npm.rb | |||
@@ -6,9 +6,9 @@ require 'shellwords' | |||
6 | module Pronto | 6 | module Pronto |
7 | class ESLintNpm < Runner | 7 | class ESLintNpm < Runner |
8 | CONFIG_FILE = '.pronto_eslint_npm.yml'.freeze | 8 | CONFIG_FILE = '.pronto_eslint_npm.yml'.freeze |
9 | CONFIG_KEYS = %w[eslint_executable files_to_lint].freeze | 9 | CONFIG_KEYS = %w[eslint_executable files_to_lint cmd_line_opts].freeze |
10 | 10 | ||
11 | attr_writer :eslint_executable | 11 | attr_writer :eslint_executable, :cmd_line_opts |
12 | 12 | ||
13 | def eslint_executable | 13 | def eslint_executable |
14 | @eslint_executable || 'eslint' | 14 | @eslint_executable || 'eslint' |
@@ -18,6 +18,10 @@ module Pronto | |||
18 | @files_to_lint || /(\.js|\.es6)$/ | 18 | @files_to_lint || /(\.js|\.es6)$/ |
19 | end | 19 | end |
20 | 20 | ||
21 | def cmd_line_opts | ||
22 | @cmd_line_opts || '' | ||
23 | end | ||
24 | |||
21 | def files_to_lint=(regexp) | 25 | def files_to_lint=(regexp) |
22 | @files_to_lint = regexp.is_a?(Regexp) && regexp || Regexp.new(regexp) | 26 | @files_to_lint = regexp.is_a?(Regexp) && regexp || Regexp.new(regexp) |
23 | end | 27 | end |
@@ -84,7 +88,7 @@ module Pronto | |||
84 | end | 88 | end |
85 | 89 | ||
86 | def eslint_command_line(path) | 90 | def eslint_command_line(path) |
87 | "#{eslint_executable} #{Shellwords.escape(path)} -f json" | 91 | "#{eslint_executable} #{cmd_line_opts} #{Shellwords.escape(path)} -f json" |
88 | end | 92 | end |
89 | 93 | ||
90 | def clean_up_eslint_output(output) | 94 | def clean_up_eslint_output(output) |
diff --git a/lib/pronto/eslint_npm/version.rb b/lib/pronto/eslint_npm/version.rb index 2d3f9d8..1fc96c9 100644 --- a/lib/pronto/eslint_npm/version.rb +++ b/lib/pronto/eslint_npm/version.rb | |||
@@ -2,6 +2,6 @@ | |||
2 | 2 | ||
3 | module Pronto | 3 | module Pronto |
4 | module ESLintNpmVersion | 4 | module ESLintNpmVersion |
5 | VERSION = '0.9.0'.freeze | 5 | VERSION = '0.9.1'.freeze |
6 | end | 6 | end |
7 | end | 7 | end |