nowsecure / node-applesign

NodeJS module and commandline utility for re-signing iOS applications (IPA files).
https://www.nowsecure.com
MIT License
424 stars 77 forks source link

lint/undefined stuff #4

Closed dweinstein closed 8 years ago

dweinstein commented 8 years ago
± semistandard index.js | grep -v "indentation\|Unexpected\|space"
semistandard: Semicolons For All! (https://github.com/Flet/semistandard)
  /Users/user/work/node-codesign/index.js:27:26: Expected '===' and instead saw '=='.
  /Users/user/work/node-codesign/index.js:37:10: Expected '!==' and instead saw '!='.
  /Users/user/work/node-codesign/index.js:43:3: "err" is not defined.
  /Users/user/work/node-codesign/index.js:58:2: Missing semicolon.
  /Users/user/work/node-codesign/index.js:62:3: "err" is not defined.
  /Users/user/work/node-codesign/index.js:67:3: "err" is not defined.
  /Users/user/work/node-codesign/index.js:103:2: Missing semicolon.
  /Users/user/work/node-codesign/index.js:122:2: Missing semicolon.
  /Users/user/work/node-codesign/index.js:129:58: Missing semicolon.
  /Users/user/work/node-codesign/index.js:142:2: Missing semicolon.
  /Users/user/work/node-codesign/index.js:156:35: Expected error to be handled.
  /Users/user/work/node-codesign/index.js:163:2: Missing semicolon.
  /Users/user/work/node-codesign/index.js:169:13: Expected '===' and instead saw '=='.
  /Users/user/work/node-codesign/index.js:170:13: Strings must use singlequote.
  /Users/user/work/node-codesign/index.js:193:2: Missing semicolon.
  /Users/user/work/node-codesign/index.js:202:4: Expected an object to be thrown.
  /Users/user/work/node-codesign/index.js:211:28: Expected '!==' and instead saw '!='.
  /Users/user/work/node-codesign/index.js:213:19: Expected '!==' and instead saw '!='.
  /Users/user/work/node-codesign/index.js:221:44: Expected error to be handled.
  /Users/user/work/node-codesign/index.js:222:61: Expected error to be handled.
  /Users/user/work/node-codesign/index.js:223:48: Expected error to be handled.
  /Users/user/work/node-codesign/index.js:234:2: Missing semicolon.
  /Users/user/work/node-codesign/index.js:242:2: Missing semicolon.
  /Users/user/work/node-codesign/index.js:250:2: Missing semicolon.
  /Users/user/work/node-codesign/index.js:253:8: "zipfile" is defined but never used
  /Users/user/work/node-codesign/index.js:261:16: Missing semicolon.
  /Users/user/work/node-codesign/index.js:264:13: Expected '!==' and instead saw '!='.
  /Users/user/work/node-codesign/index.js:267:15: Expected '!==' and instead saw '!='.
  /Users/user/work/node-codesign/index.js:278:2: Missing semicolon.
  /Users/user/work/node-codesign/index.js:292:7: "msg" is not defined.
  /Users/user/work/node-codesign/index.js:302:2: Missing semicolon.
  /Users/user/work/node-codesign/index.js:309:3: Missing semicolon.
  /Users/user/work/node-codesign/index.js:312:3: Missing semicolon.
  /Users/user/work/node-codesign/index.js:315:3: Missing semicolon.
  /Users/user/work/node-codesign/index.js:317:2: Missing semicolon.
dweinstein commented 8 years ago

also I suggest using the instanceof check in the index module export to make sure new is called properly on the object.

e.g.:

// index.js
module.exports = Codesign;

function Codesign(options) {
  if (!(this instanceof Codesign)) {
    return new Codesign(options);
  }
}

or just use ES6 classes I guess...

dweinstein commented 8 years ago

bin/ipa-resign.js:

± semistandard bin/ipa-resign.js | grep -v "indentation\|Unexpected\|space"
semistandard: Semicolons For All! (https://github.com/Flet/semistandard)
  /Users/user/work/node-codesign/bin/ipa-resign.js:15:2: Missing semicolon.
  /Users/user/work/node-codesign/bin/ipa-resign.js:77:15: Strings must use singlequote.
dweinstein commented 8 years ago

https://docs.nodejitsu.com/articles/errors/what-are-the-error-conventions