Skip to content

Commit 8dac971

Browse files
Fix eslint warnings - Final (react-composites) (#1600)
1 parent 97c1d1a commit 8dac971

16 files changed

Lines changed: 49 additions & 34 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Fix react useEffect dependencies in composites",
4+
"packageName": "@internal/react-composites",
5+
"email": "2684369+JamesBurnside@users.noreply.github.com",
6+
"dependentChangeType": "patch"
7+
}

packages/communication-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"generate-doc": "api-documenter markdown -i temp -o docGen",
7171
"prettier": "prettier --no-error-on-unmatched-pattern --write --config ../../.prettierrc --ignore-path=../../.prettierignore \"**/*.js\" \"**/*.jsx\" \"**/*.ts\" \"**/*.tsx\"",
7272
"prettier:check": "prettier --no-error-on-unmatched-pattern --check --config ../../.prettierrc --ignore-path=../../.prettierignore \"**/*.js\" \"**/*.jsx\" \"**/*.ts\" \"**/*.tsx\"",
73-
"lint": "eslint \"*/**/*.{ts,tsx}\"",
73+
"lint": "eslint --max-warnings 0 \"*/**/*.{ts,tsx}\"",
7474
"lint:fix": "npm run lint -- --fix",
7575
"lint:quiet": "npm run lint -- --quiet",
7676
"postpack": "copyfiles -E \"./*.tgz\" release",

packages/react-composites/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"generate-doc": "api-documenter markdown -i temp -o docGen",
3636
"prettier": "prettier --no-error-on-unmatched-pattern --write --config ../../.prettierrc --ignore-path=../../.prettierignore \"**/*.js\" \"**/*.jsx\" \"**/*.ts\" \"**/*.tsx\"",
3737
"prettier:check": "prettier --no-error-on-unmatched-pattern --check --config ../../.prettierrc --ignore-path=../../.prettierignore \"**/*.js\" \"**/*.jsx\" \"**/*.ts\" \"**/*.tsx\"",
38-
"lint": "eslint \"*/**/*.{ts,tsx}\"",
38+
"lint": "eslint --max-warnings 0 \"*/**/*.{ts,tsx}\"",
3939
"lint:fix": "npm run lint -- --fix",
4040
"lint:quiet": "npm run lint -- --quiet",
4141
"_api-extractor:by-flavor": "if-env COMMUNICATION_REACT_FLAVOR=stable && api-extractor run -c api-extractor.stable.json --local || (if-env COMMUNICATION_REACT_FLAVOR=beta && api-extractor run --local)",

