chore: lint

pull/3281/head
Audric Ackermann 6 months ago
parent 6b1a628d13
commit 3b4d68e0a1
No known key found for this signature in database

@ -58,9 +58,6 @@ module.exports = {
// it helps readability to put public API at top, // it helps readability to put public API at top,
'no-use-before-define': 'off', 'no-use-before-define': 'off',
// we need them with code in WIP sometimes, and it doesn't do any harm
'no-useless-return': 'off',
// useful for unused or internal fields // useful for unused or internal fields
'no-underscore-dangle': 'off', 'no-underscore-dangle': 'off',

@ -1,35 +0,0 @@
diff --git a/node_modules/@types/backbone/README.md b/node_modules/@types/backbone/README.md
deleted file mode 100644
index b353b41..0000000
--- a/node_modules/@types/backbone/README.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# Installation
-> `npm install --save @types/backbone`
-
-# Summary
-This package contains type definitions for Backbone (http://backbonejs.org/).
-
-# Details
-Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/backbone.
-
-### Additional Details
- * Last updated: Thu, 30 Apr 2020 23:00:14 GMT
- * Dependencies: [@types/underscore](https://npmjs.com/package/@types/underscore), [@types/jquery](https://npmjs.com/package/@types/jquery)
- * Global values: `Backbone`
-
-# Credits
-These definitions were written by [Boris Yankov](https://github.com/borisyankov), [Natan Vivo](https://github.com/nvivo), [kenjiru](https://github.com/kenjiru), [jjoekoullas](https://github.com/jjoekoullas), [Julian Gonggrijp](https://github.com/jgonggrijp), [Kyle Scully](https://github.com/zieka), and [Robert Kesterson](https://github.com/rkesters).
diff --git a/node_modules/@types/backbone/index.d.ts b/node_modules/@types/backbone/index.d.ts
index da53a62..4db8b56 100644
--- a/node_modules/@types/backbone/index.d.ts
+++ b/node_modules/@types/backbone/index.d.ts
@@ -225,7 +225,7 @@ declare namespace Backbone {
* That works only if you set it in the constructor or the initialize method.
**/
defaults(): ObjectHash;
- id: any;
+ id: string;
idAttribute: string;
validationError: any;

@ -1,6 +1,6 @@
import classNames from 'classnames'; import classNames from 'classnames';
import { isEmpty } from 'lodash'; import { isEmpty } from 'lodash';
import { MouseEvent, useCallback, useLayoutEffect, useState } from 'react'; import { useCallback, useLayoutEffect, useState } from 'react';
import { InView } from 'react-intersection-observer'; import { InView } from 'react-intersection-observer';
import { useSelector } from 'react-redux'; import { useSelector } from 'react-redux';
import styled from 'styled-components'; import styled from 'styled-components';
@ -37,22 +37,6 @@ type Props = {
messageId: string; messageId: string;
}; };
// TODO not too sure what is this doing? It is not preventDefault()
// or stopPropagation() so I think this is never cancelling a click event?
function onClickOnMessageInnerContainer(event: MouseEvent<HTMLDivElement>) {
const selection = window.getSelection();
// Text is being selected
if (selection && selection.type === 'Range') {
return;
}
// User clicked on message body
const target = event.target as HTMLDivElement;
if (target.className === 'text-selectable' || window.contextMenuShown) {
return;
}
}
const StyledMessageContent = styled.div<{ msgDirection: MessageModelType }>` const StyledMessageContent = styled.div<{ msgDirection: MessageModelType }>`
display: flex; display: flex;
align-self: ${props => (props.msgDirection === 'incoming' ? 'flex-start' : 'flex-end')}; align-self: ${props => (props.msgDirection === 'incoming' ? 'flex-start' : 'flex-end')};
@ -155,7 +139,6 @@ export const MessageContent = (props: Props) => {
<StyledMessageContent <StyledMessageContent
className={classNames('module-message__container', `module-message__container--${direction}`)} className={classNames('module-message__container', `module-message__container--${direction}`)}
role="button" role="button"
onClick={onClickOnMessageInnerContainer}
title={toolTipTitle} title={toolTipTitle}
msgDirection={direction} msgDirection={direction}
> >

@ -257,7 +257,6 @@ async function sendSingleMessage({
}, },
]); ]);
// make sure to update the local sent_at timestamp, because sometimes, we will get the just pushed message in the receiver side // make sure to update the local sent_at timestamp, because sometimes, we will get the just pushed message in the receiver side
// before we return from the await below. // before we return from the await below.
// and the isDuplicate messages relies on sent_at timestamp to be valid. // and the isDuplicate messages relies on sent_at timestamp to be valid.
@ -305,7 +304,6 @@ async function sendSingleMessage({
retries: Math.max(attempts - 1, 0), retries: Math.max(attempts - 1, 0),
factor: 1, factor: 1,
minTimeout: retryMinTimeout || MessageSender.getMinRetryTimeout(), minTimeout: retryMinTimeout || MessageSender.getMinRetryTimeout(),
} }
); );
} }
@ -641,7 +639,6 @@ async function handleBatchResultWithSubRequests({
isString(storedHash) && isString(storedHash) &&
isNumber(storedAt) isNumber(storedAt)
) { ) {
seenHashes.push({ seenHashes.push({
expiresAt: NetworkTime.now() + TTL_DEFAULT.CONTENT_MESSAGE, // non config msg expire at CONTENT_MESSAGE at most expiresAt: NetworkTime.now() + TTL_DEFAULT.CONTENT_MESSAGE, // non config msg expire at CONTENT_MESSAGE at most
hash: storedHash, hash: storedHash,

@ -16,10 +16,7 @@ export const createTaskWithTimeout = (task: any, id: string, givenTimeout?: numb
window?.log?.error(message); window?.log?.error(message);
reject(new Error(message)); reject(new Error(message));
return;
} }
return;
}, timeout); }, timeout);
const clearTimer = () => { const clearTimer = () => {
try { try {
@ -41,13 +38,11 @@ export const createTaskWithTimeout = (task: any, id: string, givenTimeout?: numb
clearTimer(); clearTimer();
complete = true; complete = true;
resolve(result); resolve(result);
return;
}; };
const failure = (error: any) => { const failure = (error: any) => {
clearTimer(); clearTimer();
complete = true; complete = true;
reject(error); reject(error);
return;
}; };
let promise; let promise;

Loading…
Cancel
Save