From 899dac262ec10948a25d182dd58d96518380c2b1 Mon Sep 17 00:00:00 2001 From: ssube Date: Wed, 19 Feb 2020 23:05:40 -0600 Subject: [PATCH] fix(lint): selectively allow null types --- src/source.ts | 1 + src/utils/index.ts | 2 ++ test/helpers/async.ts | 1 + 3 files changed, 4 insertions(+) diff --git a/src/source.ts b/src/source.ts index 5538391..fca72d7 100644 --- a/src/source.ts +++ b/src/source.ts @@ -42,6 +42,7 @@ export async function writeSource(path: string, data: string, stream = process.s export function writeStream(stream: NodeJS.WriteStream, data: string): Promise { return new Promise((res, rej) => { + /* eslint-disable-next-line @typescript-eslint/ban-types */ stream.write(data, (err: Error | null | undefined) => { if (isNil(err)) { res(); diff --git a/src/utils/index.ts b/src/utils/index.ts index 4213c03..bb0839a 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,5 +1,7 @@ import { isNil } from 'lodash'; +/* eslint-disable @typescript-eslint/ban-types */ + export function doesExist(val: T | null | undefined): val is T { return !isNil(val); } diff --git a/test/helpers/async.ts b/test/helpers/async.ts index 226555f..b9769be 100644 --- a/test/helpers/async.ts +++ b/test/helpers/async.ts @@ -8,6 +8,7 @@ const filterStack = stackTraceFilter(); type AsyncMochaTest = (this: Mocha.Context | void) => Promise; type AsyncMochaSuite = (this: Mocha.Suite) => Promise; +/* eslint-disable-next-line @typescript-eslint/ban-types */ function isNil(val: T | null | undefined): val is null | undefined { /* eslint-disable-next-line no-null/no-null */ return val === null || val === undefined;