Class: Danger::DangerEslint
- Inherits:
-
Plugin
- Object
- Plugin
- Danger::DangerEslint
- Defined in:
- lib/eslint/plugin.rb
Overview
Lint javascript files using [eslint](eslint.org/). Results are send as inline commen.
Instance Attribute Summary collapse
-
#config_file ⇒ String
An path to eslint’s config file.
-
#filtering ⇒ Boolean
Enable filtering Only show messages within changed files.
-
#ignore_file ⇒ String
An path to eslint’s ignore file.
Instance Method Summary collapse
-
#lint ⇒ void
Lints javascript files.
Instance Attribute Details
#config_file ⇒ String
An path to eslint’s config file
18 19 20 |
# File 'lib/eslint/plugin.rb', line 18 def config_file @config_file end |
#filtering ⇒ Boolean
Enable filtering Only show messages within changed files.
27 28 29 |
# File 'lib/eslint/plugin.rb', line 27 def filtering @filtering end |
#ignore_file ⇒ String
An path to eslint’s ignore file
22 23 24 |
# File 'lib/eslint/plugin.rb', line 22 def ignore_file @ignore_file end |
Instance Method Details
#lint ⇒ void
This method returns an undefined value.
Lints javascript files. Generates ‘errors` and `warnings` due to eslint’s config. Will try to send inline comment if supported(Github)
35 36 37 38 39 40 |
# File 'lib/eslint/plugin.rb', line 35 def lint lint_results .reject { |r| r.nil? || r['messages'].length.zero? } .reject { |r| r['messages'].first['message'].include? 'matching ignore pattern' } .map { |r| send_comment r } end |