-
Notifications
You must be signed in to change notification settings - Fork 69
chore: Add ESLint no-console and max-len rules #587
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,8 @@ var fs = require("fs"); | |
var url = require("url"); | ||
var net = require("net"); | ||
var when = require("when"); | ||
var utils = require("./utils"); | ||
var logger = utils.console; | ||
|
||
function postXPI(manifest, options) { | ||
var postURL = options.postUrl; | ||
|
@@ -40,16 +42,19 @@ function postXPI(manifest, options) { | |
reject(e); | ||
}); | ||
client.on("close", function(hadError) { | ||
console.log(hadError ? "Posting XPI to %s failed" : | ||
"Posted XPI to %s", postURL); | ||
if (hadError) { | ||
logger.error("Posting XPI to " + postURL + " failed"); | ||
} else { | ||
logger.info("Posted XPI to " + postURL); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And I guess I should also call out that I slightly changed the logic here, where I converted this to an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I saw that, looks good |
||
fs.unlink(xpiPath); | ||
console.log("Removed XPI from " + xpiPath); | ||
logger.info("Removed XPI from " + xpiPath); | ||
resolve(); | ||
}); | ||
}); | ||
}); | ||
}).then(null, function(err) { | ||
console.error(err); | ||
console.error(err); // eslint-disable-line no-console | ||
}); | ||
} | ||
module.exports = postXPI; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,11 +57,11 @@ function sign(options, config) { | |
} | ||
}); | ||
if (missingOptions.length) { | ||
console.error(); | ||
console.error(); // eslint-disable-line no-console | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think all these do need to be direct console calls. I forget why exactly but there was some reason. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only reason I can think of was to add some extra leading/trailing whitespace in the console.
And I wasn't convinced that my theory would be any cleaner or clearer. |
||
missingOptions.forEach(function(flag) { | ||
console.error(" error: missing required option `%s'", flag); | ||
console.error(" error: missing required option `%s'", flag); // eslint-disable-line no-console | ||
}); | ||
console.error(); | ||
console.error(); // eslint-disable-line no-console | ||
return reject(); | ||
} | ||
|
||
|
@@ -145,7 +145,7 @@ function signCmd(program, options, config) { | |
}).catch(function(err) { | ||
logger.error("FAIL"); | ||
if (err) { | ||
console.error(err.stack); | ||
console.error(err.stack); // eslint-disable-line no-console | ||
} | ||
config.systemProcess.exit(1); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these be concatenated and broken into separate lines like
/first/ + /second/
? That might be harder to read, I'm not sure.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you concatenate Regular Expressions?
Do half these even need to be regular expressions vs plain strings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ha, well, it's legacy cruft for sure. I wouldn't worry about it too much, eslint disable comments are fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I didn't feel like putting in TOO much effort on this, since it seems like ESLint has a fix in progress for ignoring long regular expressions.