Skip to content

Commit

Permalink
Chore: Lint bin/eslint.js (#7243)
Browse files Browse the repository at this point in the history
  • Loading branch information
platinumazure authored and gyandeeps committed Sep 26, 2016
1 parent 87625fa commit d154204
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
1 change: 0 additions & 1 deletion .eslintignore
@@ -1,4 +1,3 @@
/bin/**
/build/**
/coverage/**
/docs/**
Expand Down
2 changes: 1 addition & 1 deletion Makefile.js
Expand Up @@ -62,7 +62,7 @@ const NODE = "node ", // intentional extra space

// Files
MAKEFILE = "./Makefile.js",
JS_FILES = "lib/**/*.js conf/**/*.js",
JS_FILES = "lib/**/*.js conf/**/*.js bin/**/*.js",
JSON_FILES = find("conf/").filter(fileType("json")),
MARKDOWN_FILES_ARRAY = find("docs/").concat(ls(".")).filter(fileType("md")),
TEST_FILES = getTestFilePatterns(),
Expand Down
16 changes: 10 additions & 6 deletions bin/eslint.js
Expand Up @@ -5,13 +5,15 @@
* @author Nicholas C. Zakas
*/

/* eslint no-console:off, no-process-exit:off */

"use strict";

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

var useStdIn = (process.argv.indexOf("--stdin") > -1),
const useStdIn = (process.argv.indexOf("--stdin") > -1),
init = (process.argv.indexOf("--init") > -1),
debug = (process.argv.indexOf("--debug") > -1);

Expand All @@ -25,7 +27,7 @@ if (debug) {
//------------------------------------------------------------------------------

// now we can safely include the other modules that use debug
var concat = require("concat-stream"),
const concat = require("concat-stream"),
cli = require("../lib/cli"),
path = require("path"),
fs = require("fs");
Expand All @@ -34,12 +36,13 @@ var concat = require("concat-stream"),
// Execution
//------------------------------------------------------------------------------

process.on("uncaughtException", function(err){
process.on("uncaughtException", function(err) {

// lazy load
var lodash = require("lodash");
const lodash = require("lodash");

if (typeof err.messageTemplate === "string" && err.messageTemplate.length > 0) {
var template = lodash.template(fs.readFileSync(path.resolve(__dirname, "../messages/" + err.messageTemplate + ".txt"), "utf-8"));
const template = lodash.template(fs.readFileSync(path.resolve(__dirname, "../messages/" + err.messageTemplate + ".txt"), "utf-8"));

console.log("\nOops! Something went wrong! :(");
console.log("\n" + template(err.messageData || {}));
Expand All @@ -62,7 +65,8 @@ if (useStdIn) {
}
}));
} else if (init) {
var configInit = require("../lib/config/config-initializer");
const configInit = require("../lib/config/config-initializer");

configInit.initializeConfig(function(err) {
if (err) {
process.exitCode = 1;
Expand Down

0 comments on commit d154204

Please sign in to comment.