Pārlūkot izejas kodu

Fix eslint & flow errors

Prepares for the latest eslint & flow-related npm packages which cause
these errors.
j8
Lyubo Marinov 8 gadus atpakaļ
vecāks
revīzija
8fd91573fc

+ 1
- 1
modules/UI/etherpad/Etherpad.js Parādīt failu

202
     }
202
     }
203
 
203
 
204
     /**
204
     /**
205
-     * 
205
+     *
206
      */
206
      */
207
     isVisible() {
207
     isVisible() {
208
         return VideoLayout.isLargeContainerTypeVisible(ETHERPAD_CONTAINER_TYPE);
208
         return VideoLayout.isLargeContainerTypeVisible(ETHERPAD_CONTAINER_TYPE);

+ 1
- 1
modules/UI/videolayout/VideoContainer.js Parādīt failu

588
     }
588
     }
589
 
589
 
590
     /**
590
     /**
591
-     * 
591
+     *
592
      */
592
      */
593
     hide() {
593
     hide() {
594
         // as the container is hidden/replaced by another container
594
         // as the container is hidden/replaced by another container

+ 1
- 1
modules/devices/mediaDeviceHelper.js Parādīt failu

237
         }
237
         }
238
 
238
 
239
         /**
239
         /**
240
-         * 
240
+         *
241
          */
241
          */
