Class: SCSSLint::Reporter::JSONReporter
- Inherits:
-
SCSSLint::Reporter
- Object
- SCSSLint::Reporter
- SCSSLint::Reporter::JSONReporter
- Defined in:
- lib/scss_lint/reporter/json_reporter.rb
Overview
Reports lints in a JSON format.
Instance Attribute Summary
Attributes inherited from SCSSLint::Reporter
Instance Method Summary collapse
Methods inherited from SCSSLint::Reporter
Constructor Details
This class inherits a constructor from SCSSLint::Reporter
Instance Method Details
#report_lints ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/scss_lint/reporter/json_reporter.rb', line 6 def report_lints output = {} lints.group_by(&:filename).each do |filename, file_lints| output[filename] = file_lints.map do |lint| issue_hash(lint) end end JSON.pretty_generate(output) end |