aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/pronto/eslint_npm.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pronto/eslint_npm.rb')
-rw-r--r--lib/pronto/eslint_npm.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/pronto/eslint_npm.rb b/lib/pronto/eslint_npm.rb
index bb79091..e861ffe 100644
--- a/lib/pronto/eslint_npm.rb
+++ b/lib/pronto/eslint_npm.rb
@@ -1,15 +1,17 @@
1# frozen_string_literal: true
2
1require 'pronto' 3require 'pronto'
2require 'shellwords' 4require 'shellwords'
3 5
4module Pronto 6module Pronto
5 class ESLintNpm < Runner 7 class ESLintNpm < Runner
6 CONFIG_FILE = '.pronto_eslint_npm.yml'.freeze 8 CONFIG_FILE = '.pronto_eslint_npm.yml'.freeze
7 CONFIG_KEYS = %w(eslint_executable files_to_lint).freeze 9 CONFIG_KEYS = %w[eslint_executable files_to_lint].freeze
8 10
9 attr_writer :eslint_executable 11 attr_writer :eslint_executable
10 12
11 def eslint_executable 13 def eslint_executable
12 @eslint_executable || 'eslint'.freeze 14 @eslint_executable || 'eslint'
13 end 15 end
14 16
15 def files_to_lint 17 def files_to_lint
@@ -61,7 +63,7 @@ module Pronto
61 end 63 end
62 64
63 def new_message(offence, line) 65 def new_message(offence, line)
64 path = line.patch.delta.new_file[:path] 66 path = line.patch.delta.new_file[:path]
65 level = :warning 67 level = :warning
66 68
67 Message.new(path, line, level, offence['message'], nil, self.class) 69 Message.new(path, line, level, offence['message'], nil, self.class)