chore: lint

pull/3281/head
Audric Ackermann 5 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,
'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
'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 { isEmpty } from 'lodash';
import { MouseEvent, useCallback, useLayoutEffect, useState } from 'react';
import { useCallback, useLayoutEffect, useState } from 'react';
import { InView } from 'react-intersection-observer';
import { useSelector } from 'react-redux';
import styled from 'styled-components';
@ -37,22 +37,6 @@ type Props = {
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 }>`
display: flex;
align-self: ${props => (props.msgDirection === 'incoming' ? 'flex-start' : 'flex-end')};
@ -155,7 +139,6 @@ export const MessageContent = (props: Props) => {
<StyledMessageContent
className={classNames('module-message__container', `module-message__container--${direction}`)}
role="button"
onClick={onClickOnMessageInnerContainer}
title={toolTipTitle}
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
// before we return from the await below.
// 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),
factor: 1,
minTimeout: retryMinTimeout || MessageSender.getMinRetryTimeout(),
}
);
}
@ -641,7 +639,6 @@ async function handleBatchResultWithSubRequests({
isString(storedHash) &&
isNumber(storedAt)
) {
seenHashes.push({
expiresAt: NetworkTime.now() + TTL_DEFAULT.CONTENT_MESSAGE, // non config msg expire at CONTENT_MESSAGE at most
hash: storedHash,

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

Loading…
Cancel
Save