diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-02-22 15:28:17 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2023-02-22 15:28:17 +0900 |
| commit | 0fb9c372ddec7d5284d6402625cbaffc9ac7eb0b (patch) | |
| tree | dfae9acf6103f3bb7a2bd0300326183659b3a29f /packages/sw/src/scripts | |
| parent | improve performance of some tests (diff) | |
| download | sharkey-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.ts | 6 |
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; } |