Skip to content

Commit

Permalink
style(eslint): 🎨 fixed linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jan 22, 2020
1 parent 3467581 commit 9a048b8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
14 changes: 14 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "lint:eslint",
"problemMatcher": [
"$eslint-stylish"
]
}
]
}
6 changes: 3 additions & 3 deletions src/spawn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ export class Spawner {
spawn(raw = false) {
const child = spawn(this.cmd, this.args, {
stdio: raw ? "inherit" : "pipe",
env: { ...process.env, FORCE_COLOR: chalk.level + "" },
env: { ...process.env, FORCE_COLOR: `${chalk.level}` },
})
const processData = (data: string) => {
data = `${data}`
this.output += data
let chunk = data + ""
let chunk = `${data}`
let nl
while ((nl = chunk.indexOf("\n")) >= 0) {
const line = this.buffer + chunk.slice(0, nl)
Expand All @@ -50,7 +50,7 @@ export class Spawner {
reject(this.onError(err))
})
child.on("exit", code => {
if (this.buffer.length) this.onLine(this.buffer + "\n")
if (this.buffer.length) this.onLine(`${this.buffer}\n`)
this.buffer = ""
if (code) reject(this.onExit(code))
else resolve()
Expand Down

0 comments on commit 9a048b8

Please sign in to comment.