Class: Policial::StyleGuides::JavaScript
- Inherits:
-
Base
- Object
- Base
- Policial::StyleGuides::JavaScript
show all
- Defined in:
- lib/policial/style_guides/javascript.rb
Overview
Public: Determine Javascript style guide violations per-line.
Constant Summary
collapse
- KEY =
:javascript
Instance Method Summary
collapse
Methods inherited from Base
#config_file, #initialize, #investigate?
Instance Method Details
#default_config_file ⇒ Object
24
25
26
|
# File 'lib/policial/style_guides/javascript.rb', line 24
def default_config_file
'.eslintrc.json'
end
|
#exclude_file?(_filename) ⇒ Boolean
16
17
18
|
# File 'lib/policial/style_guides/javascript.rb', line 16
def exclude_file?(_filename)
false
end
|
#filename_pattern ⇒ Object
20
21
22
|
# File 'lib/policial/style_guides/javascript.rb', line 20
def filename_pattern
/.+\.js\z/
end
|
#violations_in_file(file) ⇒ Object
11
12
13
14
|
# File 'lib/policial/style_guides/javascript.rb', line 11
def violations_in_file(file)
errors = Eslintrb.lint(file.content, config)
violations(file, errors)
end
|