Skip to content

Commit a8575af

Browse files
fix: fix some ESLint errors (#171)
1 parent 61eb746 commit a8575af

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/ts/index.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { Timeline, Tweet } from "twi-ext";
1+
import { Timeline, type Tweet } from "twi-ext";
22

33
// eslint-disable-next-line max-statements
44
const onNewTweet = (tweet: Tweet): void => {
55
const tweetElement = tweet.element;
66
const viewCountWithIcon = tweetElement.querySelector<HTMLAnchorElement>("[role='group'] a[href$='analytics']");
7-
if (viewCountWithIcon && viewCountWithIcon.parentElement) {
7+
if (viewCountWithIcon?.parentElement) {
88
/*
99
* Measures against incompatibility with "Minimal Theme for Twitter" or other extensions.
1010
* See [#7](https://github.com/Robot-Inventor/hide-view-count/issues/7)
@@ -14,12 +14,7 @@ const onNewTweet = (tweet: Tweet): void => {
1414
}
1515

1616
const time = document.querySelector<HTMLElement>(`a[aria-describedby] time`);
17-
if (
18-
time &&
19-
time.parentElement &&
20-
time.parentElement.parentElement &&
21-
time.parentElement.parentElement.parentElement
22-
) {
17+
if (time?.parentElement?.parentElement?.parentElement) {
2318
const timeAndViewCountOuter = time.parentElement.parentElement.parentElement;
2419
const targets = timeAndViewCountOuter.querySelectorAll<HTMLElement>("div ~ *");
2520
for (const target of targets) {

0 commit comments

Comments
 (0)