diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2020-08-11 21:40:23 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2020-08-11 21:40:23 +0900 |
commit | 0b98a22eba4f7bbac215abd800293ac2be67b24d (patch) | |
tree | ae78b7edc460a79708742bff55c4c6fa55699e47 /src/background | |
parent | f497109ecc801660dc23bbad8445b120cd75561e (diff) |
Enable @typescript-eslint/no-extra-non-null-assertion
Diffstat (limited to 'src/background')
5 files changed, 18 insertions, 18 deletions
diff --git a/src/background/completion/impl/BookmarkRepositoryImpl.ts b/src/background/completion/impl/BookmarkRepositoryImpl.ts index 2bc779d..ed6c5a6 100644 --- a/src/background/completion/impl/BookmarkRepositoryImpl.ts +++ b/src/background/completion/impl/BookmarkRepositoryImpl.ts @@ -23,7 +23,7 @@ export default class CachedBookmarkRepository implements BookmarkRepository { .filter((item) => { let url = undefined; try { - url = new URL(item.url!!); + url = new URL(item.url!); } catch (e) { return false; } @@ -31,8 +31,8 @@ export default class CachedBookmarkRepository implements BookmarkRepository { }) .slice(0, COMPLETION_ITEM_LIMIT) .map((item) => ({ - title: item.title!!, - url: item.url!!, + title: item.title!, + url: item.url!, })); } @@ -41,7 +41,7 @@ export default class CachedBookmarkRepository implements BookmarkRepository { return query.split(" ").every((keyword) => { return ( item.title.toLowerCase().includes(keyword.toLowerCase()) || - item.url!!.includes(keyword) + item.url!.includes(keyword) ); }); }); diff --git a/src/background/completion/impl/HistoryRepositoryImpl.ts b/src/background/completion/impl/HistoryRepositoryImpl.ts index b1992a4..3bf064e 100644 --- a/src/background/completion/impl/HistoryRepositoryImpl.ts +++ b/src/background/completion/impl/HistoryRepositoryImpl.ts @@ -36,8 +36,8 @@ export default class CachedHistoryRepository implements HistoryRepository { .sort((x, y) => Number(y.visitCount) - Number(x.visitCount)) .slice(0, COMPLETION_ITEM_LIMIT) .map((item) => ({ - title: item.title!!, - url: item.url!!, + title: item.title!, + url: item.url!, })); } @@ -59,8 +59,8 @@ export default class CachedHistoryRepository implements HistoryRepository { return items.filter((item) => { return query.split(" ").every((keyword) => { return ( - item.title!!.toLowerCase().includes(keyword.toLowerCase()) || - item.url!!.includes(keyword) + item.title!.toLowerCase().includes(keyword.toLowerCase()) || + item.url!.includes(keyword) ); }); }); diff --git a/src/background/completion/impl/TabRepositoryImpl.ts b/src/background/completion/impl/TabRepositoryImpl.ts index 5e33e5a..a279bd4 100644 --- a/src/background/completion/impl/TabRepositoryImpl.ts +++ b/src/background/completion/impl/TabRepositoryImpl.ts @@ -30,10 +30,10 @@ export default class TabRepositoryImpl implements TabRepository { private static toEntity(tab: browser.tabs.Tab): Tab { return { - id: tab.id!!, - url: tab.url!!, + id: tab.id!, + url: tab.url!, active: tab.active, - title: tab.title!!, + title: tab.title!, faviconUrl: tab.favIconUrl, index: tab.index, }; diff --git a/src/background/usecases/NavigateUseCase.ts b/src/background/usecases/NavigateUseCase.ts index 2e887e7..974606c 100644 --- a/src/background/usecases/NavigateUseCase.ts +++ b/src/background/usecases/NavigateUseCase.ts @@ -11,27 +11,27 @@ export default class NavigateUseCase { async openHistoryNext(): Promise<void> { const tab = await this.tabPresenter.getCurrent(); - await this.navigateClient.historyNext(tab.id!!); + await this.navigateClient.historyNext(tab.id!); } async openHistoryPrev(): Promise<void> { const tab = await this.tabPresenter.getCurrent(); - await this.navigateClient.historyPrev(tab.id!!); + await this.navigateClient.historyPrev(tab.id!); } async openLinkNext(): Promise<void> { const tab = await this.tabPresenter.getCurrent(); - await this.navigateClient.linkNext(tab.id!!); + await this.navigateClient.linkNext(tab.id!); } async openLinkPrev(): Promise<void> { const tab = await this.tabPresenter.getCurrent(); - await this.navigateClient.linkPrev(tab.id!!); + await this.navigateClient.linkPrev(tab.id!); } async openParent(): Promise<void> { const tab = await this.tabPresenter.getCurrent(); - const url = new URL(tab.url!!); + const url = new URL(tab.url!); if (url.hash.length > 0) { url.hash = ""; } else if (url.search.length > 0) { @@ -50,7 +50,7 @@ export default class NavigateUseCase { async openRoot(): Promise<void> { const tab = await this.tabPresenter.getCurrent(); - const url = new URL(tab.url!!); + const url = new URL(tab.url!); await this.tabPresenter.open(url.origin); } } diff --git a/src/background/usecases/SettingUseCase.ts b/src/background/usecases/SettingUseCase.ts index ccee227..34c1f3a 100644 --- a/src/background/usecases/SettingUseCase.ts +++ b/src/background/usecases/SettingUseCase.ts @@ -36,7 +36,7 @@ export default class SettingUseCase { this.showUnableToLoad(e); value = DefaultSettingData.toSettings(); } - await this.cachedSettingRepository.update(value!!); + await this.cachedSettingRepository.update(value!); return value; } |