Skip to content

Commit d19d216

Browse files
authored
chore: enable semi eslint rule (#522)
### Description Of Changes Enabled [semi](https://eslint.org/docs/latest/rules/semi#rule-details) eslint rule off-ed previously.
1 parent c353f2b commit d19d216

File tree

146 files changed

+279
-276
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+279
-276
lines changed

.eslintrc.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@
7676
"arrow-body-style": "off",
7777
"function-paren-newline": "off",
7878
"prefer-template": "off",
79-
"semi": "off",
8079
"padded-blocks": "off",
8180
"arrow-parens": "off",
8281
"dot-notation": "off",
@@ -88,7 +87,11 @@
8887
"yoda": "off",
8988
"brace-style": "off",
9089
"nonblock-statement-body-position": "off",
91-
"func-names": "off"
90+
"func-names": "off",
91+
// In some cases, eslint requires semicolon and wants it removed at the same time
92+
// https://stackoverflow.com/questions/58474874/eslint-demands-semicolon-and-wants-it-removed-at-the-same-time
93+
"semi": "off",
94+
"@typescript-eslint/semi": ["error"]
9295
},
9396
"extends": [
9497
"plugin:react/recommended",

src/hooks/VoicePlayer/dux/initialState.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export type AudioStorageUnit = {
1414
audioFile: null | File;
1515
playbackTime: number;
1616
duration: number;
17-
}
17+
};
1818
export const AudioUnitDefaultValue = (): AudioStorageUnit => ({
1919
audioFile: null,
2020
playbackTime: 0,

src/hooks/VoicePlayer/dux/reducer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type PayloadType = (
2727
type ActionType = {
2828
type: string;
2929
payload: PayloadType;
30-
}
30+
};
3131

3232
export default function voicePlayerReducer(
3333
state: VoicePlayerInitialState,

src/hooks/VoicePlayer/useVoicePlayer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const useVoicePlayer = ({
6363
const voiceAudioPlayerElement = document.getElementById(VOICE_PLAYER_AUDIO_ID);
6464
(voiceAudioPlayerElement as HTMLAudioElement)?.pause?.();
6565
}
66-
}
66+
};
6767
}, []);
6868

6969
return ({

src/hooks/VoiceRecorder/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const VoiceRecorderProvider = (props: VoiceRecorderProps): React.ReactEle
4242
if (isVoiceMessageEnabled && !webAudioUtils) {
4343
import('./WebAudioUtils').then((data) => {
4444
setWebAudioUtils(data);
45-
})
45+
});
4646
}
4747
}, []);
4848

@@ -110,7 +110,7 @@ export const VoiceRecorderProvider = (props: VoiceRecorderProps): React.ReactEle
110110
}}>
111111
{children}
112112
</VoiceRecorderContext.Provider>
113-
)
113+
);
114114
};
115115

116116
export const useVoiceRecorderContext = (): VoiceRecorderContext => useContext(VoiceRecorderContext);

src/hooks/useHandleOnScrollCallback/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export interface UseHandleOnScrollCallbackProps {
99
}
1010

1111
export function calcScrollBottom(scrollHeight: number, scrollTop: number): number {
12-
return scrollHeight - scrollTop
12+
return scrollHeight - scrollTop;
1313
}
1414

1515
export function useHandleOnScrollCallback({
@@ -36,7 +36,7 @@ export function useHandleOnScrollCallback({
3636
// even if there is more to fetch or not,
3737
// we still have to show the scroll to bottom button
3838
if (typeof setShowScrollDownButton === 'function') {
39-
setShowScrollDownButton(scrollHeight > scrollTop + clientHeight + 1)
39+
setShowScrollDownButton(scrollHeight > scrollTop + clientHeight + 1);
4040
}
4141
if (!hasMore) {
4242
return;

src/hooks/useLongPress.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const DEFAULT_DURATION = 300;
3030

3131
function preventDefault(e: Event) {
3232
if (!isTouchEvent(e)) {
33-
return
33+
return;
3434
}
3535

3636
if (e.touches.length < 2 && e.preventDefault) {

src/index.d.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ export type SendBirdState = {
185185
dispatchers: {
186186
userDispatcher: UserDispatcher,
187187
},
188-
}
188+
};
189189

190190
type UserDispatcherParams = {
191191
type: string,
@@ -515,20 +515,20 @@ type ChannelSettingsContextProps = {
515515
queries?: ChannelSettingsQueries;
516516
renderUserProfile?: (props: RenderUserProfileProps) => React.ReactElement;
517517
disableUserProfile?: boolean;
518-
}
518+
};
519519

520520
interface ChannelSettingsProps extends ChannelSettingsUIProps, ChannelSettingsContextProps {
521521
}
522522

523523
type ChannelSettingsEditDetailsProps = {
524524
onSubmit: () => void;
525525
onCancel: () => void;
526-
}
526+
};
527527

528528
type CustomUser = User & {
529529
isMuted: boolean;
530530
role: string;
531-
}
531+
};
532532

533533
interface UserListItemActionProps {
534534
actionRef: React.RefObject<HTMLInputElement>;
@@ -553,10 +553,10 @@ declare module '@sendbird/uikit-react' {
553553
export type sendbirdSelectors = sendbirdSelectorsInterface;
554554
export type ChannelList = React.FunctionComponent<ChannelListProps>;
555555
export type ChannelSettings = React.FunctionComponent<ChannelSettingsProps>;
556-
export type Channel = React.FunctionComponent<ChannelProps>
557-
export type OpenChannel = React.FunctionComponent<OpenChannelProps>
558-
export type OpenChannelSettings = React.FunctionComponent<OpenChannelSettingsProps>
559-
export type MessageSearch = React.FunctionComponent<MessageSearchProps>
556+
export type Channel = React.FunctionComponent<ChannelProps>;
557+
export type OpenChannel = React.FunctionComponent<OpenChannelProps>;
558+
export type OpenChannelSettings = React.FunctionComponent<OpenChannelSettingsProps>;
559+
export type MessageSearch = React.FunctionComponent<MessageSearchProps>;
560560
export function withSendBird(
561561
ChildComp: React.Component | React.ElementType | React.ReactElement,
562562
mapStoreToProps?: (store: SendBirdState) => unknown
@@ -814,7 +814,7 @@ interface ChannelProviderInterface extends ChannelContextProps, MessageStoreInte
814814
type FileViewerProps = {
815815
onCancel: () => void;
816816
message: ClientFileMessage;
817-
}
817+
};
818818

819819
type MessageUIProps = {
820820
message: EveryMessage;
@@ -1020,7 +1020,7 @@ interface OpenChannelProps extends OpenChannelProviderProps, OpenChannelUIProps
10201020
type OpenchannelMessageListProps = {
10211021
renderMessage?: (props: RenderMessageProps) => React.ReactElement;
10221022
renderPlaceHolderEmptyList?: () => React.ReactElement;
1023-
}
1023+
};
10241024

10251025
type OpenChannelMessageProps = {
10261026
renderMessage?: (props: RenderMessageProps) => React.ReactElement;
@@ -1086,7 +1086,7 @@ interface UserFilledOpenChannelListQuery {
10861086
type OpenChannelListFetchingStatus = 'EMPTY' | 'FETCHING' | 'DONE' | 'ERROR';
10871087
type CustomUseReducerDispatcher = (props: { type: string, payload: any }) => void;
10881088
type OnOpenChannelSelected = (channel: OpenChannel, e?: React.MouseEvent<HTMLDivElement | unknown>) => void;
1089-
type FetchNextCallbackType = (callback: (channels?: Array<OpenChannel>, err?: SendbirdError) => void) => void
1089+
type FetchNextCallbackType = (callback: (channels?: Array<OpenChannel>, err?: SendbirdError) => void) => void;
10901090

10911091
interface OpenChannelListProviderProps {
10921092
className?: string;

src/lib/MediaQueryContext.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ const MediaQueryProvider = (props: MediaQueryProviderProps): React.ReactElement
6464
logger?.info?.('MediaQueryProvider: isMobile: false');
6565
}
6666
}
67-
}
67+
};
6868
updateSize();
6969
window.addEventListener('resize', updateSize);
7070
logger?.info?.('MediaQueryProvider: addEventListener', updateSize);
7171
return () => {
7272
window.removeEventListener('resize', updateSize);
7373
logger?.info?.('MediaQueryProvider: removeEventListener', updateSize);
74-
}
74+
};
7575
}, [mediaQueryBreakPoint]);
7676
return (
7777
<MediaQueryContext.Provider value={{ mediaQueryBreakPoint, isMobile }}>

src/lib/Sendbird.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { ConfigureSessionTypes } from './hooks/useConnect/types';
3030
export type UserListQueryType = {
3131
hasNext?: boolean;
3232
next: () => Promise<Array<User>>;
33-
}
33+
};
3434

3535
interface VoiceRecordOptions {
3636
maxRecordingTime?: number;
@@ -260,6 +260,6 @@ const Sendbird = ({
260260
</MediaQueryProvider>
261261
</SendbirdSdkContext.Provider>
262262
);
263-
}
263+
};
264264

265265
export default Sendbird;

0 commit comments

Comments
 (0)