Class: Phare::Check::Eslint

Inherits:
Phare::Check show all
Defined in:
lib/phare/check/eslint.rb

Constant Summary collapse

GLOBAL_BINARY =
'eslint'.freeze
LOCAL_BINARY =
'node_modules/.bin/eslint'.freeze

Instance Attribute Summary collapse

Attributes inherited from Phare::Check

#status, #tree

Instance Method Summary collapse

Methods inherited from Phare::Check

#run, #should_run?

Constructor Details

#initialize(directory, options = {}) ⇒ Eslint

Returns a new instance of Eslint.



10
11
12
13
14
15
16
17
18
# File 'lib/phare/check/eslint.rb', line 10

def initialize(directory, options = {})
  @directory = directory
  @config = File.expand_path("#{directory}.eslintrc", __FILE__)
  @path = File.expand_path("#{directory}app/assets/javascripts", __FILE__)
  @extensions = %w(.js)
  @options = options

  super
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



8
9
10
# File 'lib/phare/check/eslint.rb', line 8

def config
  @config
end

#pathObject (readonly)

Returns the value of attribute path.



8
9
10
# File 'lib/phare/check/eslint.rb', line 8

def path
  @path
end

Instance Method Details

#commandObject



20
21
22
# File 'lib/phare/check/eslint.rb', line 20

def command
  "#{binary} #{input}"
end