summaryrefslogtreecommitdiff
path: root/packages/sw/src/scripts
diff options
context:
space:
mode:
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;
}