refactor(sw): Fix type errors in packages/sw (#9909)

* Fix type errors in packages/sw

* mouhitotsu

* @typesは越境しない

* Update packages/sw/src/scripts/create-notification.ts

---------

Co-authored-by: tamaina <tamaina@hotmail.co.jp>
This commit is contained in:
Kagami Sascha Rosylight 2023-02-12 16:31:37 +01:00 committed by GitHub
parent a71682f6f0
commit 9f0e0dc8ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 41 additions and 30 deletions

View file

@ -1,3 +1,7 @@
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;
}