Add @typescript-eslint/prefer-nullish-coalescing eslint rule

This commit is contained in:
Daniel Imms
2026-01-31 08:43:05 -08:00
parent 01450f044a
commit bad7e329df
32 changed files with 117 additions and 151 deletions
+1 -3
View File
@@ -36,9 +36,7 @@ export class ApcParser implements IApcParser {
* @param handler The handler to register
*/
public registerHandler(ident: number, handler: IApcHandler): IDisposable {
if (this._handlers[ident] === undefined) {
this._handlers[ident] = [];
}
this._handlers[ident] ??= [];
const handlerList = this._handlers[ident];
handlerList.push(handler);
return {
+1 -3
View File
@@ -29,9 +29,7 @@ export class DcsParser implements IDcsParser {
}
public registerHandler(ident: number, handler: IDcsHandler): IDisposable {
if (this._handlers[ident] === undefined) {
this._handlers[ident] = [];
}
this._handlers[ident] ??= [];
const handlerList = this._handlers[ident];
handlerList.push(handler);
return {
+2 -6
View File
@@ -362,9 +362,7 @@ export class EscapeSequenceParser extends Disposable implements IEscapeSequenceP
public registerEscHandler(id: IFunctionIdentifier, handler: EscHandlerType): IDisposable {
const ident = this._identifier(id, [0x30, 0x7e]);
if (this._escHandlers[ident] === undefined) {
this._escHandlers[ident] = [];
}
this._escHandlers[ident] ??= [];
const handlerList = this._escHandlers[ident];
handlerList.push(handler);
return {
@@ -395,9 +393,7 @@ export class EscapeSequenceParser extends Disposable implements IEscapeSequenceP
public registerCsiHandler(id: IFunctionIdentifier, handler: CsiHandlerType): IDisposable {
const ident = this._identifier(id);
if (this._csiHandlers[ident] === undefined) {
this._csiHandlers[ident] = [];
}
this._csiHandlers[ident] ??= [];
const handlerList = this._csiHandlers[ident];
handlerList.push(handler);
return {
+1 -3
View File
@@ -23,9 +23,7 @@ export class OscParser implements IOscParser {
};
public registerHandler(ident: number, handler: IOscHandler): IDisposable {
if (this._handlers[ident] === undefined) {
this._handlers[ident] = [];
}
this._handlers[ident] ??= [];
const handlerList = this._handlers[ident];
handlerList.push(handler);
return {