diff --git a/src/common/MainNavBar/MainNavBar.js b/src/common/MainNavBar/MainNavBar.js index c6920ce42..507f8d229 100644 --- a/src/common/MainNavBar/MainNavBar.js +++ b/src/common/MainNavBar/MainNavBar.js @@ -23,6 +23,8 @@ const MainNavBar = React.memo(({ className }) => { ); }); +MainNavBar.displayName = 'MainNavBar'; + MainNavBar.propTypes = { className: PropTypes.string }; diff --git a/src/common/ModalDialog/index.js b/src/common/ModalDialog/index.js index 7dadbbd9e..6717dbe87 100644 --- a/src/common/ModalDialog/index.js +++ b/src/common/ModalDialog/index.js @@ -1,3 +1,3 @@ const ModalDialog = require('./ModalDialog'); -module.exports = ModalDialog; \ No newline at end of file +module.exports = ModalDialog; diff --git a/src/common/NavBar/NotificationsMenu/NotificationsList/Notification/Notification.js b/src/common/NavBar/NotificationsMenu/NotificationsList/Notification/Notification.js index 53c7b0e81..8bba1d435 100644 --- a/src/common/NavBar/NotificationsMenu/NotificationsList/Notification/Notification.js +++ b/src/common/NavBar/NotificationsMenu/NotificationsList/Notification/Notification.js @@ -80,7 +80,7 @@ const Notification = ({ className, id, type, name, poster, thumbnail, season, ep } ); -} +}; Notification.propTypes = { className: PropTypes.string, diff --git a/src/common/NavBar/NotificationsMenu/NotificationsList/NotificationPlaceholder/NotificationPlaceholder.js b/src/common/NavBar/NotificationsMenu/NotificationsList/NotificationPlaceholder/NotificationPlaceholder.js index 3bbac1538..0ee602b64 100644 --- a/src/common/NavBar/NotificationsMenu/NotificationsList/NotificationPlaceholder/NotificationPlaceholder.js +++ b/src/common/NavBar/NotificationsMenu/NotificationsList/NotificationPlaceholder/NotificationPlaceholder.js @@ -1,7 +1,6 @@ const React = require('react'); const PropTypes = require('prop-types'); const classnames = require('classnames'); -const Icon = require('stremio-icons/dom'); const styles = require('./styles'); const NotificationPlaceholder = ({ className }) => { @@ -20,6 +19,6 @@ const NotificationPlaceholder = ({ className }) => { NotificationPlaceholder.propTypes = { className: PropTypes.string -} +}; module.exports = NotificationPlaceholder; diff --git a/src/common/NavBar/NotificationsMenu/NotificationsList/NotificationsList.js b/src/common/NavBar/NotificationsMenu/NotificationsList/NotificationsList.js index e54bacb68..3fca82728 100644 --- a/src/common/NavBar/NotificationsMenu/NotificationsList/NotificationsList.js +++ b/src/common/NavBar/NotificationsMenu/NotificationsList/NotificationsList.js @@ -57,7 +57,7 @@ const NotificationsList = ({ className, metaItems }) => { } ); -} +}; NotificationsList.propTypes = { className: PropTypes.string, diff --git a/src/common/PaginationInput/index.js b/src/common/PaginationInput/index.js index 99f9edf62..4500ec5a6 100644 --- a/src/common/PaginationInput/index.js +++ b/src/common/PaginationInput/index.js @@ -1,3 +1,3 @@ const PaginationInput = require('./PaginationInput'); -module.exports = PaginationInput; \ No newline at end of file +module.exports = PaginationInput; diff --git a/src/common/Popup/Popup.js b/src/common/Popup/Popup.js index d0b26fa03..b956f764f 100644 --- a/src/common/Popup/Popup.js +++ b/src/common/Popup/Popup.js @@ -96,7 +96,7 @@ const Popup = ({ open, direction, renderLabel, renderMenu, dataset, onCloseReque : null }); -} +}; Popup.propTypes = { open: PropTypes.bool, diff --git a/src/common/routesRegexp.js b/src/common/routesRegexp.js index df7f4e069..113497ec5 100644 --- a/src/common/routesRegexp.js +++ b/src/common/routesRegexp.js @@ -8,11 +8,11 @@ const routesRegexp = { urlParamsNames: [] }, discover: { - regexp: /^\/discover(?:\/([^\/]*)\/([^\/]*)\/([^\/]*))?$/, + regexp: /^\/discover(?:\/([^/]*)\/([^/]*)\/([^/]*))?$/, urlParamsNames: ['addonTransportUrl', 'type', 'catalogId'] }, library: { - regexp: /^\/library(?:\/([^\/]*))?$/, + regexp: /^\/library(?:\/([^/]*))?$/, urlParamsNames: ['type'] }, search: { @@ -20,11 +20,11 @@ const routesRegexp = { urlParamsNames: [] }, metadetails: { - regexp: /^\/metadetails\/([^\/]*)\/([^\/]*)(?:\/([^\/]*))?$/, + regexp: /^\/metadetails\/([^/]*)\/([^/]*)(?:\/([^/]*))?$/, urlParamsNames: ['type', 'id', 'videoId'] }, addons: { - regexp: /^\/addons(?:\/([^\/]*)\/([^\/]*)\/([^\/]*))?$/, + regexp: /^\/addons(?:\/([^/]*)\/([^/]*)\/([^/]*))?$/, urlParamsNames: ['addonTransportUrl', 'catalogId', 'type'] }, settings: { @@ -32,7 +32,7 @@ const routesRegexp = { urlParamsNames: [] }, player: { - regexp: /^\/player\/([^\/]*)\/([^\/]*)\/([^\/]*)\/([^\/]*)$/, + regexp: /^\/player\/([^/]*)\/([^/]*)\/([^/]*)\/([^/]*)$/, urlParamsNames: ['type', 'id', 'videoId', 'stream'] } }; diff --git a/src/router/Router/Router.js b/src/router/Router/Router.js index dd8321e70..60fc0334b 100644 --- a/src/router/Router/Router.js +++ b/src/router/Router/Router.js @@ -95,7 +95,7 @@ const Router = ({ className, onPathNotMatch, ...props }) => {
{ views - .filter(view => view !== null) + .filter((view) => view !== null) .map(({ key, component, urlParams, queryParams }, index, views) => ( diff --git a/src/routes/Addons/Addon/Addon.js b/src/routes/Addons/Addon/Addon.js index 023c17732..f26dbcf3b 100644 --- a/src/routes/Addons/Addon/Addon.js +++ b/src/routes/Addons/Addon/Addon.js @@ -5,7 +5,7 @@ const Icon = require('stremio-icons/dom'); const { Button } = require('stremio/common'); const styles = require('./styles'); -const Addon = ({ className, id, name, logo, description, types, version, transportUrl, installed, toggle, onShareButtonClicked }) => { +const Addon = ({ className, id, name, logo, description, types, version, installed, toggle, onShareButtonClicked }) => { const onKeyUp = React.useCallback((event) => { if (event.key === 'Enter' && typeof toggle === 'function') { toggle(event); @@ -72,7 +72,6 @@ Addon.propTypes = { description: PropTypes.string, types: PropTypes.arrayOf(PropTypes.string), version: PropTypes.string, - transportUrl: PropTypes.string, installed: PropTypes.bool, toggle: PropTypes.func, onShareButtonClicked: PropTypes.func diff --git a/src/routes/Addons/Addons.js b/src/routes/Addons/Addons.js index 0a8152a17..cd68402df 100644 --- a/src/routes/Addons/Addons.js +++ b/src/routes/Addons/Addons.js @@ -1,4 +1,5 @@ const React = require('react'); +const PropTypes = require('prop-types'); const Icon = require('stremio-icons/dom'); const { Button, Multiselect, NavBar, TextInput, SharePrompt, ModalDialog } = require('stremio/common'); const Addon = require('./Addon'); @@ -163,4 +164,9 @@ const Addons = ({ urlParams, queryParams }) => { ); }; +Addons.propTypes = { + urlParams: PropTypes.instanceOf(URLSearchParams), + queryParams: PropTypes.instanceOf(URLSearchParams) +}; + module.exports = Addons; diff --git a/src/routes/Board/Board.js b/src/routes/Board/Board.js index 33b6638ae..47f293f45 100644 --- a/src/routes/Board/Board.js +++ b/src/routes/Board/Board.js @@ -32,7 +32,7 @@ const Board = () => { {board.catalog_resources.map((catalog_resource, index) => { const title = `${catalog_resource.addon_name} - ${catalog_resource.request.path.id} ${catalog_resource.request.path.type_name}`; switch (catalog_resource.content.type) { - case 'Ready': + case 'Ready': { return ( { limit={10} /> ); - case 'Err': + } + case 'Err': { const message = `Error(${catalog_resource.content.content.type})${typeof catalog_resource.content.content.content === 'string' ? ` - ${catalog_resource.content.content.content}` : ''}`; return ( { limit={10} /> ); - case 'Loading': + } + case 'Loading': { return ( { limit={10} /> ); + } } })}
diff --git a/src/routes/Discover/Discover.js b/src/routes/Discover/Discover.js index 0db14b05e..72baa410b 100644 --- a/src/routes/Discover/Discover.js +++ b/src/routes/Discover/Discover.js @@ -1,4 +1,5 @@ const React = require('react'); +const PropTypes = require('prop-types'); const classnames = require('classnames'); const Icon = require('stremio-icons/dom'); const { Button, MainNavBar, MetaItem, MetaPreview, Multiselect, ModalDialog, PaginationInput, useBinaryState } = require('stremio/common'); @@ -135,4 +136,9 @@ const Discover = ({ urlParams, queryParams }) => { ); }; +Discover.propTypes = { + urlParams: PropTypes.instanceOf(URLSearchParams), + queryParams: PropTypes.instanceOf(URLSearchParams) +}; + module.exports = Discover; diff --git a/src/routes/Intro/Intro.js b/src/routes/Intro/Intro.js index 6b05700ab..8f4959499 100644 --- a/src/routes/Intro/Intro.js +++ b/src/routes/Intro/Intro.js @@ -1,4 +1,5 @@ const React = require('react'); +const PropTypes = require('prop-types'); const classnames = require('classnames'); const Icon = require('stremio-icons/dom'); const { useRouteFocused } = require('stremio-router'); @@ -73,14 +74,17 @@ const Intro = ({ queryParams }) => { React.useEffect(() => { const onEvent = ({ event, args }) => { switch (event) { - case 'CtxActionErr': + case 'CtxActionErr': { const [_action, error] = args; dispatch({ type: 'error', error: error.args.message }); - case 'CtxChanged': + break; + } + case 'CtxChanged': { const state = core.getState(); if (state.ctx.content.auth !== null) { window.location.replace('#/'); } + } } }; if (routeFocused) { @@ -343,4 +347,8 @@ const Intro = ({ queryParams }) => { ); }; +Intro.propTypes = { + queryParams: PropTypes.instanceOf(URLSearchParams) +}; + module.exports = Intro; diff --git a/src/routes/Library/Library.js b/src/routes/Library/Library.js index 0f3013cfb..3de671136 100644 --- a/src/routes/Library/Library.js +++ b/src/routes/Library/Library.js @@ -1,4 +1,5 @@ const React = require('react'); +const PropTypes = require('prop-types'); const classnames = require('classnames'); const { Button, Multiselect, MainNavBar, MetaItem } = require('stremio/common'); const useLibrary = require('./useLibrary'); @@ -67,6 +68,11 @@ const Library = ({ urlParams, queryParams }) => { ); -} +}; + +Library.propTypes = { + urlParams: PropTypes.instanceOf(URLSearchParams), + queryParams: PropTypes.instanceOf(URLSearchParams) +}; module.exports = Library; diff --git a/src/routes/Library/useItemOptions.js b/src/routes/Library/useItemOptions.js index 870c14936..37edcd1a1 100644 --- a/src/routes/Library/useItemOptions.js +++ b/src/routes/Library/useItemOptions.js @@ -10,7 +10,7 @@ const DISMISS_OPTION = { value: 'dismiss' }; -const onSelect = (event) => { +const onSelect = (_event) => { // TODO {{event.value}} {{event.dataset}} }; diff --git a/src/routes/Library/useLibrary.js b/src/routes/Library/useLibrary.js index 4acaa6e78..b2426e055 100644 --- a/src/routes/Library/useLibrary.js +++ b/src/routes/Library/useLibrary.js @@ -90,6 +90,6 @@ const useLibrary = (urlParams, queryParams) => { init: initLibraryState, onNewState: onNewLibraryState }); -} +}; module.exports = useLibrary; diff --git a/src/routes/MetaDetails/MetaDetails.js b/src/routes/MetaDetails/MetaDetails.js index a19227a6c..16417e77a 100644 --- a/src/routes/MetaDetails/MetaDetails.js +++ b/src/routes/MetaDetails/MetaDetails.js @@ -1,4 +1,5 @@ const React = require('react'); +const PropTypes = require('prop-types'); const { NavBar, MetaPreview, useInLibrary } = require('stremio/common'); const VideosList = require('./VideosList'); const StreamsList = require('./StreamsList'); @@ -98,4 +99,8 @@ const MetaDetails = ({ urlParams }) => { ); }; +MetaDetails.propTypes = { + urlParams: PropTypes.instanceOf(URLSearchParams) +}; + module.exports = MetaDetails; diff --git a/src/routes/MetaDetails/StreamsList/StreamsList.js b/src/routes/MetaDetails/StreamsList/StreamsList.js index 01163b29a..2e0f8de86 100644 --- a/src/routes/MetaDetails/StreamsList/StreamsList.js +++ b/src/routes/MetaDetails/StreamsList/StreamsList.js @@ -44,7 +44,7 @@ const StreamsList = ({ className, streamsResources }) => { ); -} +}; StreamsList.propTypes = { className: PropTypes.string, diff --git a/src/routes/Search/Search.js b/src/routes/Search/Search.js index f76ea5c05..a860bce47 100644 --- a/src/routes/Search/Search.js +++ b/src/routes/Search/Search.js @@ -1,4 +1,5 @@ const React = require('react'); +const PropTypes = require('prop-types'); const Icon = require('stremio-icons/dom'); const { MainNavBar, MetaRow } = require('stremio/common'); const useSearch = require('./useSearch'); @@ -68,6 +69,10 @@ const Search = ({ queryParams }) => { ); -} +}; + +Search.propTypes = { + queryParams: PropTypes.instanceOf(URLSearchParams) +}; module.exports = Search; diff --git a/src/services/Core/Core.js b/src/services/Core/Core.js index dc0c48894..cbb741f3c 100644 --- a/src/services/Core/Core.js +++ b/src/services/Core/Core.js @@ -96,6 +96,6 @@ function Core() { this.getState = getState; Object.freeze(this); -}; +} module.exports = Core; diff --git a/src/services/KeyboardNavigation/KeyboardNavigation.js b/src/services/KeyboardNavigation/KeyboardNavigation.js index 4dc1586f5..bd46169d2 100644 --- a/src/services/KeyboardNavigation/KeyboardNavigation.js +++ b/src/services/KeyboardNavigation/KeyboardNavigation.js @@ -41,6 +41,6 @@ function KeyboardNavigation() { this.stop = stop; Object.freeze(this); -}; +} module.exports = KeyboardNavigation; diff --git a/src/services/ServicesContext/index.js b/src/services/ServicesContext/index.js index 95c276ac2..d61874550 100644 --- a/src/services/ServicesContext/index.js +++ b/src/services/ServicesContext/index.js @@ -4,4 +4,4 @@ const useServices = require('./useServices'); module.exports = { ServicesProvider, useServices -}; \ No newline at end of file +}; diff --git a/src/services/Shell/Shell.js b/src/services/Shell/Shell.js index efc3613ff..f1ae8bbb4 100644 --- a/src/services/Shell/Shell.js +++ b/src/services/Shell/Shell.js @@ -66,6 +66,6 @@ function Shell() { this.dispatch = dispatch; Object.freeze(this); -}; +} module.exports = Shell;