lint: fix nulls
This commit is contained in:
parent
7d39c206d1
commit
78fb9afda5
|
@ -1,5 +1,8 @@
|
|||
import { AsyncHook, createHook } from 'async_hooks';
|
||||
|
||||
/* eslint-disable-next-line @typescript-eslint/ban-types */
|
||||
export type Maybe<TValue> = 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<void>;
|
||||
type AsyncMochaSuite = (this: Mocha.Suite) => Promise<void>;
|
||||
|
||||
function isNil<T>(val: T | null | undefined): val is null | undefined {
|
||||
/* eslint-disable-next-line @typescript-eslint/ban-types */
|
||||
function isNil<T>(val: Maybe<T>): val is null | undefined {
|
||||
/* eslint-disable-next-line no-null/no-null */
|
||||
return val === null || val === undefined;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue