fix(lint): selectively allow null types
This commit is contained in:
parent
bb993466b7
commit
899dac262e
|
@ -42,6 +42,7 @@ export async function writeSource(path: string, data: string, stream = process.s
|
||||||
|
|
||||||
export function writeStream(stream: NodeJS.WriteStream, data: string): Promise<void> {
|
export function writeStream(stream: NodeJS.WriteStream, data: string): Promise<void> {
|
||||||
return new Promise((res, rej) => {
|
return new Promise((res, rej) => {
|
||||||
|
/* eslint-disable-next-line @typescript-eslint/ban-types */
|
||||||
stream.write(data, (err: Error | null | undefined) => {
|
stream.write(data, (err: Error | null | undefined) => {
|
||||||
if (isNil(err)) {
|
if (isNil(err)) {
|
||||||
res();
|
res();
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
import { isNil } from 'lodash';
|
import { isNil } from 'lodash';
|
||||||
|
|
||||||
|
/* eslint-disable @typescript-eslint/ban-types */
|
||||||
|
|
||||||
export function doesExist<T>(val: T | null | undefined): val is T {
|
export function doesExist<T>(val: T | null | undefined): val is T {
|
||||||
return !isNil(val);
|
return !isNil(val);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ const filterStack = stackTraceFilter();
|
||||||
type AsyncMochaTest = (this: Mocha.Context | void) => Promise<void>;
|
type AsyncMochaTest = (this: Mocha.Context | void) => Promise<void>;
|
||||||
type AsyncMochaSuite = (this: Mocha.Suite) => Promise<void>;
|
type AsyncMochaSuite = (this: Mocha.Suite) => Promise<void>;
|
||||||
|
|
||||||
|
/* eslint-disable-next-line @typescript-eslint/ban-types */
|
||||||
function isNil<T>(val: T | null | undefined): val is null | undefined {
|
function isNil<T>(val: T | null | undefined): val is null | undefined {
|
||||||
/* eslint-disable-next-line no-null/no-null */
|
/* eslint-disable-next-line no-null/no-null */
|
||||||
return val === null || val === undefined;
|
return val === null || val === undefined;
|
||||||
|
|
Loading…
Reference in New Issue