Class: EslintController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/eslint_controller.rb

Instance Method Summary collapse

Instance Method Details

#config_fileObject



13
14
15
# File 'app/controllers/eslint_controller.rb', line 13

def config_file
  render json: ESLintRails::Config.read(force_default: params[:force_default] || false)
end

#showObject



5
6
7
# File 'app/controllers/eslint_controller.rb', line 5

def show
  @warnings = ESLintRails::Runner.new(@filename).run(@should_autocorrect)
end

#sourceObject



9
10
11
# File 'app/controllers/eslint_controller.rb', line 9

def source
  @source = Rails.application.assets[@filename].to_s
end