class ESLintWebpacker::Warning

Constants

SEVERITY

Attributes

column[R]
filename[R]
line[R]
node_type[R]

Public Class Methods

new(filename, warning_hash) click to toggle source
# File lib/eslint-webpacker/warning.rb, line 10
def initialize(filename, warning_hash)
  @filename = filename
  @rule_id = warning_hash['ruleId'] || 'unexpected error'
  @severity = warning_hash['severity']
  @message = warning_hash['message']
  @line = warning_hash['line']
  @column = warning_hash['column']
  @node_type = warning_hash['nodeType']
end

Public Instance Methods

location() click to toggle source
# File lib/eslint-webpacker/warning.rb, line 24
def location
  "#{filename}:#{line}:#{column}"
end
message() click to toggle source
# File lib/eslint-webpacker/warning.rb, line 32
def message
  @message || 'N/A'
end
rule_id() click to toggle source
# File lib/eslint-webpacker/warning.rb, line 28
def rule_id
  @rule_id || 'N/A'
end
severity() click to toggle source
# File lib/eslint-webpacker/warning.rb, line 20
def severity
  SEVERITY[@severity - 1]
end