Skip to content

Commit c0f7802

Browse files
committed
fix regex and warnings
1 parent 2d579fc commit c0f7802

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export const PHOTO_URL = "/_layouts/15/userphoto.aspx?size=M&accountname=";
22
export const TILE_HEIGHT: number = 70;
3-
export const URL_REGEX = /(https?:\/\/[^\s]+)/g;
3+
export const URL_REGEX = /(https?:\/\/(?:[-\w.])+(?::[0-9]+)?(?:\/[^\s]*)?)/g;

src/controls/listItemComments/components/Comments/CommentText.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ export const CommentText: React.FunctionComponent<ICommentTextProps> = (
7373
<>
7474
<Stack wrap horizontal horizontalAlign="start" verticalAlign="center">
7575
{isArray(commentText) ? (
76+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
7677
(commentText as any[]).map((el, i) => {
77-
// eslint-disable-line @typescript-eslint/no-explicit-any
7878
if (isObject(el)) {
7979
return (
8080
<span key={i} style={{ paddingRight: 5 }}>
Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,27 @@
11
import * as React from 'react';
22
import {
3-
DialogType,
4-
FontWeights,
5-
getTheme,
6-
IButtonStyles,
73
IconButton,
84
IIconProps,
9-
IStackProps,
10-
mergeStyleSets,
115
Modal,
126
Persona,
137
PersonaSize,
148
Stack,
159
} from '@fluentui/react';
16-
import { AppContext } from '../../common';
1710
import { useListItemCommentsStyles } from './useListItemCommentsStyles';
1811

1912
interface ILikedUserListProps {
2013
isDialogOpen: boolean;
2114
setShowDialog: React.Dispatch<React.SetStateAction<boolean>>;
22-
likedBy: any;
15+
likedBy: any; // eslint-disable-line @typescript-eslint/no-explicit-any
2316
}
2417

18+
const cancelIcon: IIconProps = { iconName: 'Cancel' };
19+
2520
export const LikedUserList = ({
2621
isDialogOpen,
2722
setShowDialog,
2823
likedBy,
29-
}: ILikedUserListProps) => {
24+
}: ILikedUserListProps): JSX.Element => {
3025
const { iconButtonStyles, contentStyles } = useListItemCommentsStyles();
3126

3227
const PHOTO_URL = '/_layouts/15/userphoto.aspx?size=M&accountname=';
@@ -55,19 +50,23 @@ export const LikedUserList = ({
5550
padding: '0 1.5rem 1.5rem 1.5rem',
5651
}}
5752
>
58-
{likedBy.map((user: any, index: number) => (
59-
<>
60-
<Persona
61-
key={index}
62-
text={user.name}
63-
secondaryText={user.email}
64-
size={PersonaSize.size40}
65-
imageUrl={`${PHOTO_URL}${user.email}`}
66-
/>
67-
</>
68-
))}
53+
{likedBy.map(
54+
(
55+
user: any, // eslint-disable-line @typescript-eslint/no-explicit-any
56+
index: number
57+
) => (
58+
<>
59+
<Persona
60+
key={index}
61+
text={user.name}
62+
secondaryText={user.email}
63+
size={PersonaSize.size40}
64+
imageUrl={`${PHOTO_URL}${user.email}`}
65+
/>
66+
</>
67+
)
68+
)}
6969
</Stack>
7070
</Modal>
7171
);
7272
};
73-
const cancelIcon: IIconProps = { iconName: 'Cancel' };

src/controls/listItemComments/components/Comments/RenderComments.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export const RenderComments: React.FunctionComponent<
4040

4141
const [hideDialog, { toggle: setHideDialog }] = useBoolean(true);
4242
const [showDialog, setShowDialog] = useState(false);
43+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4344
const [selectedLikedBy, setSelectedLikedBy] = useState<any>([]);
4445

4546
const _likeComment = useCallback(() => {

0 commit comments

Comments
 (0)