Fix eslint & flow errors

Prepares for the latest eslint & flow-related npm packages which cause
these errors.
This commit is contained in:
Lyubo Marinov 2017-11-16 12:26:14 -06:00
parent 30be46326a
commit 8fd91573fc
21 changed files with 69 additions and 45 deletions

View File

@ -202,7 +202,7 @@ export default class EtherpadManager {
}
/**
*
*
*/
isVisible() {
return VideoLayout.isLargeContainerTypeVisible(ETHERPAD_CONTAINER_TYPE);

View File

@ -588,7 +588,7 @@ export class VideoContainer extends LargeContainer {
}
/**
*
*
*/
hide() {
// as the container is hidden/replaced by another container

View File

@ -237,7 +237,7 @@ export default {
}
/**
*
*
*/
function createVideoTrack(showError) {
return (

View File

@ -68,7 +68,7 @@ class Translation {
}
/**
*
*
*/
translateElement(selector: Object, options: Object) {
// XXX i18next expects undefined if options are missing.

View File

@ -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.

View File

@ -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);
}
}

View File

@ -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}.

View File

@ -339,7 +339,7 @@ function _mapDispatchToProps(dispatch) {
* @returns {void}
* @private
*/
_setToolboxVisible(visible: boolean) {
_setToolboxVisible(visible) {
dispatch(setToolboxVisible(visible));
}
};

View File

@ -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.

View File

@ -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);
/**

View File

@ -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':

View File

@ -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' : '';

View File

@ -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.

View File

@ -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;
/**

View File

@ -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';

View File

@ -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.
*

View File

@ -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.

View File

@ -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.
*/

View File

@ -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

View File

@ -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.

View File

@ -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}.
*