Class: Maximus::Jshint
Overview
Instance Attribute Summary
Attributes inherited from Lint
Instance Method Summary collapse
-
#result ⇒ Object
JSHint (requires node module).
Methods inherited from Lint
Methods included from Helper
#check_default_config_path, #edit_yaml, #file_count, #file_list, #is_rails?, #lines_added_to_range, #node_module_exists, #path_exists?, #prompt, #reporter_path, #root_dir, #truthy?
Constructor Details
This class inherits a constructor from Maximus::Lint
Instance Method Details
#result ⇒ Object
JSHint (requires node module)
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/maximus/lints/jshint.rb', line 7 def result @task = 'jshint' @path = is_rails? ? "#{@settings[:root_dir]}/app/assets" : "#{@settings[:root_dir]}source/assets" if @path.blank? return unless temp_config(@task) && path_exists?(@path) node_module_exists(@task) jshint_cli = "jshint #{@path} --config=#{temp_config(@task)} --reporter=#{reporter_path('jshint.js')}" jshint_cli += " --exclude-path=#{temp_config(@settings[:jshintignore])}" if @settings.has_key?(:jshintignore) jshint = `#{jshint_cli}` @output[:files_inspected] ||= files_inspected('js') refine jshint end |