242
         function createVideoTrack(showError) {
242
         function createVideoTrack(showError) {
243
             return (
243
             return (

+ 1
- 1
modules/translation/translation.js Parādīt failu

68
     }
68
     }
69
 
69
 
70
     /**
70
     /**
71
-     * 
71
+     *
72
      */
72
      */
73
     translateElement(selector: Object, options: Object) {
73
     translateElement(selector: Object, options: Object) {
74
         // XXX i18next expects undefined if options are missing.
74
         // XXX i18next expects undefined if options are missing.

+ 2
- 2
react/features/app/components/AbstractApp.js Parādīt failu

1
+/* global APP */
2
+
1
 import PropTypes from 'prop-types';
3
 import PropTypes from 'prop-types';
2
 import React, { Component } from 'react';
4
 import React, { Component } from 'react';
3
 import { I18nextProvider } from 'react-i18next';
5
 import { I18nextProvider } from 'react-i18next';
17
 
19
 
18
 import { appNavigate, appWillMount, appWillUnmount } from '../actions';
20
 import { appNavigate, appWillMount, appWillUnmount } from '../actions';
19
 
21
 
20
-declare var APP: Object;
21
-
22
 /**
22
 /**
23
  * The default URL to open if no other was specified to {@code AbstractApp}
23
  * The default URL to open if no other was specified to {@code AbstractApp}
24
  * via props.
24
  * via props.

+ 10
- 1
react/features/base/dialog/components/Dialog.native.js Parādīt failu

1
+// @flow
2
+
1
 import PropTypes from 'prop-types';
3
 import PropTypes from 'prop-types';
2
 import React from 'react';
4
 import React from 'react';
3
 import { Modal, StyleSheet, TextInput } from 'react-native';
5
 import { Modal, StyleSheet, TextInput } from 'react-native';
105
             <Prompt
107
             <Prompt
106
                 cancelButtonTextStyle = { cancelButtonTextStyle }
108
                 cancelButtonTextStyle = { cancelButtonTextStyle }
107
                 cancelText = { t(cancelTitleKey) }
109
                 cancelText = { t(cancelTitleKey) }
110
+
111
+                // $FlowFixMeState
108
                 defaultValue = { this.state.text }
112
                 defaultValue = { this.state.text }
109
                 onCancel = { this._onCancel }
113
                 onCancel = { this._onCancel }
110
                 onChangeText = { this._onChangeText }
114
                 onChangeText = { this._onChangeText }
226
                 mapped
230
                 mapped
227
                     = React.cloneElement(
231
                     = React.cloneElement(
228
                         mapped,
232
                         mapped,
229
-                        /* props */ undefined,
233
+                        /* props */ {},
230
                         ...React.Children.toArray(React.Children.map(
234
                         ...React.Children.toArray(React.Children.map(
231
                             children,
235
                             children,
232
                             function(element) { // eslint-disable-line no-shadow
236
                             function(element) { // eslint-disable-line no-shadow
240
         return mapped;
244
         return mapped;
241
     }
245
     }
242
 
246
 
247
+    _onCancel: () => void;
248
+
243
     _onChangeText: (string) => void;
249
     _onChangeText: (string) => void;
244
 
250
 
245
     /**
251
     /**
254
         this.setState({ text });
260
         this.setState({ text });
255
     }
261
     }
256
 
262
 
263
+    _onSubmit: (?string) => void;
264
+
257
     /**
265
     /**
258
      * Submits this {@code Dialog} with the value of the {@link TextInput}
266
      * Submits this {@code Dialog} with the value of the {@link TextInput}
259
      * rendered by {@link Prompt} unless a value is explicitly specified.
267
      * rendered by {@link Prompt} unless a value is explicitly specified.
263
      * @returns {void}
271
      * @returns {void}
264
      */
272
      */
265
     _onSubmit(value: ?string) {
273
     _onSubmit(value: ?string) {
274
+        // $FlowFixMeState
266
         super._onSubmit(value || this.state.text);
275
         super._onSubmit(value || this.state.text);
267
     }
276
     }
268
 }
277
 }

+ 3
- 1
react/features/base/media/components/AbstractAudio.js Parādīt failu

1
+// @flow
2
+
1
 import PropTypes from 'prop-types';
3
 import PropTypes from 'prop-types';
2
 import React, { Component } from 'react';
4
 import React, { Component } from 'react';
3
 
5
 
5
  * The React {@link Component} which is similar to Web's
7
  * The React {@link Component} which is similar to Web's
6
  * {@code HTMLAudioElement}.
8
  * {@code HTMLAudioElement}.
7
  */
9
  */
8
-export default class AbstractAudio extends Component {
10
+export default class AbstractAudio extends Component<*> {
9
     /**
11
     /**
10
      * The (reference to the) {@link ReactElement} which actually implements
12
      * The (reference to the) {@link ReactElement} which actually implements
11
      * this {@code AbstractAudio}.
13
      * this {@code AbstractAudio}.

+ 1
- 1
react/features/conference/components/Conference.native.js Parādīt failu

339
          * @returns {void}
339
          * @returns {void}
340
          * @private
340
          * @private
341
          */
341
          */
342
-        _setToolboxVisible(visible: boolean) {
342
+        _setToolboxVisible(visible) {
343
             dispatch(setToolboxVisible(visible));
343
             dispatch(setToolboxVisible(visible));
344
         }
344
         }
345
     };
345
     };

+ 2
- 2
react/features/connection-indicator/components/ConnectionIndicator.js Parādīt failu

1
+/* global interfaceConfig */
2
+
1
 import PropTypes from 'prop-types';
3
 import PropTypes from 'prop-types';
2
 import React, { Component } from 'react';
4
 import React, { Component } from 'react';
3
 
5
 
8
 
10
 
9
 import statsEmitter from '../statsEmitter';
11
 import statsEmitter from '../statsEmitter';
10
 
12
 
11
-declare var interfaceConfig: Object;
12
-
13
 /**
13
 /**
14
  * The connection quality percentage that must be reached to be considered of
14
  * The connection quality percentage that must be reached to be considered of
15
  * good quality and can result in the connection indicator being hidden.
15
  * good quality and can result in the connection indicator being hidden.

+ 2
- 2
react/features/device-selection/DeviceSelectionPopup.js Parādīt failu

1
+/* global JitsiMeetJS */
2
+
1
 import Logger from 'jitsi-meet-logger';
3
 import Logger from 'jitsi-meet-logger';
2
 import React from 'react';
4
 import React from 'react';
3
 import ReactDOM from 'react-dom';
5
 import ReactDOM from 'react-dom';
11
 
13
 
12
 import DeviceSelectionDialogBase from './components/DeviceSelectionDialogBase';
14
 import DeviceSelectionDialogBase from './components/DeviceSelectionDialogBase';
13
 
15
 
14
-declare var JitsiMeetJS: Object;
15
-
16
 const logger = Logger.getLogger(__filename);
16
 const logger = Logger.getLogger(__filename);
17
 
17
 
18
 /**
18
 /**

+ 2
- 2
react/features/device-selection/actions.js Parādīt failu

132
  * @param {Function} responseCallback - The callback that will send the
132
  * @param {Function} responseCallback - The callback that will send the
133
  * response.
133
  * response.
134
  * @returns {boolean}
134
  * @returns {boolean}
135
- */ // eslint-disable-next-line max-params
136
-function _processRequest(dispatch, getState, request, responseCallback) {
135
+ */
136
+function _processRequest(dispatch, getState, request, responseCallback) { // eslint-disable-line max-len, max-params
137
     if (request.type === 'devices') {
137
     if (request.type === 'devices') {
138
         switch (request.name) {
138
         switch (request.name) {
139
         case 'isDeviceListAvailable':
139
         case 'isDeviceListAvailable':

+ 2
- 2
react/features/feedback/components/FeedbackDialog.web.js Parādīt failu

1
+/* global interfaceConfig */
2
+
1
 import StarIcon from '@atlaskit/icon/glyph/star';
3
 import StarIcon from '@atlaskit/icon/glyph/star';
2
 import StarFilledIcon from '@atlaskit/icon/glyph/star-filled';
4
 import StarFilledIcon from '@atlaskit/icon/glyph/star-filled';
3
 import PropTypes from 'prop-types';
5
 import PropTypes from 'prop-types';
10
 
12
 
11
 import { cancelFeedback, submitFeedback } from '../actions';
13
 import { cancelFeedback, submitFeedback } from '../actions';
12
 
14
 
13
-declare var interfaceConfig: Object;
14
-
15
 const scoreAnimationClass
15
 const scoreAnimationClass
16
     = interfaceConfig.ENABLE_FEEDBACK_ANIMATION ? 'shake-rotate' : '';
16
     = interfaceConfig.ENABLE_FEEDBACK_ANIMATION ? 'shake-rotate' : '';
17
 
17
 

+ 2
- 2
react/features/invite/components/InfoDialog.web.js Parādīt failu

1
+/* global interfaceConfig */
2
+
1
 import React, { Component } from 'react';
3
 import React, { Component } from 'react';
2
 import { connect } from 'react-redux';
4
 import { connect } from 'react-redux';
3
 import PropTypes from 'prop-types';
5
 import PropTypes from 'prop-types';
10
 
12
 
11
 const logger = require('jitsi-meet-logger').getLogger(__filename);
13
 const logger = require('jitsi-meet-logger').getLogger(__filename);
12
 
14
 
13
-declare var interfaceConfig: Object;
14
-
15
 /**
15
 /**
16
  * A React Component with the contents for a dialog that shows information about
16
  * A React Component with the contents for a dialog that shows information about
17
  * the current conference and provides ways to invite other participants.
17
  * the current conference and provides ways to invite other participants.

+ 2
- 3
react/features/invite/components/InfoDialogButton.web.js Parādīt failu

1
+/* global interfaceConfig */
2
+
1
 import InlineDialog from '@atlaskit/inline-dialog';
3
 import InlineDialog from '@atlaskit/inline-dialog';
2
 import PropTypes from 'prop-types';
4
 import PropTypes from 'prop-types';
3
 import React, { Component } from 'react';
5
 import React, { Component } from 'react';
6
 import { ToolbarButton, TOOLTIP_TO_POPUP_POSITION } from '../../toolbox';
8
 import { ToolbarButton, TOOLTIP_TO_POPUP_POSITION } from '../../toolbox';
7
 
9
 
8
 import { setInfoDialogVisibility } from '../actions';
10
 import { setInfoDialogVisibility } from '../actions';
9
-
10
 import InfoDialog from './InfoDialog';
11
 import InfoDialog from './InfoDialog';
11
 
12
 
12
-declare var interfaceConfig: Object;
13
-
14
 const { INITIAL_TOOLBAR_TIMEOUT } = interfaceConfig;
13
 const { INITIAL_TOOLBAR_TIMEOUT } = interfaceConfig;
15
 
14
 
16
 /**
15
 /**

+ 2
- 2
react/features/invite/components/InviteButton.web.js Parādīt failu

1
+/* global interfaceConfig */
2
+
1
 import PropTypes from 'prop-types';
3
 import PropTypes from 'prop-types';
2
 import React, { Component } from 'react';
4
 import React, { Component } from 'react';
3
 import { connect } from 'react-redux';
5
 import { connect } from 'react-redux';
12
 import { DialOutDialog } from '../../dial-out';
14
 import { DialOutDialog } from '../../dial-out';
13
 import { isInviteOptionEnabled, getInviteOptionPosition } from '../functions';
15
 import { isInviteOptionEnabled, getInviteOptionPosition } from '../functions';
14
 
16
 
15
-declare var interfaceConfig: Object;
16
-
17
 const SHARE_LINK_OPTION = 'invite';
17
 const SHARE_LINK_OPTION = 'invite';
18
 const DIAL_OUT_OPTION = 'dialout';
18
 const DIAL_OUT_OPTION = 'dialout';
19
 const ADD_TO_CALL_OPTION = 'addtocall';
19
 const ADD_TO_CALL_OPTION = 'addtocall';

+ 6
- 2
react/features/notifications/components/Notification.web.js Parādīt failu

1
+// @flow
2
+
1
 import Flag from '@atlaskit/flag';
3
 import Flag from '@atlaskit/flag';
2
 import EditorInfoIcon from '@atlaskit/icon/glyph/editor/info';
4
 import EditorInfoIcon from '@atlaskit/icon/glyph/editor/info';
3
-import PropTypes from 'prop-types';
4
 import ErrorIcon from '@atlaskit/icon/glyph/error';
5
 import ErrorIcon from '@atlaskit/icon/glyph/error';
5
 import WarningIcon from '@atlaskit/icon/glyph/warning';
6
 import WarningIcon from '@atlaskit/icon/glyph/warning';
6
 import { colors } from '@atlaskit/theme';
7
 import { colors } from '@atlaskit/theme';
8
+import PropTypes from 'prop-types';
7
 import React, { Component } from 'react';
9
 import React, { Component } from 'react';
8
 
10
 
9
 import { translate } from '../../base/i18n';
11
 import { translate } from '../../base/i18n';
30
  *
32
  *
31
  * @extends Component
33
  * @extends Component
32
  */
34
  */
33
-class Notification extends Component {
35
+class Notification extends Component<*> {
34
     /**
36
     /**
35
      * Default values for {@code Notification} component's properties.
37
      * Default values for {@code Notification} component's properties.
36
      *
38
      *
163
         );
165
         );
164
     }
166
     }
165
 
167
 
168
+    _onDismissed: () => void;
169
+
166
     /**
170
     /**
167
      * Calls back into {@code FlagGroup} to dismiss the notification.
171
      * Calls back into {@code FlagGroup} to dismiss the notification.
168
      *
172
      *

+ 2
- 2
react/features/overlay/components/OverlayContainer.js Parādīt failu

1
+/* global interfaceConfig */
2
+
1
 import PropTypes from 'prop-types';
3
 import PropTypes from 'prop-types';
2
 import React, { Component } from 'react';
4
 import React, { Component } from 'react';
3
 import { connect } from 'react-redux';
5
 import { connect } from 'react-redux';
12
     from './UserMediaPermissionsFilmstripOnlyOverlay';
14
     from './UserMediaPermissionsFilmstripOnlyOverlay';
13
 import UserMediaPermissionsOverlay from './UserMediaPermissionsOverlay';
15
 import UserMediaPermissionsOverlay from './UserMediaPermissionsOverlay';
14
 
16
 
15
-declare var interfaceConfig: Object;
16
-
17
 /**
17
 /**
18
  * Implements a React Component that will display the correct overlay when
18
  * Implements a React Component that will display the correct overlay when
19
  * needed.
19
  * needed.

+ 2
- 2
react/features/overlay/components/OverlayFrame.js Parādīt failu

1
+/* global interfaceConfig */
2
+
1
 import PropTypes from 'prop-types';
3
 import PropTypes from 'prop-types';
2
 import React, { Component } from 'react';
4
 import React, { Component } from 'react';
3
 
5
 
4
-declare var interfaceConfig: Object;
5
-
6
 /**
6
 /**
7
  * Implements a React Component for the frame of the overlays.
7
  * Implements a React Component for the frame of the overlays.
8
  */
8
  */

+ 2
- 2
react/features/overlay/components/ReloadTimer.js Parādīt failu

1
+/* global AJS */
2
+
1
 import PropTypes from 'prop-types';
3
 import PropTypes from 'prop-types';
2
 import React, { Component } from 'react';
4
 import React, { Component } from 'react';
3
 
5
 
4
 import { translate } from '../../base/i18n';
6
 import { translate } from '../../base/i18n';
5
 
7
 
6
-declare var AJS: Object;
7
-
8
 /**
8
 /**
9
  * Implements a React Component for the reload timer. Starts counter from
9
  * Implements a React Component for the reload timer. Starts counter from
10
  * props.start, adds props.step to the current value on every props.interval
10
  * props.start, adds props.step to the current value on every props.interval

+ 7
- 1
react/features/remote-control/components/RemoteControlAuthorizationDialog.js Parādīt failu

1
+// @flow
2
+
1
 import PropTypes from 'prop-types';
3
 import PropTypes from 'prop-types';
2
 import React, { Component } from 'react';
4
 import React, { Component } from 'react';
3
 import { connect } from 'react-redux';
5
 import { connect } from 'react-redux';
11
 /**
13
 /**
12
  * Implements a dialog for remote control authorization.
14
  * Implements a dialog for remote control authorization.
13
  */
15
  */
14
-class RemoteControlAuthorizationDialog extends Component {
16
+class RemoteControlAuthorizationDialog extends Component<*> {
15
     /**
17
     /**
16
      * RemoteControlAuthorizationDialog component's property types.
18
      * RemoteControlAuthorizationDialog component's property types.
17
      *
19
      *
105
         );
107
         );
106
     }
108
     }
107
 
109
 
110
+    _onCancel: () => boolean;
111
+
108
     /**
112
     /**
109
      * Notifies the remote control module about the denial of the remote control
113
      * Notifies the remote control module about the denial of the remote control
110
      * request.
114
      * request.
119
         return true;
123
         return true;
120
     }
124
     }
121
 
125
 
126
+    _onSubmit: () => boolean;
127
+
122
     /**
128
     /**
123
      * Notifies the remote control module that the remote control request is
129
      * Notifies the remote control module that the remote control request is
124
      * accepted.
130
      * accepted.

+ 16
- 12
react/features/remote-video-menu/components/RemoteVideoMenuTriggerButton.js Parādīt failu

1
+// @flow
2
+
1
 import PropTypes from 'prop-types';
3
 import PropTypes from 'prop-types';
2
 import React, { Component } from 'react';
4
 import React, { Component } from 'react';
3
 
5
 
20
  *
22
  *
21
  * @extends {Component}
23
  * @extends {Component}
22
  */
24
  */
23
-class RemoteVideoMenuTriggerButton extends Component {
25
+class RemoteVideoMenuTriggerButton extends Component<*> {
24
     static propTypes = {
26
     static propTypes = {
25
         /**
27
         /**
26
          * A value between 0 and 1 indicating the volume of the participant's
28
          * A value between 0 and 1 indicating the volume of the participant's
66
         remoteControlState: PropTypes.number
68
         remoteControlState: PropTypes.number
67
     };
69
     };
68
 
70
 
71
+    /**
72
+     * The internal reference to topmost DOM/HTML element backing the React
73
+     * {@code Component}. Accessed directly for associating an element as
74
+     * the trigger for a popover.
75
+     *
76
+     * @private
77
+     * @type {HTMLDivElement}
78
+     */
79
+    _rootElement = null;
80
+
69
     /**
81
     /**
70
      * Initializes a new {#@code RemoteVideoMenuTriggerButton} instance.
82
      * Initializes a new {#@code RemoteVideoMenuTriggerButton} instance.
71
      *
83
      *
72
      * @param {Object} props - The read-only properties with which the new
84
      * @param {Object} props - The read-only properties with which the new
73
      * instance is to be initialized.
85
      * instance is to be initialized.
74
      */
86
      */
75
-    constructor(props) {
87
+    constructor(props: Object) {
76
         super(props);
88
         super(props);
77
 
89
 
78
-        /**
79
-         * The internal reference to topmost DOM/HTML element backing the React
80
-         * {@code Component}. Accessed directly for associating an element as
81
-         * the trigger for a popover.
82
-         *
83
-         * @private
84
-         * @type {HTMLDivElement}
85
-         */
86
-        this._rootElement = null;
87
-
88
         // Bind event handler so it is only bound once for every instance.
90
         // Bind event handler so it is only bound once for every instance.
89
         this._onShowRemoteMenu = this._onShowRemoteMenu.bind(this);
91
         this._onShowRemoteMenu = this._onShowRemoteMenu.bind(this);
90
     }
92
     }
118
         );
120
         );
119
     }
121
     }
120
 
122
 
123
+    _onShowRemoteMenu: () => void;
124
+
121
     /**
125
     /**
122
      * Opens the {@code RemoteVideoMenu}.
126
      * Opens the {@code RemoteVideoMenu}.
123
      *
127
      *

Notiek ielāde…
Atcelt
Saglabāt