conductor.js icon indicating copy to clipboard operation
conductor.js copied to clipboard

Grunt build aborts after failing JSHint

Open alvincrespo opened this issue 11 years ago • 4 comments

When running grunt build after installing npm dependencies, I get the following JSHint errors:

Running "jshint:all" (jshint) task
Linting lib/conductor.js ...ERROR
[L7:C5] W079: Redefinition of 'Conductor'.
var Conductor = function(options) {
Linting lib/conductor.js ...ERROR
[L45:C5] W079: Redefinition of 'RSVP'.
    RSVP = Conductor.Oasis.RSVP,
Linting lib/conductor.js ...ERROR
[L3:C16] W117: 'ConductorShims' is not defined.
var o_create = ConductorShims.o_create,
Linting lib/conductor.js ...ERROR
[L4:C17] W117: 'ConductorShims' is not defined.
    a_forEach = ConductorShims.a_forEach,
Linting lib/conductor.js ...ERROR
[L5:C17] W117: 'ConductorShims' is not defined.
    a_indexOf = ConductorShims.a_indexOf;
Linting lib/conductor.js ...ERROR
[L11:C23] W117: 'oasis' is not defined.
                      oasis.configuration.oasisURL ||
Linting lib/conductor/card.js ...ERROR
[L6:C18] W117: 'ConductorShims' is not defined.
      o_create = ConductorShims.o_create,
Linting lib/conductor/card.js ...ERROR
[L7:C19] W117: 'ConductorShims' is not defined.
      a_forEach = ConductorShims.a_forEach,
Linting lib/conductor/card.js ...ERROR
[L8:C15] W117: 'ConductorShims' is not defined.
      a_map = ConductorShims.a_map;
Linting lib/conductor/card.js ...ERROR
[L46:C31] W117: 'oasis' is not defined.
    this.consumers = o_create(oasis.consumers);
Linting lib/conductor/card.js ...ERROR
[L77:C5] W117: 'oasis' is not defined.
    oasis.connect(cardOptions);
Linting lib/conductor/card.js ...ERROR
[L86:C7] W117: 'oasis' is not defined.
      oasis.portFor('data').send('updateData', { bucket: name, object: hash });
Linting lib/conductor/card.js ...ERROR
[L153:C27] W117: 'PathUtils' is not defined.
                var url = PathUtils.cardResourceUrl(base, resourceUrl);
Linting lib/conductor/card.js ...ERROR
[L154:C24] W117: 'PathUtils' is not defined.
                return PathUtils.cardResourceUrl(getBase(), url);
Linting lib/consumers/height_consumer.js ...ERROR
[L36:C5] W079: Redefinition of 'MutationObserver'.
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
Linting lib/consumers/render_consumer.js ...ERROR
[L20:C16] W117: 'DomUtils' is not defined.
    newStyle = DomUtils.createStyleElement(css);
Linting lib/consumers/xhr_consumer.js ...ERROR
[L3:C17] W117: 'ConductorShims' is not defined.
var a_forEach = ConductorShims.a_forEach;
Linting lib/consumers/xhr_consumer.js ...ERROR
[L29:C19] W117: 'DomUtils' is not defined.
          style = DomUtils.createStyleElement(data);
Linting lib/loader.js ...ERROR
[L2:C7] W079: Redefinition of 'define'.
  var define, requireModule;
Linting lib/loader.js ...ERROR
[L2:C15] W079: Redefinition of 'requireModule'.
  var define, requireModule;
Linting lib/loader.js ...ERROR
[L7:C5] W020: Read only.
    define = function(name, deps, callback) {
Linting lib/loader.js ...ERROR
[L11:C5] W020: Read only.
    requireModule = function(name) {
Linting lib/shims.js ...ERROR
[L53:C18] W116: Expected '!==' and instead saw '!='.
  if (typeof fun != "function")
Linting lib/shims.js ...ERROR
[L85:C11] W116: Expected '!==' and instead saw '!='.
    if (n != n) { // shortcut for verifying if it's NaN
Linting lib/shims.js ...ERROR
[L87:C18] W116: Expected '!==' and instead saw '!='.
    } else if (n != 0 && n != Infinity && n != -Infinity) {
Linting lib/shims.js ...ERROR
[L87:C28] W116: Expected '!==' and instead saw '!='.
    } else if (n != 0 && n != Infinity && n != -Infinity) {
Linting lib/shims.js ...ERROR
[L87:C45] W116: Expected '!==' and instead saw '!='.
    } else if (n != 0 && n != Infinity && n != -Infinity) {
Linting lib/utils/path.js ...ERROR
[L1:C16] W117: 'ConductorShims' is not defined.
var a_filter = ConductorShims.a_filter;
Linting test/tests/conductor_test.js ...ERROR
[L21:C19] W117: 'newConductor' is not defined.
  var conductor = newConductor();
Linting test/tests/conductor_test.js ...ERROR
[L32:C19] W117: 'newConductor' is not defined.
  var conductor = newConductor(),
Linting test/tests/conductor_test.js ...ERROR
[L49:C19] W117: 'newConductor' is not defined.
  var conductor = newConductor(),
Linting test/tests/conductor_test.js ...ERROR
[L70:C19] W117: 'newConductor' is not defined.
  var conductor = newConductor();
Linting test/tests/conductor_test.js ...ERROR
[L83:C19] W117: 'newConductor' is not defined.
  var conductor = newConductor();
Linting test/tests/conductor_test.js ...ERROR
[L93:C19] W117: 'newConductor' is not defined.
  var conductor = newConductor(),
Linting test/tests/conductor_test.js ...ERROR
[L115:C19] W117: 'newConductor' is not defined.
  var conductor = newConductor(),
Linting test/tests/conductor_test.js ...ERROR
[L144:C19] W117: 'newConductor' is not defined.
  var conductor = newConductor({
Linting test/tests/conductor_test.js ...ERROR
[L167:C19] W117: 'newConductor' is not defined.
  var conductor = newConductor({
Linting test/tests/conductor_test.js ...ERROR
[L189:C19] W117: 'newConductor' is not defined.
  var conductor = newConductor({
Linting test/tests/conductor_test.js ...ERROR
[L211:C19] W117: 'newConductor' is not defined.
  var conductor = newConductor(),
Linting test/tests/conductor_test.js ...ERROR
[L220:C19] W117: 'newConductor' is not defined.
  var conductor = newConductor(),
Linting test/tests/data_test.js ...ERROR
[L7:C17] W117: 'newConductor' is not defined.
    conductor = newConductor();
Linting test/tests/height_test.js ...ERROR
[L5:C17] W117: 'newConductor' is not defined.
    conductor = newConductor();
Linting test/tests/metadata_test.js ...ERROR
[L7:C17] W117: 'newConductor' is not defined.
    conductor = newConductor();
Linting test/tests/multiplex_test.js ...ERROR
[L22:C19] W117: 'newConductor' is not defined.
  var conductor = newConductor(),
Linting test/tests/multiplex_test.js ...ERROR
[L35:C19] W117: 'newConductor' is not defined.
  var conductor = newConductor(),
Linting test/tests/multiplex_test.js ...ERROR
[L48:C19] W117: 'newConductor' is not defined.
  var conductor = newConductor(),
Linting test/tests/promise_test.js ...ERROR
[L15:C19] W117: 'newConductor' is not defined.
  var conductor = newConductor(),
Linting test/tests/promise_test.js ...ERROR
[L33:C19] W117: 'newConductor' is not defined.
  var conductor = newConductor(),
Linting test/tests/promise_test.js ...ERROR
[L44:C19] W117: 'newConductor' is not defined.
  var conductor = newConductor(),
Linting test/tests/promise_test.js ...ERROR
[L56:C19] W117: 'newConductor' is not defined.
  var conductor = newConductor(),
Linting test/tests/promise_test.js ...ERROR
[L66:C19] W117: 'newConductor' is not defined.
  var conductor = newConductor(),
Linting test/tests/render_test.js ...ERROR
[L7:C17] W117: 'newConductor' is not defined.
    conductor = newConductor();
Linting test/tests/xhr_test.js ...ERROR
[L7:C17] W117: 'newConductor' is not defined.
    conductor = newConductor();

Warning: Task "jshint:all" failed. Use --force to continue.

Aborted due to warnings.

alvincrespo avatar Oct 04 '13 15:10 alvincrespo

I forgot to mention that this only happens when I install conductor.js as a dependency using bower for another project.

e.g.

bower install conductor.js -S
cd vendor/conductor.js
npm install
grunt build

alvincrespo avatar Oct 04 '13 15:10 alvincrespo

https://github.com/stefanpenner/ember-app-kit/blob/master/tasks/options/jshint.js#L24-L27 would help, at-least for the non-CI runs.

stefanpenner avatar Oct 04 '13 15:10 stefanpenner

@stefanpenner I was successfully able to make everything work fine by doing a force initially - I'm just not sure if theres a specific reason why this would fail due to a bower install? Maybe not a big thing since its already built - but just wanted to raise the issue.

alvincrespo avatar Oct 04 '13 17:10 alvincrespo

@alvincrespo jshint will pass on the source (or at least it ought to!) but we can't get it to pass on the built file because it includes dependencies that do not pass jshint.

Also we have shims taken directly from the mozilla developer network that don't pass jshint. Do you happen to know of an option for ignoring n != 0 checks?

hjdivad avatar Oct 08 '13 18:10 hjdivad