Skip to content

Commit a098858

Browse files
committed
force delimiters to follow semi
1 parent 81e85c1 commit a098858

19 files changed

+283
-282
lines changed

.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"@typescript-eslint/no-unused-vars": "error",
2424
"no-self-assign": "off",
2525
"@typescript-eslint/no-empty-interface": "off",
26-
"react/prop-types": [2, { "ignore": ["children"] }]
26+
"react/prop-types": [2, { "ignore": ["children"] }],
27+
"@typescript-eslint/member-delimiter-style": "warn"
2728
},
2829
"settings": {
2930
"react": {

src/components/NoticeComponent.tsx

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,42 +8,42 @@ enum CountdownMode {
88
}
99

1010
export interface NoticeProps {
11-
noticeTitle: string,
12-
13-
maxCountdownTime?: () => number,
14-
dontPauseCountdown?: boolean,
15-
amountOfPreviousNotices?: number,
16-
showInSecondSlot?: boolean,
17-
timed?: boolean,
18-
idSuffix?: string,
19-
20-
fadeIn?: boolean,
21-
startFaded?: boolean,
22-
firstColumn?: React.ReactElement[] | React.ReactElement,
23-
firstRow?: React.ReactElement,
24-
bottomRow?: React.ReactElement[],
25-
26-
smaller?: boolean,
27-
limitWidth?: boolean,
28-
extraClass?: string,
29-
hideLogo?: boolean,
30-
hideRightInfo?: boolean,
11+
noticeTitle: string;
12+
13+
maxCountdownTime?: () => number;
14+
dontPauseCountdown?: boolean;
15+
amountOfPreviousNotices?: number;
16+
showInSecondSlot?: boolean;
17+
timed?: boolean;
18+
idSuffix?: string;
19+
20+
fadeIn?: boolean;
21+
startFaded?: boolean;
22+
firstColumn?: React.ReactElement[] | React.ReactElement;
23+
firstRow?: React.ReactElement;
24+
bottomRow?: React.ReactElement[];
25+
26+
smaller?: boolean;
27+
limitWidth?: boolean;
28+
extraClass?: string;
29+
hideLogo?: boolean;
30+
hideRightInfo?: boolean;
3131

3232
// Callback for when this is closed
33-
closeListener: () => void,
34-
onMouseEnter?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void,
33+
closeListener: () => void;
34+
onMouseEnter?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
3535

36-
zIndex?: number,
37-
style?: React.CSSProperties
36+
zIndex?: number;
37+
style?: React.CSSProperties;
3838
biggerCloseButton?: boolean;
39-
children?: React.ReactNode
39+
children?: React.ReactNode;
4040
}
4141

4242
export interface NoticeState {
43-
maxCountdownTime: () => number,
43+
maxCountdownTime: () => number;
4444

45-
countdownTime: number,
46-
countdownMode: CountdownMode,
45+
countdownTime: number;
46+
countdownMode: CountdownMode;
4747

4848
mouseHovering: boolean;
4949

src/components/NoticeTextSectionComponent.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import * as React from "react";
22

33
export interface NoticeTextSelectionProps {
4-
icon?: string,
5-
text: string,
6-
idSuffix: string,
7-
onClick?: (event: React.MouseEvent) => unknown,
8-
children?: React.ReactNode
4+
icon?: string;
5+
text: string;
6+
idSuffix: string;
7+
onClick?: (event: React.MouseEvent) => unknown;
8+
children?: React.ReactNode;
99
}
1010

1111
export interface NoticeTextSelectionState {

src/components/SponsorTimeEditComponent.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ import { DEFAULT_CATEGORY } from "../utils/categoryUtils";
1414
const utils = new Utils();
1515

1616
export interface SponsorTimeEditProps {
17-
index: number,
17+
index: number;
1818

19-
idSuffix: string,
19+
idSuffix: string;
2020
// Contains functions and variables from the content script needed by the skip notice
21-
contentContainer: ContentContainer,
21+
contentContainer: ContentContainer;
2222

2323
submissionNotice: SubmissionNoticeComponent;
2424
categoryList?: Category[];

src/components/SubmissionNoticeComponent.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ export interface SubmissionNoticeProps {
2020
}
2121

2222
export interface SubmissionNoticeState {
23-
noticeTitle: string,
24-
messages: string[],
23+
noticeTitle: string;
24+
messages: string[];
2525
idSuffix: string;
2626
}
2727

src/components/options/UnsubmittedVideosComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export interface UnsubmittedVideosProps {
77
}
88

99
export interface UnsubmittedVideosState {
10-
tableVisible: boolean,
10+
tableVisible: boolean;
1111
}
1212

1313
class UnsubmittedVideosComponent extends React.Component<UnsubmittedVideosProps, UnsubmittedVideosState> {

src/config.ts

Lines changed: 97 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -8,122 +8,122 @@ export interface Permission {
88
}
99

1010
interface SBConfig {
11-
userID: string,
12-
isVip: boolean,
13-
permissions: Record<Category, Permission>,
11+
userID: string;
12+
isVip: boolean;
13+
permissions: Record<Category, Permission>;
1414
/* Contains unsubmitted segments that the user has created. */
15-
unsubmittedSegments: Record<string, SponsorTime[]>,
16-
defaultCategory: Category,
17-
renderSegmentsAsChapters: boolean,
18-
whitelistedChannels: string[],
19-
forceChannelCheck: boolean,
20-
minutesSaved: number,
21-
skipCount: number,
22-
sponsorTimesContributed: number,
23-
submissionCountSinceCategories: number, // New count used to show the "Read The Guidelines!!" message
24-
showTimeWithSkips: boolean,
25-
disableSkipping: boolean,
26-
muteSegments: boolean,
27-
fullVideoSegments: boolean,
28-
manualSkipOnFullVideo: boolean,
29-
trackViewCount: boolean,
30-
trackViewCountInPrivate: boolean,
31-
trackDownvotes: boolean,
32-
dontShowNotice: boolean,
33-
noticeVisibilityMode: NoticeVisbilityMode,
34-
hideVideoPlayerControls: boolean,
35-
hideInfoButtonPlayerControls: boolean,
36-
hideDeleteButtonPlayerControls: boolean,
37-
hideUploadButtonPlayerControls: boolean,
38-
hideSkipButtonPlayerControls: boolean,
39-
hideDiscordLaunches: number,
40-
hideDiscordLink: boolean,
41-
invidiousInstances: string[],
42-
supportInvidious: boolean,
43-
serverAddress: string,
44-
minDuration: number,
45-
skipNoticeDuration: number,
46-
audioNotificationOnSkip: boolean,
47-
checkForUnlistedVideos: boolean,
48-
testingServer: boolean,
49-
refetchWhenNotFound: boolean,
50-
ytInfoPermissionGranted: boolean,
51-
allowExpirements: boolean,
52-
showDonationLink: boolean,
53-
showPopupDonationCount: number,
54-
showUpsells: boolean,
55-
donateClicked: number,
56-
autoHideInfoButton: boolean,
57-
autoSkipOnMusicVideos: boolean,
15+
unsubmittedSegments: Record<string, SponsorTime[]>;
16+
defaultCategory: Category;
17+
renderSegmentsAsChapters: boolean;
18+
whitelistedChannels: string[];
19+
forceChannelCheck: boolean;
20+
minutesSaved: number;
21+
skipCount: number;
22+
sponsorTimesContributed: number;
23+
submissionCountSinceCategories: number; // New count used to show the "Read The Guidelines!!" message
24+
showTimeWithSkips: boolean;
25+
disableSkipping: boolean;
26+
muteSegments: boolean;
27+
fullVideoSegments: boolean;
28+
manualSkipOnFullVideo: boolean;
29+
trackViewCount: boolean;
30+
trackViewCountInPrivate: boolean;
31+
trackDownvotes: boolean;
32+
dontShowNotice: boolean;
33+
noticeVisibilityMode: NoticeVisbilityMode;
34+
hideVideoPlayerControls: boolean;
35+
hideInfoButtonPlayerControls: boolean;
36+
hideDeleteButtonPlayerControls: boolean;
37+
hideUploadButtonPlayerControls: boolean;
38+
hideSkipButtonPlayerControls: boolean;
39+
hideDiscordLaunches: number;
40+
hideDiscordLink: boolean;
41+
invidiousInstances: string[];
42+
supportInvidious: boolean;
43+
serverAddress: string;
44+
minDuration: number;
45+
skipNoticeDuration: number;
46+
audioNotificationOnSkip: boolean;
47+
checkForUnlistedVideos: boolean;
48+
testingServer: boolean;
49+
refetchWhenNotFound: boolean;
50+
ytInfoPermissionGranted: boolean;
51+
allowExpirements: boolean;
52+
showDonationLink: boolean;
53+
showPopupDonationCount: number;
54+
showUpsells: boolean;
55+
donateClicked: number;
56+
autoHideInfoButton: boolean;
57+
autoSkipOnMusicVideos: boolean;
5858
colorPalette: {
59-
red: string,
60-
white: string,
61-
locked: string
62-
},
63-
scrollToEditTimeUpdate: boolean,
64-
categoryPillUpdate: boolean,
65-
showChapterInfoMessage: boolean,
66-
darkMode: boolean,
67-
showCategoryGuidelines: boolean,
68-
showCategoryWithoutPermission: boolean,
69-
showSegmentNameInChapterBar: boolean,
59+
red: string;
60+
white: string;
61+
locked: string;
62+
};
63+
scrollToEditTimeUpdate: boolean;
64+
categoryPillUpdate: boolean;
65+
showChapterInfoMessage: boolean;
66+
darkMode: boolean;
67+
showCategoryGuidelines: boolean;
68+
showCategoryWithoutPermission: boolean;
69+
showSegmentNameInChapterBar: boolean;
7070

7171
// Used to cache calculated text color info
7272
categoryPillColors: {
7373
[key in Category]: {
74-
lastColor: string,
75-
textColor: string
74+
lastColor: string;
75+
textColor: string;
7676
}
77-
}
77+
};
7878

79-
skipKeybind: Keybind,
80-
startSponsorKeybind: Keybind,
81-
submitKeybind: Keybind,
82-
nextChapterKeybind: Keybind,
83-
previousChapterKeybind: Keybind,
79+
skipKeybind: Keybind;
80+
startSponsorKeybind: Keybind;
81+
submitKeybind: Keybind;
82+
nextChapterKeybind: Keybind;
83+
previousChapterKeybind: Keybind;
8484

8585
// What categories should be skipped
86-
categorySelections: CategorySelection[],
86+
categorySelections: CategorySelection[];
8787

8888
payments: {
89-
licenseKey: string,
90-
lastCheck: number,
91-
lastFreeCheck: number,
92-
freeAccess: boolean,
93-
chaptersAllowed: boolean
94-
}
89+
licenseKey: string;
90+
lastCheck: number;
91+
lastFreeCheck: number;
92+
freeAccess: boolean;
93+
chaptersAllowed: boolean;
94+
};
9595

9696
// Preview bar
9797
barTypes: {
98-
"preview-chooseACategory": PreviewBarOption,
99-
"sponsor": PreviewBarOption,
100-
"preview-sponsor": PreviewBarOption,
101-
"selfpromo": PreviewBarOption,
102-
"preview-selfpromo": PreviewBarOption,
103-
"exclusive_access": PreviewBarOption,
104-
"interaction": PreviewBarOption,
105-
"preview-interaction": PreviewBarOption,
106-
"intro": PreviewBarOption,
107-
"preview-intro": PreviewBarOption,
108-
"outro": PreviewBarOption,
109-
"preview-outro": PreviewBarOption,
110-
"preview": PreviewBarOption,
111-
"preview-preview": PreviewBarOption,
112-
"music_offtopic": PreviewBarOption,
113-
"preview-music_offtopic": PreviewBarOption,
114-
"poi_highlight": PreviewBarOption,
115-
"preview-poi_highlight": PreviewBarOption,
116-
"filler": PreviewBarOption,
117-
"preview-filler": PreviewBarOption,
118-
}
98+
"preview-chooseACategory": PreviewBarOption;
99+
"sponsor": PreviewBarOption;
100+
"preview-sponsor": PreviewBarOption;
101+
"selfpromo": PreviewBarOption;
102+
"preview-selfpromo": PreviewBarOption;
103+
"exclusive_access": PreviewBarOption;
104+
"interaction": PreviewBarOption;
105+
"preview-interaction": PreviewBarOption;
106+
"intro": PreviewBarOption;
107+
"preview-intro": PreviewBarOption;
108+
"outro": PreviewBarOption;
109+
"preview-outro": PreviewBarOption;
110+
"preview": PreviewBarOption;
111+
"preview-preview": PreviewBarOption;
112+
"music_offtopic": PreviewBarOption;
113+
"preview-music_offtopic": PreviewBarOption;
114+
"poi_highlight": PreviewBarOption;
115+
"preview-poi_highlight": PreviewBarOption;
116+
"filler": PreviewBarOption;
117+
"preview-filler": PreviewBarOption;
118+
};
119119
}
120120

121-
export type VideoDownvotes = { segments: { uuid: HashedValue, hidden: SponsorHideType }[] , lastAccess: number };
121+
export type VideoDownvotes = { segments: { uuid: HashedValue; hidden: SponsorHideType }[] ; lastAccess: number };
122122

123123
interface SBStorage {
124124
/* VideoID prefixes to UUID prefixes */
125-
downvotedSegments: Record<VideoID & HashedValue, VideoDownvotes>,
126-
navigationApiAvailable: boolean,
125+
downvotedSegments: Record<VideoID & HashedValue, VideoDownvotes>;
126+
navigationApiAvailable: boolean;
127127
}
128128

129129
export interface SBObject {
@@ -340,7 +340,7 @@ const Config: SBObject = {
340340

341341
// Function setup
342342

343-
function configProxy(): { sync: SBConfig, local: SBStorage } {
343+
function configProxy(): { sync: SBConfig; local: SBStorage } {
344344
chrome.storage.onChanged.addListener((changes: {[key: string]: chrome.storage.StorageChange}, areaName) => {
345345
if (areaName === "sync") {
346346
for (const key in changes) {

src/content.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ let channelIDInfo: ChannelIDInfo;
6868
// Locked Categories in this tab, like: ["sponsor","intro","outro"]
6969
let lockedCategories: Category[] = [];
7070
// Used to calculate a more precise "virtual" video time
71-
let lastKnownVideoTime: { videoTime: number, preciseTime: number } = {
71+
let lastKnownVideoTime: { videoTime: number; preciseTime: number } = {
7272
videoTime: null,
7373
preciseTime: null
7474
};
@@ -125,7 +125,7 @@ let categoryPill: CategoryPill = null;
125125
let controls: HTMLElement | null = null;
126126

127127
/** Contains buttons created by `createButton()`. */
128-
const playerButtons: Record<string, {button: HTMLButtonElement, image: HTMLImageElement, setupListener: boolean}> = {};
128+
const playerButtons: Record<string, {button: HTMLButtonElement; image: HTMLImageElement; setupListener: boolean}> = {};
129129

130130
// Direct Links after the config is loaded
131131
utils.wait(() => Config.config !== null, 1000, 1).then(() => videoIDChange(getYouTubeVideoID(document)));
@@ -1403,7 +1403,7 @@ async function whitelistCheck() {
14031403
* Returns info about the next upcoming sponsor skip
14041404
*/
14051405
function getNextSkipIndex(currentTime: number, includeIntersectingSegments: boolean, includeNonIntersectingSegments: boolean):
1406-
{array: ScheduledTime[], index: number, endIndex: number, extraIndexes: number[], openNotice: boolean} {
1406+
{array: ScheduledTime[]; index: number; endIndex: number; extraIndexes: number[]; openNotice: boolean} {
14071407

14081408
const autoSkipSorter = (segment: ScheduledTime) => {
14091409
const skipOption = utils.getCategorySelection(segment.category)?.option;
@@ -1515,7 +1515,7 @@ function getLatestEndTimeIndex(sponsorTimes: SponsorTime[], index: number, hideH
15151515
* the current time, but end after
15161516
*/
15171517
function getStartTimes(sponsorTimes: SponsorTime[], includeIntersectingSegments: boolean, includeNonIntersectingSegments: boolean,
1518-
minimum?: number, hideHiddenSponsors = false): {includedTimes: ScheduledTime[], scheduledTimes: number[]} {
1518+
minimum?: number, hideHiddenSponsors = false): {includedTimes: ScheduledTime[]; scheduledTimes: number[]} {
15191519
if (!sponsorTimes) return {includedTimes: [], scheduledTimes: []};
15201520

15211521
const includedTimes: ScheduledTime[] = [];

0 commit comments

Comments
 (0)