Add @typescript-eslint/prefer-nullish-coalescing eslint rule
This commit is contained in:
@@ -26,7 +26,7 @@ function testEvaluateKeyboardEvent(partialEvent: {
|
||||
ctrlKey: partialEvent.ctrlKey || false,
|
||||
shiftKey: partialEvent.shiftKey || false,
|
||||
metaKey: partialEvent.metaKey || false,
|
||||
keyCode: partialEvent.keyCode !== undefined ? partialEvent.keyCode : 0,
|
||||
keyCode: partialEvent.keyCode ?? 0,
|
||||
code: partialEvent.code || '',
|
||||
key: partialEvent.key || '',
|
||||
type: partialEvent.type || ''
|
||||
|
||||
@@ -9,7 +9,7 @@ function createEvent(partialEvent: Partial<IKeyboardEvent> = {}): IKeyboardEvent
|
||||
ctrlKey: partialEvent.ctrlKey || false,
|
||||
shiftKey: partialEvent.shiftKey || false,
|
||||
metaKey: partialEvent.metaKey || false,
|
||||
keyCode: partialEvent.keyCode !== undefined ? partialEvent.keyCode : 0,
|
||||
keyCode: partialEvent.keyCode ?? 0,
|
||||
code: partialEvent.code || '',
|
||||
key: partialEvent.key || '',
|
||||
type: partialEvent.type || 'keydown'
|
||||
|
||||
@@ -169,7 +169,7 @@ it('wcwidth should match all values from the old implementation', function(): vo
|
||||
if (num < 127) {
|
||||
return 1;
|
||||
}
|
||||
const t = table || initTable();
|
||||
const t = table ?? initTable();
|
||||
if (num < 65536) {
|
||||
return t[num >> 4] >> ((num & 15) << 1) & 3;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user