Permalink
Browse files

Chore: Lint bin/eslint.js (#7243)

  • Loading branch information...
1 parent 87625fa commit d1542046a204a8ecaf8e8f1f12a533b98e341e8f @platinumazure platinumazure committed with gyandeeps Sep 26, 2016
Showing with 11 additions and 8 deletions.
  1. +0 −1 .eslintignore
  2. +1 −1 Makefile.js
  3. +10 −6 bin/eslint.js
View
@@ -1,4 +1,3 @@
-/bin/**
/build/**
/coverage/**
/docs/**
View
@@ -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(),
View
@@ -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);
@@ -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");
@@ -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 || {}));
@@ -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;

0 comments on commit d154204

Please sign in to comment.