0
0
Fork 0

Upgrade ESlint to v8 (#23305)

This commit is contained in:
Nick Schonning 2023-01-29 19:45:35 -05:00 committed by GitHub
parent b58bf74e35
commit c49213f0ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
120 changed files with 832 additions and 810 deletions

View file

@ -148,7 +148,7 @@ class SwitchingColumnsArea extends React.PureComponent {
if (c) {
this.node = c;
}
}
};
render () {
const { children, mobile } = this.props;
@ -270,16 +270,16 @@ class UI extends React.PureComponent {
// but we set user-friendly message for other browsers, e.g. Edge.
e.returnValue = intl.formatMessage(messages.beforeUnload);
}
}
};
handleWindowFocus = () => {
this.props.dispatch(focusApp());
this.props.dispatch(submitMarkers({ immediate: true }));
}
};
handleWindowBlur = () => {
this.props.dispatch(unfocusApp());
}
};
handleDragEnter = (e) => {
e.preventDefault();
@ -295,7 +295,7 @@ class UI extends React.PureComponent {
if (e.dataTransfer && Array.from(e.dataTransfer.types).includes('Files') && this.props.canUploadMore && this.context.identity.signedIn) {
this.setState({ draggingOver: true });
}
}
};
handleDragOver = (e) => {
if (this.dataTransferIsText(e.dataTransfer)) return false;
@ -310,7 +310,7 @@ class UI extends React.PureComponent {
}
return false;
}
};
handleDrop = (e) => {
if (this.dataTransferIsText(e.dataTransfer)) return;
@ -323,7 +323,7 @@ class UI extends React.PureComponent {
if (e.dataTransfer && e.dataTransfer.files.length >= 1 && this.props.canUploadMore && this.context.identity.signedIn) {
this.props.dispatch(uploadCompose(e.dataTransfer.files));
}
}
};
handleDragLeave = (e) => {
e.preventDefault();
@ -336,15 +336,15 @@ class UI extends React.PureComponent {
}
this.setState({ draggingOver: false });
}
};
dataTransferIsText = (dataTransfer) => {
return (dataTransfer && Array.from(dataTransfer.types).filter((type) => type === 'text/plain').length === 1);
}
};
closeUploadModal = () => {
this.setState({ draggingOver: false });
}
};
handleServiceWorkerPostMessage = ({ data }) => {
if (data.type === 'navigate') {
@ -352,7 +352,7 @@ class UI extends React.PureComponent {
} else {
console.warn('Unknown message type:', data.type);
}
}
};
handleLayoutChange = debounce(() => {
this.props.dispatch(clearHeight()); // The cached heights are no longer accurate, invalidate
@ -369,7 +369,7 @@ class UI extends React.PureComponent {
} else {
this.handleLayoutChange();
}
}
};
componentDidMount () {
const { signedIn } = this.context.identity;
@ -423,7 +423,7 @@ class UI extends React.PureComponent {
setRef = c => {
this.node = c;
}
};
handleHotkeyNew = e => {
e.preventDefault();
@ -433,7 +433,7 @@ class UI extends React.PureComponent {
if (element) {
element.focus();
}
}
};
handleHotkeySearch = e => {
e.preventDefault();
@ -443,17 +443,17 @@ class UI extends React.PureComponent {
if (element) {
element.focus();
}
}
};
handleHotkeyForceNew = e => {
this.handleHotkeyNew(e);
this.props.dispatch(resetCompose());
}
};
handleHotkeyToggleComposeSpoilers = e => {
e.preventDefault();
this.props.dispatch(changeComposeSpoilerness());
}
};
handleHotkeyFocusColumn = e => {
const index = (e.key * 1) + 1; // First child is drawer, skip that
@ -471,7 +471,7 @@ class UI extends React.PureComponent {
status.focus();
}
}
}
};
handleHotkeyBack = () => {
if (window.history && window.history.length === 1) {
@ -479,11 +479,11 @@ class UI extends React.PureComponent {
} else {
this.context.router.history.goBack();
}
}
};
setHotkeysRef = c => {
this.hotkeys = c;
}
};
handleHotkeyToggleHelp = () => {
if (this.props.location.pathname === '/keyboard-shortcuts') {
@ -491,55 +491,55 @@ class UI extends React.PureComponent {
} else {
this.context.router.history.push('/keyboard-shortcuts');
}
}
};
handleHotkeyGoToHome = () => {
this.context.router.history.push('/home');
}
};
handleHotkeyGoToNotifications = () => {
this.context.router.history.push('/notifications');
}
};
handleHotkeyGoToLocal = () => {
this.context.router.history.push('/public/local');
}
};
handleHotkeyGoToFederated = () => {
this.context.router.history.push('/public');
}
};
handleHotkeyGoToDirect = () => {
this.context.router.history.push('/conversations');
}
};
handleHotkeyGoToStart = () => {
this.context.router.history.push('/getting-started');
}
};
handleHotkeyGoToFavourites = () => {
this.context.router.history.push('/favourites');
}
};
handleHotkeyGoToPinned = () => {
this.context.router.history.push('/pinned');
}
};
handleHotkeyGoToProfile = () => {
this.context.router.history.push(`/@${this.props.username}`);
}
};
handleHotkeyGoToBlocked = () => {
this.context.router.history.push('/blocks');
}
};
handleHotkeyGoToMuted = () => {
this.context.router.history.push('/mutes');
}
};
handleHotkeyGoToRequests = () => {
this.context.router.history.push('/follow_requests');
}
};
render () {
const { draggingOver } = this.state;