Module: ZendeskAppsSupport::Validations::Source
- Defined in:
- lib/zendesk_apps_support/validations/source.rb
Constant Summary collapse
- LINTER_OPTIONS =
{ # enforcing options: noarg: true, undef: true, # relaxing options: eqnull: true, laxcomma: true, sub: true, # predefined globals: predef: %w(_ console services helpers alert window document self JSON Base64 clearInterval clearTimeout setInterval setTimeout require module exports top frames parent moment) }.freeze
Class Method Summary collapse
Class Method Details
.call(package) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/zendesk_apps_support/validations/source.rb', line 23 def call(package) app = package.files.find { |file| file.relative_path == 'app.js' } files = package.lib_files << app if package.requirements_only return app ? [ValidationError.new(:no_app_js_required)] : [] end return [ValidationError.new(:missing_source)] unless app jshint_errors(files).flatten! end |