Skip to content

Commit

Permalink
Merge branch 'master' into kg-silent
Browse files Browse the repository at this point in the history
# Conflicts:
#	Makefile
  • Loading branch information
kevgo committed Oct 28, 2020
2 parents f4c4d9c + 727b4fe commit 061b2a4
Show file tree
Hide file tree
Showing 9 changed files with 611 additions and 70 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
@@ -0,0 +1,2 @@
dist
node_modules
21 changes: 21 additions & 0 deletions .eslintrc.json
@@ -0,0 +1,21 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"typescript-sort-keys",
"simple-import-sort"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:typescript-sort-keys/recommended"
],
"rules": {
"simple-import-sort/sort": "error"
},
"parserOptions": {
"project": "./tsconfig.json"
}
}
9 changes: 6 additions & 3 deletions Makefile
Expand Up @@ -14,18 +14,21 @@ doc: # runs the documentation tests
${CURDIR}/node_modules/.bin/text-run --offline --format=dot

fix: # runs the fixers
${CURDIR}/node_modules/.bin/tslint --project . --fix
${CURDIR}/node_modules/.bin/eslint --fix --ext=.ts .
${CURDIR}/node_modules/.bin/prettier --write .

help: # prints all make targets
cat Makefile | grep '^[^ ]*:' | grep -v '.PHONY' | grep -v help | sed 's/:.*#/#/' | column -s "#" -t

lint: # runs all linters
${CURDIR}/node_modules/.bin/tslint --project .
${CURDIR}/node_modules/.bin/eslint --ext=.ts .
${CURDIR}/node_modules/.bin/prettier -l .

publish: # deploys the current version to npmjs.com
npm publish

test: # runs all tests
${CURDIR}/node_modules/.bin/tslint --project . &
${CURDIR}/node_modules/.bin/eslint --ext=.ts . &
${CURDIR}/node_modules/.bin/prettier -l . &
${CURDIR}/node_modules/.bin/text-run --offline --format=dot &
${CURDIR}/node_modules/.bin/mocha src/test.ts
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -45,4 +45,4 @@ for you:
To deploy:

- update the version in `package.json` and commit to `master`
- run `npm publish`
- run <b type="make/command">make publish</b>
6 changes: 5 additions & 1 deletion package.json
Expand Up @@ -13,15 +13,19 @@
"@types/mocha": "8.0.3",
"@types/node": "14.14.0",
"@types/ps-tree": "1.1.0",
"@typescript-eslint/eslint-plugin": "4.5.0",
"@typescript-eslint/parser": "4.5.0",
"coveralls": "3.1.0",
"eslint": "7.11.0",
"eslint-plugin-simple-import-sort": "5.0.3",
"eslint-plugin-typescript-sort-keys": "1.5.0",
"mocha": "8.2.0",
"nyc": "15.1.0",
"prettier": "2.1.2",
"source-map-support": "0.5.19",
"text-runner": "5.0.0-pre10",
"textrun-make": "0.0.10",
"ts-node": "9.0.0",
"tslint": "6.1.3",
"typescript": "4.0.3"
},
"files": [
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Expand Up @@ -4,7 +4,7 @@ import util from "util"
const debug = deb("end-child-processes")
const psTreeA = util.promisify(psTree)

export async function endChildProcesses() {
export async function endChildProcesses(): Promise<void> {
const children = await psTreeA(process.pid)
for (const child of children) {
if (child.COMMAND === "ps") {
Expand All @@ -15,6 +15,7 @@ export async function endChildProcesses() {
try {
process.kill(processID)
} catch (e) {
// eslint-disable-next-line
debug(`cannot kill process ${processID} (${child.COMMAND}): ${e.message}`)
}
}
Expand Down
1 change: 1 addition & 0 deletions src/test.ts
Expand Up @@ -3,6 +3,7 @@ import childProcess from "child_process"
import { test } from "mocha"
import psTree from "ps-tree"
import util from "util"

import { endChildProcesses } from "./index"
const psTreeA = util.promisify(psTree)

Expand Down
15 changes: 0 additions & 15 deletions tslint.yml

This file was deleted.

0 comments on commit 061b2a4

Please sign in to comment.