Skip to content

Commit

Permalink
Chore: remove concat-stream dependency (#10173)
Browse files Browse the repository at this point in the history
We use the `concat-stream` module to get source text from stdin when the `--stdin` flag is used. However, getting text from stdin is a one-liner without `concat-stream`, so it's not necessary to keep it as a dependency.
  • Loading branch information
not-an-aardvark committed Apr 13, 2018
1 parent 7f69f11 commit 2e60017
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
7 changes: 2 additions & 5 deletions bin/eslint.js
Expand Up @@ -27,8 +27,7 @@ if (debug) {
//------------------------------------------------------------------------------

// now we can safely include the other modules that use debug
const concat = require("concat-stream"),
cli = require("../lib/cli"),
const cli = require("../lib/cli"),
path = require("path"),
fs = require("fs");

Expand Down Expand Up @@ -57,9 +56,7 @@ process.once("uncaughtException", err => {
});

if (useStdIn) {
process.stdin.pipe(concat({ encoding: "string" }, text => {
process.exitCode = cli.execute(process.argv, text);
}));
process.exitCode = cli.execute(process.argv, fs.readFileSync(process.stdin.fd, "utf8"));
} else if (init) {
const configInit = require("../lib/config/config-initializer");

Expand Down
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -37,7 +37,6 @@
"ajv": "^6.0.1",
"babel-code-frame": "^6.26.0",
"chalk": "^2.1.0",
"concat-stream": "^1.6.2",
"cross-spawn": "^6.0.5",
"debug": "^3.1.0",
"doctrine": "^2.1.0",
Expand Down

0 comments on commit 2e60017

Please sign in to comment.