packages/react-composites/src/composites/CallComposite/components/CallControls.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export type CallControlsProps = {
3232
* @private
3333
*/
3434
export const CallControls = (props: CallControlsProps): JSX.Element => {
35-
const options = typeof props.options === 'boolean' ? {} : props.options;
35+
const options = useMemo(() => (typeof props.options === 'boolean' ? {} : props.options), [props.options]);
3636
const customButtons = useMemo(
3737
() => generateCustomButtons(onFetchCustomButtonPropsTrampoline(options), options?.displayType),
3838
[options]

packages/react-composites/src/composites/CallComposite/components/buttons/EndCall.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const EndCall = (props: {
2121
compactMode ? groupCallLeaveButtonCompressedStyle : groupCallLeaveButtonStyle,
2222
props.styles ?? {}
2323
),
24-
[props.styles]
24+
[compactMode, props.styles]
2525
);
2626
return (
2727
<EndCallButton

packages/react-composites/src/composites/CallComposite/pages/LobbyPage.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ const disableLobbyPageControls = (
8282
};
8383

8484
const overlayProps = (strings: CallCompositeStrings, inLobby: boolean): LobbyOverlayProps =>
85-
inLobby ? overlayPropsWaitingToBeAdmitted(strings, inLobby) : overlayPropsConnectingToCall(strings, inLobby);
85+
inLobby ? overlayPropsWaitingToBeAdmitted(strings) : overlayPropsConnectingToCall(strings);
8686

87-
const overlayPropsConnectingToCall = (strings: CallCompositeStrings, inLobby: boolean): LobbyOverlayProps => ({
87+
const overlayPropsConnectingToCall = (strings: CallCompositeStrings): LobbyOverlayProps => ({
8888
title: strings.lobbyScreenConnectingToCallTitle,
8989
moreDetails: strings.lobbyScreenConnectingToCallMoreDetails,
9090
overlayIcon: <CallCompositeIcon iconName="LobbyScreenConnectingToCall" />
9191
});
9292

93-
const overlayPropsWaitingToBeAdmitted = (strings: CallCompositeStrings, inLobby: boolean): LobbyOverlayProps => ({
93+
const overlayPropsWaitingToBeAdmitted = (strings: CallCompositeStrings): LobbyOverlayProps => ({
9494
title: strings.lobbyScreenWaitingToBeAdmittedTitle,
9595
moreDetails: strings.lobbyScreenWaitingToBeAdmittedMoreDetails,
9696
overlayIcon: <CallCompositeIcon iconName="LobbyScreenWaitingToBeAdmitted" />

packages/react-composites/src/composites/CallComposite/styles/LobbyTile.styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const videoTileStyles = {
3232
/**
3333
* @private
3434
*/
35-
export const moreDetailsStyle = (palette, isVideoReady): IStyle => ({
35+
export const moreDetailsStyle = (palette: IPalette, isVideoReady: boolean): IStyle => ({
3636
fontSize: '1rem',
3737
color: isVideoReady ? 'white' : palette.neutralPrimary,
3838
textAlign: 'center'

packages/react-composites/src/composites/CallComposite/styles/NetworkReconnectTile.styles.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT license.
33

4-
import { FontWeights, IStyle } from '@fluentui/react';
4+
import { FontWeights, IPalette, IStyle } from '@fluentui/react';
55

66
/**
77
* @private
@@ -22,7 +22,7 @@ export const titleContainerStyle: IStyle = {
2222
/**
2323
* @private
2424
*/
25-
export const titleStyle = (palette, isVideoReady): IStyle => ({
25+
export const titleStyle = (palette: IPalette, isVideoReady: boolean): IStyle => ({
2626
fontSize: '1.25rem',
2727
fontWeight: FontWeights.semibold,
2828
color: isVideoReady ? 'white' : palette.neutralPrimary,
@@ -32,7 +32,7 @@ export const titleStyle = (palette, isVideoReady): IStyle => ({
3232
/**
3333
* @private
3434
*/
35-
export const moreDetailsStyle = (palette, isVideoReady): IStyle => ({
35+
export const moreDetailsStyle = (palette: IPalette, isVideoReady: boolean): IStyle => ({
3636
fontSize: '1rem',
3737
color: isVideoReady ? 'white' : palette.neutralPrimary,
3838
textAlign: 'center'

packages/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,14 @@ const CallWithChatScreen = (props: CallWithChatScreenProps): JSX.Element => {
149149
const onMoreButtonClicked = useCallback(() => {
150150
closePane();
151151
setShowDrawer(true);
152-
}, []);
152+
}, [closePane]);
153153
const closeDrawer = useCallback(() => {
154154
setShowDrawer(false);
155155
}, []);
156156
const onMoreDrawerPeopleClicked = useCallback(() => {
157157
setShowDrawer(false);
158158
togglePeople();
159-
}, []);
159+
}, [togglePeople]);
160160
const selectPeople = useCallback(() => {
161161
setShowPeople(true);
162162
setShowChat(false);

packages/react-composites/src/composites/CallWithChatComposite/ChatButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const ChatButton = (props: ControlBarButtonProps): JSX.Element => {
2121
},
2222
props.styles ?? {}
2323
),
24-
[theme]
24+
[props.styles, theme.palette.neutralLight]
2525
);
2626
return (
2727
<ControlBarButton

0 commit comments

Comments
 (0)