From 78fb9afda573b6f738fdab76c01d119f9b861201 Mon Sep 17 00:00:00 2001 From: ssube Date: Mon, 2 Mar 2020 18:33:48 -0600 Subject: [PATCH] lint: fix nulls --- test/helpers/async.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/helpers/async.ts b/test/helpers/async.ts index 226555f..6cf68c4 100644 --- a/test/helpers/async.ts +++ b/test/helpers/async.ts @@ -1,5 +1,8 @@ import { AsyncHook, createHook } from 'async_hooks'; +/* eslint-disable-next-line @typescript-eslint/ban-types */ +export type Maybe = TValue | null | undefined; + // this will pull Mocha internals out of the stacks /* eslint-disable-next-line @typescript-eslint/no-var-requires */ const { stackTraceFilter } = require('mocha/lib/utils'); @@ -8,7 +11,8 @@ const filterStack = stackTraceFilter(); type AsyncMochaTest = (this: Mocha.Context | void) => Promise; type AsyncMochaSuite = (this: Mocha.Suite) => Promise; -function isNil(val: T | null | undefined): val is null | undefined { +/* eslint-disable-next-line @typescript-eslint/ban-types */ +function isNil(val: Maybe): val is null | undefined { /* eslint-disable-next-line no-null/no-null */ return val === null || val === undefined; }