Class: Quality::Tools::Eslint

Inherits:
Tool
  • Object
show all
Defined in:
lib/quality/tools/eslint.rb

Overview

Adds ‘bigfiles’ tool support to quality gem

Instance Method Summary collapse

Methods inherited from Tool

#initialize

Constructor Details

This class inherits a constructor from Quality::Tools::Tool

Instance Method Details

#eslint_argsObject



7
8
9
# File 'lib/quality/tools/eslint.rb', line 7

def eslint_args
  '-f unix ' + js_files.join(' ')
end

#quality_eslintObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/quality/tools/eslint.rb', line 11

def quality_eslint
  ratchet_quality_cmd('eslint',
                      args: eslint_args,
                      gives_error_code_on_violations: true) do |line|
    if line =~ /^.*:\d+:\d+: /
      1
    else
      0
    end
  end
end