Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

Fix eslint & flow errors

Lyubo Marinov8fd91573fc2c
diff --git a/modules/UI/etherpad/Etherpad.js b/modules/UI/etherpad/Etherpad.js
index b04edae6c9..ddc95b064d 100644
--- a/modules/UI/etherpad/Etherpad.js
+++ b/modules/UI/etherpad/Etherpad.js
@@ -202,7 +202,7 @@ export default class EtherpadManager {
}
/**
- *
+ *
*/
isVisible() {
return VideoLayout.isLargeContainerTypeVisible(ETHERPAD_CONTAINER_TYPE);
diff --git a/modules/UI/videolayout/VideoContainer.js b/modules/UI/videolayout/VideoContainer.js
index e13a33d96b..d902727ac4 100644
--- a/modules/UI/videolayout/VideoContainer.js
+++ b/modules/UI/videolayout/VideoContainer.js
@@ -588,7 +588,7 @@ export class VideoContainer extends LargeContainer {
}
/**
- *
+ *
*/
hide() {
// as the container is hidden/replaced by another container
diff --git a/modules/devices/mediaDeviceHelper.js b/modules/devices/mediaDeviceHelper.js
index 9de55db83e..787ddfd67e 100644
--- a/modules/devices/mediaDeviceHelper.js
+++ b/modules/devices/mediaDeviceHelper.js
@@ -237,7 +237,7 @@ export default {
}
/**
- *
+ *
*/
function createVideoTrack(showError) {
return (
diff --git a/modules/translation/translation.js b/modules/translation/translation.js
index 459d592fcb..460b0f263e 100644
--- a/modules/translation/translation.js
+++ b/modules/translation/translation.js
@@ -68,7 +68,7 @@ class Translation {
}
/**
- *
+ *
*/
translateElement(selector: Object, options: Object) {
// XXX i18next expects undefined if options are missing.
diff --git a/react/features/app/components/AbstractApp.js b/react/features/app/components/AbstractApp.js
index d0ad7d73d0..138b000cc3 100644
--- a/react/features/app/components/AbstractApp.js
+++ b/react/features/app/components/AbstractApp.js
@@ -1,3 +1,5 @@
+/* global APP */
+
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { I18nextProvider } from 'react-i18next';
@@ -17,8 +19,6 @@ import { BlankPage } from '../../welcome';
import { appNavigate, appWillMount, appWillUnmount } from '../actions';
-declare var APP: Object;
-
/**
* The default URL to open if no other was specified to {@code AbstractApp}
* via props.
diff --git a/react/features/base/dialog/components/Dialog.native.js b/react/features/base/dialog/components/Dialog.native.js
index 3fc2a55aa7..0e00e31643 100644
--- a/react/features/base/dialog/components/Dialog.native.js
+++ b/react/features/base/dialog/components/Dialog.native.js
@@ -1,3 +1,5 @@
+// @flow
+
import PropTypes from 'prop-types';
import React from 'react';
import { Modal, StyleSheet, TextInput } from 'react-native';
@@ -105,6 +107,8 @@ class Dialog extends AbstractDialog {
<Prompt
cancelButtonTextStyle = { cancelButtonTextStyle }
cancelText = { t(cancelTitleKey) }
+
+ // $FlowFixMeState
defaultValue = { this.state.text }
onCancel = { this._onCancel }
onChangeText = { this._onChangeText }
@@ -226,7 +230,7 @@ class Dialog extends AbstractDialog {
mapped
= React.cloneElement(
mapped,
- /* props */ undefined,
+ /* props */ {},
...React.Children.toArray(React.Children.map(
children,
function(element) { // eslint-disable-line no-shadow
@@ -240,6 +244,8 @@ class Dialog extends AbstractDialog {
return mapped;
}
+ _onCancel: () => void;
+
_onChangeText: (string) => void;
/**
@@ -254,6 +260,8 @@ class Dialog extends AbstractDialog {
this.setState({ text });
}
+ _onSubmit: (?string) => void;
+
/**
* Submits this {@code Dialog} with the value of the {@link TextInput}
* rendered by {@link Prompt} unless a value is explicitly specified.
@@ -263,6 +271,7 @@ class Dialog extends AbstractDialog {
* @returns {void}
*/
_onSubmit(value: ?string) {
+ // $FlowFixMeState
super._onSubmit(value || this.state.text);
}
}
diff --git a/react/features/base/media/components/AbstractAudio.js b/react/features/base/media/components/AbstractAudio.js
index da524e5e44..1635c1b24d 100644
--- a/react/features/base/media/components/AbstractAudio.js
+++ b/react/features/base/media/components/AbstractAudio.js
@@ -1,3 +1,5 @@
+// @flow
+
import PropTypes from 'prop-types';
import React, { Component } from 'react';
@@ -5,7 +7,7 @@ import React, { Component } from 'react';
* The React {@link Component} which is similar to Web's
* {@code HTMLAudioElement}.
*/
-export default class AbstractAudio extends Component {
+export default class AbstractAudio extends Component<*> {
/**
* The (reference to the) {@link ReactElement} which actually implements
* this {@code AbstractAudio}.
diff --git a/react/features/conference/components/Conference.native.js b/react/features/conference/components/Conference.native.js
index 81f4e0ea0f..2d0ed8e7ff 100644
--- a/react/features/conference/components/Conference.native.js
+++ b/react/features/conference/components/Conference.native.js
@@ -339,7 +339,7 @@ function _mapDispatchToProps(dispatch) {
* @returns {void}
* @private
*/
- _setToolboxVisible(visible: boolean) {
+ _setToolboxVisible(visible) {
dispatch(setToolboxVisible(visible));
}
};
diff --git a/react/features/connection-indicator/components/ConnectionIndicator.js b/react/features/connection-indicator/components/ConnectionIndicator.js
index 852f7101e2..ccd8a6316b 100644
--- a/react/features/connection-indicator/components/ConnectionIndicator.js
+++ b/react/features/connection-indicator/components/ConnectionIndicator.js
@@ -1,3 +1,5 @@
+/* global interfaceConfig */
+
import PropTypes from 'prop-types';
import React, { Component } from 'react';
@@ -8,8 +10,6 @@ import { ConnectionStatsTable } from '../../connection-stats';
import statsEmitter from '../statsEmitter';
-declare var interfaceConfig: Object;
-
/**
* The connection quality percentage that must be reached to be considered of
* good quality and can result in the connection indicator being hidden.
diff --git a/react/features/device-selection/DeviceSelectionPopup.js b/react/features/device-selection/DeviceSelectionPopup.js
index 6c91e590c1..98a5a0b2f1 100644
--- a/react/features/device-selection/DeviceSelectionPopup.js
+++ b/react/features/device-selection/DeviceSelectionPopup.js
@@ -1,3 +1,5 @@
+/* global JitsiMeetJS */
+
import Logger from 'jitsi-meet-logger';
import React from 'react';
import ReactDOM from 'react-dom';
@@ -11,8 +13,6 @@ import { parseURLParams } from '../base/config';
import DeviceSelectionDialogBase from './components/DeviceSelectionDialogBase';
-declare var JitsiMeetJS: Object;
-
const logger = Logger.getLogger(__filename);
/**
diff --git a/react/features/device-selection/actions.js b/react/features/device-selection/actions.js
index 25a3ee403b..cdfa09a599 100644
--- a/react/features/device-selection/actions.js
+++ b/react/features/device-selection/actions.js
@@ -132,8 +132,8 @@ function _openDeviceSelectionDialogInPopup() {
* @param {Function} responseCallback - The callback that will send the
* response.
* @returns {boolean}
- */ // eslint-disable-next-line max-params
-function _processRequest(dispatch, getState, request, responseCallback) {
+ */
+function _processRequest(dispatch, getState, request, responseCallback) { // eslint-disable-line max-len, max-params
if (request.type === 'devices') {
switch (request.name) {
case 'isDeviceListAvailable':
diff --git a/react/features/feedback/components/FeedbackDialog.web.js b/react/features/feedback/components/FeedbackDialog.web.js
index affe0eb743..587094489c 100644
--- a/react/features/feedback/components/FeedbackDialog.web.js
+++ b/react/features/feedback/components/FeedbackDialog.web.js
@@ -1,3 +1,5 @@
+/* global interfaceConfig */
+
import StarIcon from '@atlaskit/icon/glyph/star';
import StarFilledIcon from '@atlaskit/icon/glyph/star-filled';
import PropTypes from 'prop-types';
@@ -10,8 +12,6 @@ import { translate } from '../../base/i18n';
import { cancelFeedback, submitFeedback } from '../actions';
-declare var interfaceConfig: Object;
-
const scoreAnimationClass
= interfaceConfig.ENABLE_FEEDBACK_ANIMATION ? 'shake-rotate' : '';
diff --git a/react/features/invite/components/InfoDialog.web.js b/react/features/invite/components/InfoDialog.web.js
index 4d669cb5e4..9be57ee0ed 100644
--- a/react/features/invite/components/InfoDialog.web.js
+++ b/react/features/invite/components/InfoDialog.web.js
@@ -1,3 +1,5 @@
+/* global interfaceConfig */
+
import React, { Component } from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
@@ -10,8 +12,6 @@ import AddPeopleDialog from './AddPeopleDialog';
const logger = require('jitsi-meet-logger').getLogger(__filename);
-declare var interfaceConfig: Object;
-
/**
* A React Component with the contents for a dialog that shows information about
* the current conference and provides ways to invite other participants.
diff --git a/react/features/invite/components/InfoDialogButton.web.js b/react/features/invite/components/InfoDialogButton.web.js
index a2817a185d..7cf0ffa0fe 100644
--- a/react/features/invite/components/InfoDialogButton.web.js
+++ b/react/features/invite/components/InfoDialogButton.web.js
@@ -1,3 +1,5 @@
+/* global interfaceConfig */
+
import InlineDialog from '@atlaskit/inline-dialog';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
@@ -6,11 +8,8 @@ import { connect } from 'react-redux';
import { ToolbarButton, TOOLTIP_TO_POPUP_POSITION } from '../../toolbox';
import { setInfoDialogVisibility } from '../actions';
-
import InfoDialog from './InfoDialog';
-declare var interfaceConfig: Object;
-
const { INITIAL_TOOLBAR_TIMEOUT } = interfaceConfig;
/**
diff --git a/react/features/invite/components/InviteButton.web.js b/react/features/invite/components/InviteButton.web.js
index 4940e1859b..b2ac681ffb 100644
--- a/react/features/invite/components/InviteButton.web.js
+++ b/react/features/invite/components/InviteButton.web.js
@@ -1,3 +1,5 @@
+/* global interfaceConfig */
+
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
@@ -12,8 +14,6 @@ import { AddPeopleDialog, InviteDialog } from '.';
import { DialOutDialog } from '../../dial-out';
import { isInviteOptionEnabled, getInviteOptionPosition } from '../functions';
-declare var interfaceConfig: Object;
-
const SHARE_LINK_OPTION = 'invite';
const DIAL_OUT_OPTION = 'dialout';
const ADD_TO_CALL_OPTION = 'addtocall';
diff --git a/react/features/notifications/components/Notification.web.js b/react/features/notifications/components/Notification.web.js
index a1c542c600..2f5308e853 100644
--- a/react/features/notifications/components/Notification.web.js
+++ b/react/features/notifications/components/Notification.web.js
@@ -1,9 +1,11 @@
+// @flow
+
import Flag from '@atlaskit/flag';
import EditorInfoIcon from '@atlaskit/icon/glyph/editor/info';
-import PropTypes from 'prop-types';
import ErrorIcon from '@atlaskit/icon/glyph/error';
import WarningIcon from '@atlaskit/icon/glyph/warning';
import { colors } from '@atlaskit/theme';
+import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { translate } from '../../base/i18n';
@@ -30,7 +32,7 @@ const ICON_COLOR = {
*
* @extends Component
*/
-class Notification extends Component {
+class Notification extends Component<*> {
/**
* Default values for {@code Notification} component's properties.
*
@@ -163,6 +165,8 @@ class Notification extends Component {
);
}
+ _onDismissed: () => void;
+
/**
* Calls back into {@code FlagGroup} to dismiss the notification.
*
diff --git a/react/features/overlay/components/OverlayContainer.js b/react/features/overlay/components/OverlayContainer.js
index a93831d220..526ed0ca7f 100644
--- a/react/features/overlay/components/OverlayContainer.js
+++ b/react/features/overlay/components/OverlayContainer.js
@@ -1,3 +1,5 @@
+/* global interfaceConfig */
+
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
@@ -12,8 +14,6 @@ import UserMediaPermissionsFilmstripOnlyOverlay
from './UserMediaPermissionsFilmstripOnlyOverlay';
import UserMediaPermissionsOverlay from './UserMediaPermissionsOverlay';
-declare var interfaceConfig: Object;
-
/**
* Implements a React Component that will display the correct overlay when
* needed.
diff --git a/react/features/overlay/components/OverlayFrame.js b/react/features/overlay/components/OverlayFrame.js
index 69cdfc64e7..03041a4337 100644
--- a/react/features/overlay/components/OverlayFrame.js
+++ b/react/features/overlay/components/OverlayFrame.js
@@ -1,8 +1,8 @@
+/* global interfaceConfig */
+
import PropTypes from 'prop-types';
import React, { Component } from 'react';
-declare var interfaceConfig: Object;
-
/**
* Implements a React Component for the frame of the overlays.
*/
diff --git a/react/features/overlay/components/ReloadTimer.js b/react/features/overlay/components/ReloadTimer.js
index 3fa5d73d9e..da0b31fd8c 100644
--- a/react/features/overlay/components/ReloadTimer.js
+++ b/react/features/overlay/components/ReloadTimer.js
@@ -1,10 +1,10 @@
+/* global AJS */
+
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { translate } from '../../base/i18n';
-declare var AJS: Object;
-
/**
* Implements a React Component for the reload timer. Starts counter from
* props.start, adds props.step to the current value on every props.interval
diff --git a/react/features/remote-control/components/RemoteControlAuthorizationDialog.js b/react/features/remote-control/components/RemoteControlAuthorizationDialog.js
index a2682fae73..8bda33bcae 100644
--- a/react/features/remote-control/components/RemoteControlAuthorizationDialog.js
+++ b/react/features/remote-control/components/RemoteControlAuthorizationDialog.js
@@ -1,3 +1,5 @@
+// @flow
+
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
@@ -11,7 +13,7 @@ declare var APP: Object;
/**
* Implements a dialog for remote control authorization.
*/
-class RemoteControlAuthorizationDialog extends Component {
+class RemoteControlAuthorizationDialog extends Component<*> {
/**
* RemoteControlAuthorizationDialog component's property types.
*
@@ -105,6 +107,8 @@ class RemoteControlAuthorizationDialog extends Component {
);
}
+ _onCancel: () => boolean;
+
/**
* Notifies the remote control module about the denial of the remote control
* request.
@@ -119,6 +123,8 @@ class RemoteControlAuthorizationDialog extends Component {
return true;
}
+ _onSubmit: () => boolean;
+
/**
* Notifies the remote control module that the remote control request is
* accepted.
diff --git a/react/features/remote-video-menu/components/RemoteVideoMenuTriggerButton.js b/react/features/remote-video-menu/components/RemoteVideoMenuTriggerButton.js
index d833522941..f66309eccd 100644
--- a/react/features/remote-video-menu/components/RemoteVideoMenuTriggerButton.js
+++ b/react/features/remote-video-menu/components/RemoteVideoMenuTriggerButton.js
@@ -1,3 +1,5 @@
+// @flow
+
import PropTypes from 'prop-types';
import React, { Component } from 'react';
@@ -20,7 +22,7 @@ declare var interfaceConfig: Object;
*
* @extends {Component}
*/
-class RemoteVideoMenuTriggerButton extends Component {
+class RemoteVideoMenuTriggerButton extends Component<*> {
static propTypes = {
/**
* A value between 0 and 1 indicating the volume of the participant's
@@ -66,25 +68,25 @@ class RemoteVideoMenuTriggerButton extends Component {
remoteControlState: PropTypes.number
};
+ /**
+ * The internal reference to topmost DOM/HTML element backing the React
+ * {@code Component}. Accessed directly for associating an element as
+ * the trigger for a popover.
+ *
+ * @private
+ * @type {HTMLDivElement}
+ */
+ _rootElement = null;
+
/**
* Initializes a new {#@code RemoteVideoMenuTriggerButton} instance.
*
* @param {Object} props - The read-only properties with which the new
* instance is to be initialized.
*/
- constructor(props) {
+ constructor(props: Object) {
super(props);
- /**
- * The internal reference to topmost DOM/HTML element backing the React
- * {@code Component}. Accessed directly for associating an element as
- * the trigger for a popover.
- *
- * @private
- * @type {HTMLDivElement}
- */
- this._rootElement = null;
-
// Bind event handler so it is only bound once for every instance.
this._onShowRemoteMenu = this._onShowRemoteMenu.bind(this);
}
@@ -118,6 +120,8 @@ class RemoteVideoMenuTriggerButton extends Component {
);
}
+ _onShowRemoteMenu: () => void;
+
/**
* Opens the {@code RemoteVideoMenu}.
*