summaryrefslogtreecommitdiff
path: root/packages/sw/src/scripts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-02-22 15:28:17 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2023-02-22 15:28:17 +0900
commit0fb9c372ddec7d5284d6402625cbaffc9ac7eb0b (patch)
treedfae9acf6103f3bb7a2bd0300326183659b3a29f /packages/sw/src/scripts
parentimprove performance of some tests (diff)
downloadsharkey-0fb9c372ddec7d5284d6402625cbaffc9ac7eb0b.tar.gz
sharkey-0fb9c372ddec7d5284d6402625cbaffc9ac7eb0b.tar.bz2
sharkey-0fb9c372ddec7d5284d6402625cbaffc9ac7eb0b.zip
lint
Diffstat (limited to 'packages/sw/src/scripts')
-rw-r--r--packages/sw/src/scripts/get-user-name.ts6
1 files changed, 1 insertions, 5 deletions
diff --git a/packages/sw/src/scripts/get-user-name.ts b/packages/sw/src/scripts/get-user-name.ts
index ccc38c298e..4daf203e06 100644
--- a/packages/sw/src/scripts/get-user-name.ts
+++ b/packages/sw/src/scripts/get-user-name.ts
@@ -1,7 +1,3 @@
export default function(user: { name?: string | null, username: string }): string {
- // Show username if name is empty.
- // XXX: typescript-eslint has no configuration to allow using `||` against string.
- // https://github.com/typescript-eslint/typescript-eslint/issues/4906
- // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
- return user.name || user.username;
+ return user.name === '' ? user.username : user.name ?? user.username;
}