From 50267f3ac29dc811e3d47e28f94690591c844ecf Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Tue, 19 Mar 2019 07:49:57 -0700 Subject: [PATCH] Clearn up unused dependencies --- .eslintrc | 2 +- demo/js/mediaSession.ts | 1 - js/components/EqualizerWindow/EqOn.tsx | 2 +- js/components/MainWindow/index.tsx | 1 - js/components/MediaLibraryWindow/index.tsx | 3 +-- js/components/MilkdropWindow/Background.tsx | 2 +- js/components/MilkdropWindow/index.tsx | 2 +- js/components/MiniTime.tsx | 2 +- js/components/OptionsContextMenu.tsx | 2 +- js/components/PlaylistWindow/ListMenu.tsx | 3 +-- js/components/PlaylistWindow/RemoveMenu.tsx | 2 +- js/components/PlaylistWindow/TrackList.tsx | 2 +- js/components/PlaylistWindow/index.tsx | 3 +-- js/hooks.ts | 2 +- js/reducers/media.ts | 1 - js/serialization.test.ts | 4 ---- js/store.ts | 14 ++------------ 17 files changed, 14 insertions(+), 34 deletions(-) diff --git a/.eslintrc b/.eslintrc index ca803e10..e2827984 100644 --- a/.eslintrc +++ b/.eslintrc @@ -113,7 +113,7 @@ "no-unreachable": "error", "no-unused-expressions": "error", "@typescript-eslint/no-unused-vars": [ - "warn", + "error", { "ignoreRestSiblings": true } ], "no-use-before-define": ["error", "nofunc"], diff --git a/demo/js/mediaSession.ts b/demo/js/mediaSession.ts index 40aff323..027a10c9 100644 --- a/demo/js/mediaSession.ts +++ b/demo/js/mediaSession.ts @@ -1,5 +1,4 @@ import WebampLazy from "../../js/webampLazy"; -import { LoadedURLTrack } from "../../js/types"; export default function enableMediaSession(webamp: WebampLazy) { if ("mediaSession" in navigator) { diff --git a/js/components/EqualizerWindow/EqOn.tsx b/js/components/EqualizerWindow/EqOn.tsx index 1f66e3bc..e1ce9b86 100644 --- a/js/components/EqualizerWindow/EqOn.tsx +++ b/js/components/EqualizerWindow/EqOn.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { connect, DispatchProp } from "react-redux"; +import { connect } from "react-redux"; import classnames from "classnames"; import { toggleEq } from "../../actionCreators"; diff --git a/js/components/MainWindow/index.tsx b/js/components/MainWindow/index.tsx index 8f77fa09..73128c56 100644 --- a/js/components/MainWindow/index.tsx +++ b/js/components/MainWindow/index.tsx @@ -44,7 +44,6 @@ import { AppState, Dispatch, FilePicker, - Track, } from "../../types"; interface StateProps { diff --git a/js/components/MediaLibraryWindow/index.tsx b/js/components/MediaLibraryWindow/index.tsx index a84f4f7b..2512b765 100644 --- a/js/components/MediaLibraryWindow/index.tsx +++ b/js/components/MediaLibraryWindow/index.tsx @@ -70,10 +70,9 @@ class MediaLibraryWindow extends React.Component { }; render() { - const colors = this.props.skinGenExColors; return ( - {({ height, width }: { height: number; width: number }) => ( + {() => (
{ - const { innerRef, ...restProps } = props; + const { innerRef } = props; return (
( ); -const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => { +const mapDispatchToProps = (): DispatchProps => { return { removeAllTracks }; }; export default connect( diff --git a/js/components/PlaylistWindow/RemoveMenu.tsx b/js/components/PlaylistWindow/RemoveMenu.tsx index 623ad125..c0d5f639 100644 --- a/js/components/PlaylistWindow/RemoveMenu.tsx +++ b/js/components/PlaylistWindow/RemoveMenu.tsx @@ -1,4 +1,4 @@ -import React, { SFC } from "react"; +import React from "react"; import { connect } from "react-redux"; import { cropPlaylist, diff --git a/js/components/PlaylistWindow/TrackList.tsx b/js/components/PlaylistWindow/TrackList.tsx index a74523fe..7648bf5d 100644 --- a/js/components/PlaylistWindow/TrackList.tsx +++ b/js/components/PlaylistWindow/TrackList.tsx @@ -13,7 +13,7 @@ import { SELECT_ZERO } from "../../actionTypes"; import { dragSelected, scrollPlaylistByDelta } from "../../actionCreators"; import TrackCell from "./TrackCell"; import TrackTitle from "./TrackTitle"; -import { Dispatch, AppState, PlaylistTrack } from "../../types"; +import { Dispatch, AppState } from "../../types"; import { TracksState } from "../../reducers/tracks"; interface DispatchProps { diff --git a/js/components/PlaylistWindow/index.tsx b/js/components/PlaylistWindow/index.tsx index dbf9fc83..ad47e558 100644 --- a/js/components/PlaylistWindow/index.tsx +++ b/js/components/PlaylistWindow/index.tsx @@ -7,7 +7,6 @@ import { SET_FOCUSED_WINDOW } from "../../actionTypes"; import { scrollUpFourTracks, scrollDownFourTracks, - loadFilesFromReferences, togglePlaylistShadeMode, scrollVolume, closeWindow, @@ -30,7 +29,7 @@ import TrackList from "./TrackList"; import ScrollBar from "./ScrollBar"; import "../../../css/playlist-window.css"; -import { AppState, PlaylistStyle, Dispatch, LoadStyle } from "../../types"; +import { AppState, PlaylistStyle, Dispatch } from "../../types"; interface StateProps { offset: number; diff --git a/js/hooks.ts b/js/hooks.ts index e06c79a8..0353554f 100644 --- a/js/hooks.ts +++ b/js/hooks.ts @@ -7,7 +7,7 @@ interface Size { } export function useScreenSize() { - const [size, setSize] = useState(Utils.getScreenSize()); + const [size] = useState(Utils.getScreenSize()); // TODO: We could subscribe to screen size changes. return size; } diff --git a/js/reducers/media.ts b/js/reducers/media.ts index 95f90d05..8abf0cb6 100644 --- a/js/reducers/media.ts +++ b/js/reducers/media.ts @@ -8,7 +8,6 @@ import { SET_VOLUME, SET_BALANCE, SET_MEDIA, - SET_MEDIA_TAGS, TOGGLE_REPEAT, TOGGLE_SHUFFLE, TOGGLE_TIME_MODE, diff --git a/js/serialization.test.ts b/js/serialization.test.ts index 3020642c..4e22a892 100644 --- a/js/serialization.test.ts +++ b/js/serialization.test.ts @@ -80,10 +80,6 @@ function testSerialization({ }); } -const defaultSerializedState = Selectors.getSerlializedState( - getStore().getState() -); - function getStore() { const extras = {}; const enhancer = applyMiddleware(thunk.withExtraArgument(extras)); diff --git a/js/store.ts b/js/store.ts index ad6912da..6eef1a5b 100644 --- a/js/store.ts +++ b/js/store.ts @@ -7,14 +7,7 @@ import { merge } from "./utils"; import { UPDATE_TIME_ELAPSED, STEP_MARQUEE } from "./actionTypes"; import Media from "./media"; import Emitter from "./emitter"; -import { - Extras, - MiddlewareStore, - Dispatch, - Action, - AppState, - Middleware, -} from "./types"; +import { Extras, Dispatch, Action, AppState, Middleware } from "./types"; const compose = composeWithDevTools({ actionsBlacklist: [UPDATE_TIME_ELAPSED, STEP_MARQUEE], @@ -35,10 +28,7 @@ export default function( ); } - // eslint-disable-next-line no-unused-vars - const emitterMiddleware = (store: MiddlewareStore) => (next: Dispatch) => ( - action: Action - ) => { + const emitterMiddleware = () => (next: Dispatch) => (action: Action) => { actionEmitter.trigger(action.type, action); return next(action); };