Class: PreCommit::Checks::Jshint
- Inherits:
-
Js
- Object
- Plugin
- Js
- PreCommit::Checks::Jshint
show all
- Defined in:
- lib/plugins/pre_commit/checks/jshint.rb
Instance Attribute Summary
Attributes inherited from Plugin
#config, #pluginator
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Js
#call, #display_error, #error_selector, #files_filter
Methods inherited from Plugin
#initialize, #name
Class Method Details
.description ⇒ Object
19
20
21
|
# File 'lib/plugins/pre_commit/checks/jshint.rb', line 19
def self.description
"Checks javascript files with JSHint."
end
|
Instance Method Details
#alternate_config_file ⇒ Object
15
16
17
|
# File 'lib/plugins/pre_commit/checks/jshint.rb', line 15
def alternate_config_file
".jshintrc"
end
|
#linter_src ⇒ Object
11
12
13
|
# File 'lib/plugins/pre_commit/checks/jshint.rb', line 11
def linter_src
File.expand_path("../../../../pre-commit/support/jshint/jshint.js", __FILE__)
end
|
#run_check(file) ⇒ Object
7
8
9
|
# File 'lib/plugins/pre_commit/checks/jshint.rb', line 7
def run_check(file)
context.call("JSHINT._getErrors", File.read(file), js_config, js_config["globals"])
end
|