MM-51846 : Upgrade Esint from 7 to 8+ (#22753)

Этот коммит содержится в:
M-ZubairAhmed
2023-04-07 03:50:01 +05:30
коммит произвёл GitHub
родитель 84b0e3dff1
Коммит 9bffaeae42
362 изменённых файлов: 3756 добавлений и 3990 удалений

Просмотреть файл

@@ -177,7 +177,7 @@ export default class ThreadViewer extends React.PureComponent<Props, State> {
}
this.setState({isLoading: false});
}
};
private handleCardClick = (post: Post) => {
if (!post) {
@@ -185,7 +185,7 @@ export default class ThreadViewer extends React.PureComponent<Props, State> {
}
this.props.actions.selectPostCard(post);
}
};
public render(): JSX.Element {
if (this.props.postIds == null || this.props.selected == null || !this.props.channel) {

Просмотреть файл

@@ -163,7 +163,7 @@ class ThreadViewerVirtualized extends PureComponent<Props, State> {
isMobile,
});
}
}
};
initScrollToIndex = (): {index: number; position: string; offset?: number} => {
const {highlightedPostId, replyListIds} = this.props;
@@ -189,7 +189,7 @@ class ThreadViewerVirtualized extends PureComponent<Props, State> {
index: 0,
position: 'end',
};
}
};
handleScroll = ({scrollHeight, scrollUpdateWasRequested, scrollOffset, clientHeight}: OnScrollArgs) => {
if (scrollHeight <= 0) {
@@ -223,7 +223,7 @@ class ThreadViewerVirtualized extends PureComponent<Props, State> {
}
this.setState(updatedState as State);
}
};
updateFloatingTimestamp = (visibleTopItem: number) => {
if (!this.props.replyListIds) {
@@ -233,7 +233,7 @@ class ThreadViewerVirtualized extends PureComponent<Props, State> {
this.setState({
topRhsPostId: getLatestPostId(this.props.replyListIds.slice(visibleTopItem)),
});
}
};
onItemsRendered = ({
visibleStartIndex,
@@ -250,7 +250,7 @@ class ThreadViewerVirtualized extends PureComponent<Props, State> {
overscanStartIndex,
overscanStopIndex,
});
}
};
getInitialPostIndex = (): number => {
let postIndex = 0;
@@ -262,7 +262,7 @@ class ThreadViewerVirtualized extends PureComponent<Props, State> {
}
return postIndex === -1 ? 0 : postIndex;
}
};
handleScrollToFailed = (index: number) => {
if (index < 0 || index >= this.props.replyListIds.length) {
@@ -277,7 +277,7 @@ class ThreadViewerVirtualized extends PureComponent<Props, State> {
if (overscanStopIndex != null && index > overscanStopIndex) {
this.scrollToItemCorrection(index, Math.min(overscanStopIndex - 1, this.props.replyListIds.length - 1));
}
}
};
scrollToItemCorrection = (index: number, nearIndex: number) => {
// stop after 10 times so we won't end up in an infinite loop
@@ -294,21 +294,21 @@ class ThreadViewerVirtualized extends PureComponent<Props, State> {
window.requestAnimationFrame(() => {
this.scrollToItem(index, 'start');
});
}
};
scrollToItem = (index: number, position: string, offset?: number) => {
if (this.listRef.current) {
this.listRef.current.scrollToItem(index, position, offset);
}
}
};
scrollToBottom = () => {
this.scrollToItem(0, 'end');
}
};
handleToastDismiss = () => {
this.setState({lastViewedBottom: Date.now()});
}
};
handleToastClick = () => {
const index = getNewMessageIndex(this.props.replyListIds);
@@ -317,7 +317,7 @@ class ThreadViewerVirtualized extends PureComponent<Props, State> {
} else {
this.scrollToBottom();
}
}
};
scrollToHighlightedPost = () => {
const {highlightedPostId, replyListIds} = this.props;
@@ -327,13 +327,13 @@ class ThreadViewerVirtualized extends PureComponent<Props, State> {
this.scrollToItem(replyListIds.indexOf(highlightedPostId), 'center');
});
}
}
};
handleScrollStop = () => {
if (this.mounted) {
this.setState({isScrolling: false});
}
}
};
handleCreateCommentHeightChange = (height: number, maxHeight: number) => {
let createCommentHeight = height > maxHeight ? maxHeight : height;
@@ -345,7 +345,7 @@ class ThreadViewerVirtualized extends PureComponent<Props, State> {
this.scrollToBottom();
}
}
}
};
renderRow = ({data, itemId, style}: {data: any; itemId: any; style: any}) => {
const index = data.indexOf(itemId);
@@ -414,7 +414,7 @@ class ThreadViewerVirtualized extends PureComponent<Props, State> {
}
return undefined;
}
};
isNewMessagesVisible = (): boolean => {
const {visibleStopIndex} = this.state;
@@ -423,7 +423,7 @@ class ThreadViewerVirtualized extends PureComponent<Props, State> {
return visibleStopIndex < newMessagesSeparatorIndex;
}
return false;
}
};
renderToast = (width: number) => {
const {visibleStopIndex, lastViewedBottom, userScrolledToBottom} = this.state;
@@ -442,7 +442,7 @@ class ThreadViewerVirtualized extends PureComponent<Props, State> {
onClick={this.handleToastClick}
/>
);
}
};
render() {
const {isMobile, topRhsPostId} = this.state;