Skip to content

Commit

Permalink
style: 🎨 fixed some linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Feb 26, 2021
1 parent 311e902 commit bdcbe31
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ module.exports = {
"plugin:import/warnings",
"plugin:import/typescript",
"prettier",
"prettier/@typescript-eslint",
"plugin:unicorn/recommended",
"plugin:promise/recommended",
"plugin:chai-expect/recommended",
Expand Down Expand Up @@ -44,6 +43,7 @@ module.exports = {
yoda: "error",
"prefer-spread": "error",
"prettier/prettier": "warn",
"unicorn/no-array-for-each": "off",
"unicorn/prevent-abbreviations": "off",
"unicorn/explicit-length-check": "off",
"unicorn/no-array-reduce": "off",
Expand Down
3 changes: 1 addition & 2 deletions src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ export class CommandParser {
// Fix incorrect handling of ops
for (const op of this.ops) {
if (rawPart !== op && rawPart.endsWith(op)) {
args.push(rawPart.slice(0, -op.length))
args.push(op)
args.push(rawPart.slice(0, -op.length), op)
return
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/spawn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import chalk from "chalk"
import { ChildProcess } from "child_process"
import { onProcessExit } from "./process"
import { spawn } from "cross-spawn"
import npmPath = require("npm-run-path")
import npmPath from "npm-run-path"

export class Spawner {
static children = new Map<number, ChildProcess>()
Expand Down Expand Up @@ -73,7 +73,7 @@ export class Spawner {
reject(this.onError(err))
})
child.on("close", (code) => {
this.exitCode = code
this.exitCode = code || 0
if (this.buffer.length) this.onLine(`${this.buffer}\n`)
this.buffer = ""
Spawner.children.delete(child.pid)
Expand Down
4 changes: 2 additions & 2 deletions src/terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import readline from "readline"
// eslint-disable-next-line import/default
import ansiLength from "string-width"

export function showCursor(stream = process.stderr) {
export function showCursor(stream: NodeJS.WriteStream = process.stderr) {
stream.isTTY && stream.write("\u001B[?25h")
}

export function hideCursor(stream = process.stderr) {
export function hideCursor(stream: NodeJS.WriteStream = process.stderr) {
if (!stream.isTTY) return
;(["SIGTERM", "SIGINT"] as const).forEach((event) =>
process.once(event, () => showCursor(stream))
Expand Down

0 comments on commit bdcbe31

Please sign in to comment.