diff --git a/config/jest.integration.js b/config/jest.integration.js index 50c2a146..719f1d02 100644 --- a/config/jest.integration.js +++ b/config/jest.integration.js @@ -2,5 +2,5 @@ module.exports = { displayName: "integration-test", rootDir: "../", preset: "jest-puppeteer", - testRegex: "\\.integration-test\\.js$" + testRegex: "\\.integration-test\\.js$", }; diff --git a/config/jest.unit.js b/config/jest.unit.js index c61ec89d..1b7da3c4 100644 --- a/config/jest.unit.js +++ b/config/jest.unit.js @@ -3,15 +3,15 @@ module.exports = { rootDir: "../", testRegex: "\\.test\\.(js|ts|tsx)$", globals: { - SENTRY_DSN: null + SENTRY_DSN: null, }, moduleFileExtensions: ["js", "tsx", "ts"], moduleNameMapper: { "\\.css$": "/js/__mocks__/styleMock.js", "\\.wsz$": "/js/__mocks__/fileMock.js", - "\\.mp3$": "/js/__mocks__/fileMock.js" + "\\.mp3$": "/js/__mocks__/fileMock.js", }, transform: { - "^.+\\.(js|ts|tsx)$": "babel-jest" - } + "^.+\\.(js|ts|tsx)$": "babel-jest", + }, }; diff --git a/config/webpack.library.js b/config/webpack.library.js index 4c3ff7b3..f49c93cc 100644 --- a/config/webpack.library.js +++ b/config/webpack.library.js @@ -6,7 +6,7 @@ module.exports = { devtool: "source-map", mode: "production", resolve: { - extensions: [".js", ".ts", ".tsx"] + extensions: [".js", ".ts", ".tsx"], }, module: { rules: [ @@ -21,11 +21,11 @@ module.exports = { options: { plugins: [ require("cssnano"), - require("../scripts/postcss-optimize-data-uri-pngs") - ] - } - } - ] + require("../scripts/postcss-optimize-data-uri-pngs"), + ], + }, + }, + ], }, { test: /\.(js|ts|tsx)$/, @@ -33,36 +33,36 @@ module.exports = { use: { loader: "babel-loader", options: { - envName: "library" - } - } - } + envName: "library", + }, + }, + }, ], - noParse: [/jszip\.js$/] + noParse: [/jszip\.js$/], }, plugins: [ new BundleAnalyzerPlugin({ analyzerMode: "static", reportFilename: "library-report.html", - openAnalyzer: false + openAnalyzer: false, }), // Also generate non-minified bundles. - new UnminifiedWebpackPlugin() + new UnminifiedWebpackPlugin(), ], performance: { // We do some crazy shit okay! Don't judge! maxEntrypointSize: 9000000, - maxAssetSize: 9000000 + maxAssetSize: 9000000, }, entry: { "bundle.min": "./js/webamp.js", - "lazy-bundle.min": "./js/webampLazy.tsx" + "lazy-bundle.min": "./js/webampLazy.tsx", }, output: { path: path.resolve(__dirname, "../built"), filename: "webamp.[name].js", library: "Webamp", libraryTarget: "umd", - libraryExport: "default" - } + libraryExport: "default", + }, }; diff --git a/demo/config/webpack.common.js b/demo/config/webpack.common.js index edada5a1..75a7dddb 100644 --- a/demo/config/webpack.common.js +++ b/demo/config/webpack.common.js @@ -5,7 +5,7 @@ const HtmlWebpackInlineSVGPlugin = require("html-webpack-inline-svg-plugin"); module.exports = { resolve: { - extensions: [".js", ".ts", ".tsx"] + extensions: [".js", ".ts", ".tsx"], }, module: { rules: [ @@ -20,11 +20,11 @@ module.exports = { options: { plugins: [ require("cssnano"), - require("../../scripts/postcss-optimize-data-uri-pngs") - ] - } - } - ] + require("../../scripts/postcss-optimize-data-uri-pngs"), + ], + }, + }, + ], }, { test: /\.(js|ts|tsx)?$/, @@ -32,9 +32,9 @@ module.exports = { use: { loader: "babel-loader", options: { - envName: "production" - } - } + envName: "production", + }, + }, }, { test: /\.(wsz|mp3|png|ico|jpg|svg)$/, @@ -43,17 +43,17 @@ module.exports = { loader: "file-loader", options: { emitFile: true, - name: "[path][name]-[hash].[ext]" - } - } - ] - } + name: "[path][name]-[hash].[ext]", + }, + }, + ], + }, ], - noParse: [/jszip\.js$/] + noParse: [/jszip\.js$/], }, plugins: [ new HtmlWebpackPlugin({ - template: "./index.html" + template: "./index.html", }), // Automatically generates the manifest.json file inside the built // directory, and injects a tag into the gererated index.html file @@ -71,35 +71,38 @@ module.exports = { { src: path.resolve("./demo/images/manifest/icon-192x192.png"), sizes: "192x192", - type: "image/png" + type: "image/png", }, { src: path.resolve("./demo/images/manifest/icon-512x512.png"), sizes: "512x512", - type: "image/png" + type: "image/png", }, { src: path.resolve("./demo/images/manifest/icon.svg"), sizes: "513x513", - type: "image/svg+xml" - } - ].map(icon => ({ ...icon, destination: path.join("images", "manifest") })) + type: "image/svg+xml", + }, + ].map(icon => ({ + ...icon, + destination: path.join("images", "manifest"), + })), }), - new HtmlWebpackInlineSVGPlugin({ runPreEmit: true }) + new HtmlWebpackInlineSVGPlugin({ runPreEmit: true }), ], performance: { // We do some crazy shit okay! Don't judge! maxEntrypointSize: 7000000, - maxAssetSize: 7000000 + maxAssetSize: 7000000, }, entry: { - webamp: ["./js/index.js"] + webamp: ["./js/index.js"], }, context: path.resolve(__dirname, "../"), output: { filename: "[name]-[hash].js", chunkFilename: "[name]-[hash].js", publicPath: "/", - path: path.resolve(__dirname, "../built") - } + path: path.resolve(__dirname, "../built"), + }, }; diff --git a/demo/config/webpack.dev.js b/demo/config/webpack.dev.js index 3c749788..ccdece6a 100644 --- a/demo/config/webpack.dev.js +++ b/demo/config/webpack.dev.js @@ -10,14 +10,14 @@ module.exports = merge(common, { new webpack.DefinePlugin({ SENTRY_DSN: JSON.stringify( "https://c8c64ef822f54240901bc64f88c234d8@sentry.io/146022" - ) + ), }), new CopyWebpackPlugin([ { from: "./js/dev-service-worker.js", to: "service-worker.js", - force: true - } - ]) - ] + force: true, + }, + ]), + ], }); diff --git a/demo/config/webpack.prod.js b/demo/config/webpack.prod.js index 08ace5c2..bc722d32 100644 --- a/demo/config/webpack.prod.js +++ b/demo/config/webpack.prod.js @@ -15,13 +15,13 @@ const config = merge(common, { new BundleAnalyzerPlugin({ analyzerMode: "static", reportFilename: "prod-report.html", - openAnalyzer: false + openAnalyzer: false, }), new webpack.DefinePlugin({ SENTRY_DSN: JSON.stringify( "https://12b6be8ef7c44f28ac37ab5ed98fd294@sentry.io/146021" ), - COMMITHASH: JSON.stringify(gitRevisionPlugin.commithash()) + COMMITHASH: JSON.stringify(gitRevisionPlugin.commithash()), }), new workboxPlugin.GenerateSW({ swDest: "service-worker.js", @@ -30,9 +30,9 @@ const config = merge(common, { skipWaiting: true, // Safari (mobile and desktop) seems to have CORs issues when loading // .mp3s from service workers. - exclude: [/\.mp3/, /\.wsz/] - }) - ] + exclude: [/\.mp3/, /\.wsz/], + }), + ], }); config.entry.webamp.unshift("./js/googleAnalytics.min.js"); diff --git a/demo/js/avaliableSkins.ts b/demo/js/avaliableSkins.ts index 49d02afe..3b2bbeca 100644 --- a/demo/js/avaliableSkins.ts +++ b/demo/js/avaliableSkins.ts @@ -20,5 +20,5 @@ export default [ { url: topaz, name: "TopazAmp" }, { url: visor, name: "Vizor" }, { url: xmms, name: "XMMS Turquoise " }, - { url: zaxon, name: "Zaxon Remake" } + { url: zaxon, name: "Zaxon Remake" }, ]; diff --git a/demo/js/butterchurnOptions.ts b/demo/js/butterchurnOptions.ts index da356927..ac10e999 100644 --- a/demo/js/butterchurnOptions.ts +++ b/demo/js/butterchurnOptions.ts @@ -4,7 +4,7 @@ const KNOWN_PRESET_URLS_REGEXES = [ /^https:\/\/unpkg\.com\/butterchurn-presets\/.*\.json$/, /^https:\/\/unpkg\.com\/butterchurn-presets-weekly\/.*\.json$/, /^https:\/\/archive\.org\/cors\/md_.*\.json$/, - /^https:\/\/s3-us-east-2\.amazonaws\.com\/butterchurn-presets\/.*\.json$/ + /^https:\/\/s3-us-east-2\.amazonaws\.com\/butterchurn-presets\/.*\.json$/, ]; function presetNameFromURL(url: string) { @@ -77,8 +77,8 @@ export function getButterchurnOptions( return [ { name: presetNameFromURL(butterchurnPresetUrlParam), - butterchurnPresetUrl: butterchurnPresetUrlParam - } + butterchurnPresetUrl: butterchurnPresetUrlParam, + }, ]; } } else if (milkdropPresetUrl) { @@ -90,6 +90,6 @@ export function getButterchurnOptions( "https://unpkg.com/butterchurn-presets-weekly@0.0.2/weeks/week1/presets.json" ); }, - butterchurnOpen: !startWithMilkdropHidden + butterchurnOpen: !startWithMilkdropHidden, }; } diff --git a/demo/js/config.ts b/demo/js/config.ts index 23446ea4..738e5b65 100644 --- a/demo/js/config.ts +++ b/demo/js/config.ts @@ -35,7 +35,7 @@ export const initialTracks = config.initialTracks || [ { metaData: { artist: "DJ Mike Llama", title: "Llama Whippin' Intro" }, url: llamaAudio, - duration: 5.322286 + duration: 5.322286, }, { url: @@ -44,8 +44,8 @@ export const initialTracks = config.initialTracks || [ metaData: { title: "Heroines", artist: "Diablo Swing Orchestra", - album - } + album, + }, }, { url: @@ -54,8 +54,8 @@ export const initialTracks = config.initialTracks || [ metaData: { title: "We Are Going To Eclecfunk Your Ass", artist: "Eclectek", - album - } + album, + }, }, { url: @@ -64,8 +64,8 @@ export const initialTracks = config.initialTracks || [ metaData: { title: "Seventeen", artist: "Auto-Pilot", - album - } + album, + }, }, { url: @@ -74,8 +74,8 @@ export const initialTracks = config.initialTracks || [ metaData: { title: "Microphone", artist: "Muha", - album - } + album, + }, }, { url: @@ -84,8 +84,8 @@ export const initialTracks = config.initialTracks || [ metaData: { title: "Stumble", artist: "Just Plain Ant", - album - } + album, + }, }, { url: @@ -94,8 +94,8 @@ export const initialTracks = config.initialTracks || [ metaData: { title: "God Damn", artist: "Sleaze", - album - } + album, + }, }, { url: @@ -104,8 +104,8 @@ export const initialTracks = config.initialTracks || [ metaData: { title: "Hola Hola Bossa Nova", artist: "Juanitos", - album - } + album, + }, }, { url: @@ -114,8 +114,8 @@ export const initialTracks = config.initialTracks || [ metaData: { title: "Resolutions (Chris Summer Remix)", artist: "Entertainment for the Braindead", - album - } + album, + }, }, { url: @@ -124,8 +124,8 @@ export const initialTracks = config.initialTracks || [ metaData: { title: "Trail", artist: "Nobara Hayakawa", - album - } + album, + }, }, { url: @@ -134,8 +134,8 @@ export const initialTracks = config.initialTracks || [ metaData: { title: "Tongue Tied", artist: "Paper Navy", - album - } + album, + }, }, { url: @@ -144,8 +144,8 @@ export const initialTracks = config.initialTracks || [ metaData: { title: "Garage", artist: "60 Tigres", - album - } + album, + }, }, { url: @@ -154,9 +154,9 @@ export const initialTracks = config.initialTracks || [ metaData: { title: "The Cycle (Featuring Mista Mista)", artist: "CM aka Creative", - album - } - } + album, + }, + }, ]; export const disableMarquee = config.disableMarquee || false; diff --git a/demo/js/dropboxFilePicker.ts b/demo/js/dropboxFilePicker.ts index 096d1b0f..eb9d066e 100644 --- a/demo/js/dropboxFilePicker.ts +++ b/demo/js/dropboxFilePicker.ts @@ -19,7 +19,7 @@ function genAudioFileUrlsFromDropbox(): Promise { linkType: "direct", folderselect: false, multiselect: true, - extensions: ["video", "audio"] + extensions: ["video", "audio"], }); }); } @@ -33,10 +33,10 @@ const dropboxFilePicker: FilePicker = { const files = await genAudioFileUrlsFromDropbox(); return files.map(file => ({ url: file.link, - defaultName: file.name + defaultName: file.name, })); }, - requiresNetwork: true + requiresNetwork: true, }; export default dropboxFilePicker; diff --git a/demo/js/index.js b/demo/js/index.js index 0680d16d..1a60c8dd 100644 --- a/demo/js/index.js +++ b/demo/js/index.js @@ -21,7 +21,7 @@ import { TOGGLE_REPEAT, TOGGLE_SHUFFLE, SET_EQ_AUTO, - SET_DUMMY_VIZ_DATA + SET_DUMMY_VIZ_DATA, } from "../../js/actionTypes"; import { loadFilesFromReferences } from "../../js/actionCreators"; @@ -34,7 +34,7 @@ import { skinUrl as configSkinUrl, initialTracks, initialState, - disableMarquee + disableMarquee, } from "./config"; import WebampIcon from "./WebampIcon"; import enableMediaSession from "./mediaSession"; @@ -48,7 +48,7 @@ const NOISY_ACTION_TYPES = new Set([ UPDATE_WINDOW_POSITIONS, SET_VOLUME, SET_BALANCE, - SET_BAND_VALUE + SET_BAND_VALUE, ]); const MIN_MILKDROP_WIDTH = 725; @@ -96,12 +96,12 @@ function filterBreadcrumbActions(action) { Raven.config(SENTRY_DSN, { /* global COMMITHASH */ - release: typeof COMMITHASH !== "undefined" ? COMMITHASH : "DEV" + release: typeof COMMITHASH !== "undefined" ? COMMITHASH : "DEV", }).install(); const ravenMiddleware = createMiddleware(Raven, { filterBreadcrumbActions, - stateTransformer: Selectors.getDebugData + stateTransformer: Selectors.getDebugData, }); // Don't prompt user to install Webamp. It's probably not @@ -138,12 +138,12 @@ Raven.context(async () => { [WINDOWS.MAIN]: { position: { x: 0, y: 0 } }, [WINDOWS.EQUALIZER]: { position: { x: 0, y: 116 } }, [WINDOWS.PLAYLIST]: { position: { x: 0, y: 232 }, size: [0, 0] }, - [WINDOWS.MILKDROP]: { position: { x: 0, y: 348 }, size: [0, 0] } + [WINDOWS.MILKDROP]: { position: { x: 0, y: 348 }, size: [0, 0] }, }; if (library) { __initialWindowLayout[WINDOWS.MEDIA_LIBRARY] = { position: { x: 0, y: 348 }, - size: [0, 0] + size: [0, 0], }; } } else { @@ -151,12 +151,12 @@ Raven.context(async () => { [WINDOWS.MAIN]: { position: { x: 0, y: 0 } }, [WINDOWS.EQUALIZER]: { position: { x: 0, y: 116 } }, [WINDOWS.PLAYLIST]: { position: { x: 0, y: 232 }, size: [0, 4] }, - [WINDOWS.MILKDROP]: { position: { x: 275, y: 0 }, size: [7, 12] } + [WINDOWS.MILKDROP]: { position: { x: 275, y: 0 }, size: [7, 12] }, }; if (library) { __initialWindowLayout[WINDOWS.MEDIA_LIBRARY] = { position: { x: 275, y: 0 }, - size: [7, 12] + size: [7, 12], }; } } @@ -180,7 +180,7 @@ Raven.context(async () => { __initialWindowLayout, __initialState: screenshot ? screenshotInitialState : initialState, __butterchurnOptions, - __customMiddlewares: [ravenMiddleware] + __customMiddlewares: [ravenMiddleware], }); if (disableMarquee || screenshot) { @@ -209,8 +209,8 @@ Raven.context(async () => { 96: 4.8125, 104: 4.375, 112: 3.625, - 120: 1.5625 - } + 120: 1.5625, + }, }); } diff --git a/demo/js/mediaSession.ts b/demo/js/mediaSession.ts index 1f3b4c46..40aff323 100644 --- a/demo/js/mediaSession.ts +++ b/demo/js/mediaSession.ts @@ -9,7 +9,7 @@ export default function enableMediaSession(webamp: WebampLazy) { return; } const { - metaData: { title, artist, album, albumArtUrl } + metaData: { title, artist, album, albumArtUrl }, } = track; // @ts-ignore TypeScript does not know about the Media Session API: https://github.com/Microsoft/TypeScript/issues/19473 navigator.mediaSession.metadata = new MediaMetadata({ @@ -19,13 +19,13 @@ export default function enableMediaSession(webamp: WebampLazy) { artwork: albumArtUrl ? [ { - src: albumArtUrl + src: albumArtUrl, // We don't currently know these. // sizes: "96x96", // type: "image/png" - } + }, ] - : [] + : [], }); }); diff --git a/demo/js/screenshotInitialState.ts b/demo/js/screenshotInitialState.ts index 54cc3b39..8fe3feaf 100644 --- a/demo/js/screenshotInitialState.ts +++ b/demo/js/screenshotInitialState.ts @@ -10,7 +10,7 @@ const defaultTracksState = { url: "", kbps: "128", khz: "44", - channels: 2 + channels: 2, }, "1": { id: 1, @@ -20,7 +20,7 @@ const defaultTracksState = { url: "", kbps: "128", khz: "44", - channels: 2 + channels: 2, }, "2": { id: 2, @@ -30,7 +30,7 @@ const defaultTracksState = { url: "", kbps: "128", khz: "44", - channels: 2 + channels: 2, }, "3": { id: 3, @@ -40,8 +40,8 @@ const defaultTracksState = { url: "", kbps: "128", khz: "44", - channels: 2 - } + channels: 2, + }, }; const initialState: DeepPartial = { @@ -57,22 +57,22 @@ const initialState: DeepPartial = { "12000": 19, "14000": 34, "16000": 75, - preamp: 56 - } + preamp: 56, + }, }, media: { status: "PLAYING", - timeElapsed: 3 + timeElapsed: 3, }, playlist: { trackOrder: [0, 1, 2, 3], currentTrack: 0, - selectedTracks: new Set([2]) + selectedTracks: new Set([2]), }, tracks: defaultTracksState, display: { - working: false - } + working: false, + }, }; export default initialState; diff --git a/examples/webpack/index.js b/examples/webpack/index.js index 0aa00a27..32e8a7f5 100644 --- a/examples/webpack/index.js +++ b/examples/webpack/index.js @@ -5,11 +5,11 @@ new Webamp({ { metaData: { artist: "DJ Mike Llama", - title: "Llama Whippin' Intro" + title: "Llama Whippin' Intro", }, url: "https://cdn.jsdelivr.net/gh/captbaritone/webamp@43434d82cfe0e37286dbbe0666072dc3190a83bc/mp3/llama-2.91.mp3", - duration: 5.322286 - } - ] + duration: 5.322286, + }, + ], }).renderWhenReady(document.getElementById("app")); diff --git a/experiments/skinArchiveTools/lib/collectSkins.js b/experiments/skinArchiveTools/lib/collectSkins.js index f5cb7f2f..a34149e0 100644 --- a/experiments/skinArchiveTools/lib/collectSkins.js +++ b/experiments/skinArchiveTools/lib/collectSkins.js @@ -49,7 +49,7 @@ module.exports = async function collectSkins({ inputDir, cache }) { } else { cache[md5] = { md5, - filePaths: [filePath] + filePaths: [filePath], }; } }, diff --git a/experiments/skinArchiveTools/lib/constants.js b/experiments/skinArchiveTools/lib/constants.js index d45c2b21..366806f3 100644 --- a/experiments/skinArchiveTools/lib/constants.js +++ b/experiments/skinArchiveTools/lib/constants.js @@ -2,7 +2,7 @@ const FILE_TYPES = { INVALID: "INVALID", CLASSIC: "CLASSIC", MODERN: "MODERN", - PACK: "PACK" + PACK: "PACK", }; module.exports = { FILE_TYPES }; diff --git a/experiments/skinArchiveTools/lib/index.js b/experiments/skinArchiveTools/lib/index.js index 3da90649..453e7f8d 100755 --- a/experiments/skinArchiveTools/lib/index.js +++ b/experiments/skinArchiveTools/lib/index.js @@ -20,7 +20,7 @@ const [ // eslint-disable-next-line @typescript-eslint/no-unused-vars _thisFile, rawInputDir, - rawOutputDir + rawOutputDir, ] = process.argv; const inputDir = path.resolve(rawInputDir); @@ -182,7 +182,7 @@ async function main() { `${skin.md5}.png` ); await shooter.takeScreenshot(getPath(skin), screenshotPath, { - minify: true + minify: true, }); skin.screenshotPath = screenshotPath; i++; diff --git a/experiments/skinArchiveTools/lib/shooter.js b/experiments/skinArchiveTools/lib/shooter.js index 4d463f02..14bcea35 100644 --- a/experiments/skinArchiveTools/lib/shooter.js +++ b/experiments/skinArchiveTools/lib/shooter.js @@ -5,7 +5,7 @@ const imageminOptipng = require("imagemin-optipng"); function min(imgPath) { return imagemin([imgPath], path.dirname(imgPath), { - use: [imageminOptipng()] + use: [imageminOptipng()], }); } @@ -61,7 +61,7 @@ class Shooter { path: screenshotPath, omitBackground: true, // Make screenshot transparent // https://github.com/GoogleChrome/puppeteer/issues/703#issuecomment-366041479 - clip: { x: 0, y: 0, width: 275, height: 116 * 3 } + clip: { x: 0, y: 0, width: 275, height: 116 * 3 }, }); console.log("Wrote screenshot to", screenshotPath); if (minify) { diff --git a/experiments/skinArchiveTools/lib/takeScreenshots.js b/experiments/skinArchiveTools/lib/takeScreenshots.js index 096b7438..b87f5045 100644 --- a/experiments/skinArchiveTools/lib/takeScreenshots.js +++ b/experiments/skinArchiveTools/lib/takeScreenshots.js @@ -26,7 +26,7 @@ module.exports = async function takeScreenshots(skinDir, screenshotDir) { continue; } await shooter.takeScreenshot(filePath, screenshotPath, { - minify: true + minify: true, }); shotCount++; } diff --git a/experiments/skinArchiveTools/lib/utils.js b/experiments/skinArchiveTools/lib/utils.js index cb7dff61..74c55ac0 100644 --- a/experiments/skinArchiveTools/lib/utils.js +++ b/experiments/skinArchiveTools/lib/utils.js @@ -76,7 +76,7 @@ function archive(skin, itemName) { screenshotPath, `${filename}.wsz`, getArchiveTitle(skin), - itemName + itemName, ], (err, stdout) => { if (err) { @@ -117,5 +117,5 @@ module.exports = { md5File, archive, getArchiveItemName, - getArchiveTitle + getArchiveTitle, }; diff --git a/jest-puppeteer.config.js b/jest-puppeteer.config.js index 5c145697..dda99d69 100644 --- a/jest-puppeteer.config.js +++ b/jest-puppeteer.config.js @@ -3,6 +3,6 @@ module.exports = { // Note: We require the the build be run before these tests. // TODO: Figure out how to get this command to run the buil. command: "npm run serve", - port: 8080 // Jest Puppeteer will wait 5000ms for this port to come online. - } + port: 8080, // Jest Puppeteer will wait 5000ms for this port to come online. + }, }; diff --git a/js/actionCreators/equalizer.ts b/js/actionCreators/equalizer.ts index 59a2eb76..9d769730 100644 --- a/js/actionCreators/equalizer.ts +++ b/js/actionCreators/equalizer.ts @@ -4,7 +4,7 @@ import { SET_EQ_ON, SET_EQ_OFF, SET_BAND_VALUE, - SET_EQ_AUTO + SET_EQ_AUTO, } from "../actionTypes"; import { Band, Dispatchable } from "../types"; @@ -31,7 +31,7 @@ function _setEqTo(value: number): Dispatchable { dispatch({ type: SET_BAND_VALUE, value, - band: band + band: band, }); }); }; diff --git a/js/actionCreators/files.ts b/js/actionCreators/files.ts index 1e7d9502..d6c19b15 100644 --- a/js/actionCreators/files.ts +++ b/js/actionCreators/files.ts @@ -7,14 +7,14 @@ import { promptForFileReferences, genArrayBufferFromFileReference, genMediaDuration, - genMediaTags + genMediaTags, } from "../fileUtils"; import skinParser from "../skinParser"; import { getTracks, getTrackIsVisibleFunction, getEqfData, - getPlaylistURL + getPlaylistURL, } from "../selectors"; import { @@ -27,7 +27,7 @@ import { MEDIA_TAG_REQUEST_FAILED, SET_SKIN_DATA, LOADED, - LOADING + LOADING, } from "../actionTypes"; import LoadQueue from "../loadQueue"; @@ -50,7 +50,7 @@ export function addTracksFromReferences( ): Dispatchable { const tracks: Track[] = Array.from(fileReferences).map(file => ({ blob: file, - defaultName: file.name + defaultName: file.name, })); return loadMediaFiles(tracks, loadStyle, atIndex); } @@ -109,8 +109,8 @@ export function setSkinFromArrayBuffer( skinCursors: skinData.cursors, skinRegion: skinData.region, skinGenLetterWidths: skinData.genLetterWidths, - skinGenExColors: skinData.genExColors - } + skinGenExColors: skinData.genExColors, + }, }); } catch (e) { console.error(e); @@ -253,7 +253,7 @@ export function loadMediaFile( duration: track.duration, defaultName, id, - atIndex + atIndex, }); switch (priority) { case LOAD_STYLE.BUFFER: @@ -286,7 +286,7 @@ export function loadMediaFile( sampleRate: 44000, bitrate: 192000, numberOfChannels: 2, - id + id, }); } else if ("blob" in track) { // Blobs can be loaded quickly @@ -336,7 +336,7 @@ export function fetchMediaTags(file: string | Blob, id: number): Dispatchable { numberOfChannels, bitrate, sampleRate, - id + id, }); } catch (e) { dispatch({ type: MEDIA_TAG_REQUEST_FAILED, id }); diff --git a/js/actionCreators/index.test.js b/js/actionCreators/index.test.js index 0270f464..1f4ead1b 100644 --- a/js/actionCreators/index.test.js +++ b/js/actionCreators/index.test.js @@ -6,7 +6,7 @@ import { SET_BALANCE, TOGGLE_REPEAT, TOGGLE_SHUFFLE, - SET_BAND_VALUE + SET_BAND_VALUE, } from "../actionTypes"; import { @@ -19,7 +19,7 @@ import { setEqBand, setEqToMax, setEqToMin, - setEqToMid + setEqToMid, } from "./"; test("stop", () => { @@ -31,14 +31,14 @@ describe("setVolume", () => { it("enforces a mimimum value", () => { const expectedAction = { type: SET_VOLUME, - volume: 0 + volume: 0, }; expect(setVolume(-10)).toEqual(expectedAction); }); it("enforces a maximum value", () => { const expectedAction = { type: SET_VOLUME, - volume: 100 + volume: 100, }; expect(setVolume(110)).toEqual(expectedAction); }); @@ -48,28 +48,28 @@ describe("setBalance", () => { it("enforces a mimimum value", () => { const expectedAction = { type: SET_BALANCE, - balance: -100 + balance: -100, }; expect(setBalance(-110)).toEqual(expectedAction); }); it("enforces a maximum value", () => { const expectedAction = { type: SET_BALANCE, - balance: 100 + balance: 100, }; expect(setBalance(110)).toEqual(expectedAction); }); it("snaps to zero for positive values close to zero", () => { const expectedAction = { type: SET_BALANCE, - balance: 0 + balance: 0, }; expect(setBalance(24)).toEqual(expectedAction); }); it("snaps to zero for negative values close to zero", () => { const expectedAction = { type: SET_BALANCE, - balance: 0 + balance: 0, }; expect(setBalance(-24)).toEqual(expectedAction); }); @@ -100,7 +100,7 @@ test("setEqToMax", () => { const dispatcher = setEqToMax(); dispatcher(mockDispatch); const expectedCalls = BANDS.map(band => [ - { type: SET_BAND_VALUE, band, value: 100 } + { type: SET_BAND_VALUE, band, value: 100 }, ]); expect(mockDispatch.mock.calls).toEqual(expectedCalls); }); @@ -110,7 +110,7 @@ test("setEqToMin", () => { const dispatcher = setEqToMin(); dispatcher(mockDispatch); const expectedCalls = BANDS.map(band => [ - { type: SET_BAND_VALUE, band, value: 0 } + { type: SET_BAND_VALUE, band, value: 0 }, ]); expect(mockDispatch.mock.calls).toEqual(expectedCalls); }); @@ -120,7 +120,7 @@ test("setEqToMid", () => { const dispatcher = setEqToMid(); dispatcher(mockDispatch); const expectedCalls = BANDS.map(band => [ - { type: SET_BAND_VALUE, band, value: 50 } + { type: SET_BAND_VALUE, band, value: 50 }, ]); expect(mockDispatch.mock.calls).toEqual(expectedCalls); }); diff --git a/js/actionCreators/index.ts b/js/actionCreators/index.ts index 21a3bdee..a0b2b96d 100644 --- a/js/actionCreators/index.ts +++ b/js/actionCreators/index.ts @@ -10,7 +10,7 @@ import { LOAD_SERIALIZED_STATE, LOAD_DEFAULT_SKIN, SET_MILKDROP_DESKTOP, - SET_MILKDROP_FULLSCREEN + SET_MILKDROP_FULLSCREEN, } from "../actionTypes"; import { WINDOWS } from "../constants"; import { Dispatchable } from "../types"; @@ -36,7 +36,7 @@ export { ensureWindowsAreOnScreen, stackWindows, toggleLlamaMode, - setFocusedWindow + setFocusedWindow, } from "./windows"; export { play, @@ -53,7 +53,7 @@ export { setBalance, toggleRepeat, toggleShuffle, - toggleTimeMode + toggleTimeMode, } from "./media"; export { setEqBand, @@ -62,7 +62,7 @@ export { setEqToMin, setPreamp, toggleEq, - toggleEqAuto + toggleEqAuto, } from "./equalizer"; export { addTracksFromReferences, @@ -81,7 +81,7 @@ export { setEqFromFileReference, downloadPreset, setEqFromObject, - downloadHtmlPlaylist + downloadHtmlPlaylist, } from "./files"; export { cropPlaylist, @@ -95,7 +95,7 @@ export { scrollPlaylistByDelta, scrollUpFourTracks, scrollDownFourTracks, - dragSelected + dragSelected, } from "./playlist"; export { initializePresets, @@ -109,7 +109,7 @@ export { loadPresets, toggleRandomizePresets, togglePresetCycling, - scheduleMilkdropMessage + scheduleMilkdropMessage, } from "./milkdrop"; export function close(): Dispatchable { diff --git a/js/actionCreators/media.ts b/js/actionCreators/media.ts index 8a6461c3..203eb529 100644 --- a/js/actionCreators/media.ts +++ b/js/actionCreators/media.ts @@ -9,7 +9,7 @@ import { PLAY, PAUSE, PLAY_TRACK, - TOGGLE_TIME_MODE + TOGGLE_TIME_MODE, } from "../actionTypes"; import { MEDIA_STATUS } from "../constants"; @@ -20,7 +20,7 @@ import * as Selectors from "../selectors"; function playRandomTrack(): Dispatchable { return (dispatch: Dispatch, getState: GetState) => { const { - playlist: { trackOrder, currentTrack } + playlist: { trackOrder, currentTrack }, } = getState(); if (trackOrder.length === 0) { return; @@ -99,7 +99,7 @@ export function seekForward(seconds: number): Dispatchable { const newTimeElapsed = timeElapsed + seconds; dispatch({ type: SEEK_TO_PERCENT_COMPLETE, - percent: (newTimeElapsed / duration) * 100 + percent: (newTimeElapsed / duration) * 100, }); }; } @@ -111,7 +111,7 @@ export function seekBackward(seconds: number): Dispatchable { export function setVolume(volume: number): Dispatchable { return { type: SET_VOLUME, - volume: clamp(volume, 0, 100) + volume: clamp(volume, 0, 100), }; } @@ -141,7 +141,7 @@ export function setBalance(balance: number): Dispatchable { } return { type: SET_BALANCE, - balance + balance, }; } diff --git a/js/actionCreators/milkdrop.ts b/js/actionCreators/milkdrop.ts index ce09edbf..74f04d67 100644 --- a/js/actionCreators/milkdrop.ts +++ b/js/actionCreators/milkdrop.ts @@ -7,7 +7,7 @@ import { PRESET_REQUESTED, TOGGLE_RANDOMIZE_PRESETS, TOGGLE_PRESET_CYCLING, - SCHEDULE_MILKDROP_MESSAGE + SCHEDULE_MILKDROP_MESSAGE, } from "../actionTypes"; import * as Selectors from "../selectors"; import { @@ -15,7 +15,7 @@ import { TransitionType, Preset, ButterchurnOptions, - StatePreset + StatePreset, } from "../types"; import * as FileUtils from "../fileUtils"; @@ -25,13 +25,13 @@ function normalizePresetTypes(preset: Preset): StatePreset { return { type: "RESOLVED", name, - preset: preset.butterchurnPresetObject + preset: preset.butterchurnPresetObject, }; } else if ("getButterchrunPresetObject" in preset) { return { type: "UNRESOLVED", name, - getPreset: preset.getButterchrunPresetObject + getPreset: preset.getButterchrunPresetObject, }; } else if ("butterchurnPresetUrl" in preset) { return { @@ -40,7 +40,7 @@ function normalizePresetTypes(preset: Preset): StatePreset { getPreset: async () => { const resp = await fetch(preset.butterchurnPresetUrl); return resp.json(); - } + }, }; } throw new Error("Invalid preset object"); @@ -90,7 +90,7 @@ export function appendPresetFileList(fileList: FileList): Dispatchable { return { type: "UNRESOLVED", name: file.name.slice(0, file.name.length - MILK_EXT.length), - getPreset: () => convertPreset(file) + getPreset: () => convertPreset(file), } as StatePreset; } else if (filename.endsWith(JSON_EXT)) { return { @@ -100,7 +100,7 @@ export function appendPresetFileList(fileList: FileList): Dispatchable { const str = await FileUtils.genStringFromFileReference(file); // TODO: How should we handle the case where json parsing fails? return JSON.parse(str); - } + }, } as StatePreset; } console.error("Invalid type preset when loading directory"); diff --git a/js/actionCreators/playlist.ts b/js/actionCreators/playlist.ts index b48c724e..c969c6ee 100644 --- a/js/actionCreators/playlist.ts +++ b/js/actionCreators/playlist.ts @@ -10,7 +10,7 @@ import { RANDOMIZE_LIST, SET_TRACK_ORDER, SET_PLAYLIST_SCROLL_POSITION, - DRAG_SELECTED + DRAG_SELECTED, } from "../actionTypes"; import { Dispatchable } from "../types"; @@ -22,13 +22,13 @@ export function cropPlaylist(): Dispatchable { } const selectedTrackIds = Selectors.getSelectedTrackIds(state); const { - playlist: { trackOrder } + playlist: { trackOrder }, } = state; dispatch({ type: REMOVE_TRACKS, // @ts-ignore The keys are numbers, but TypeScript does not trust us. // https://github.com/Microsoft/TypeScript/pull/12253#issuecomment-263132208 - ids: trackOrder.filter(id => !selectedTrackIds.has(id)) + ids: trackOrder.filter(id => !selectedTrackIds.has(id)), }); }; } @@ -39,7 +39,7 @@ export function removeSelectedTracks(): Dispatchable { type: REMOVE_TRACKS, // @ts-ignore The keys are numbers, but TypeScript does not trust us. // https://github.com/Microsoft/TypeScript/pull/12253#issuecomment-263132208 - ids: Array.from(Selectors.getSelectedTrackIds(getState())) + ids: Array.from(Selectors.getSelectedTrackIds(getState())), }); }; } @@ -83,7 +83,7 @@ export function scrollNTracks(n: number): Dispatchable { const position = overflow ? clamp((currentOffset + n) / overflow, 0, 1) : 0; return dispatch({ type: SET_PLAYLIST_SCROLL_POSITION, - position: position * 100 + position: position * 100, }); }; } @@ -105,7 +105,7 @@ export function scrollPlaylistByDelta( state.display.playlistScrollPosition + percentDelta, 0, 100 - ) + ), }); }; } diff --git a/js/actionCreators/windows.ts b/js/actionCreators/windows.ts index 7380b606..cfaaa87d 100644 --- a/js/actionCreators/windows.ts +++ b/js/actionCreators/windows.ts @@ -12,7 +12,7 @@ import { BROWSER_WINDOW_SIZE_CHANGED, RESET_WINDOW_SIZES, TOGGLE_LLAMA_MODE, - SET_FOCUSED_WINDOW + SET_FOCUSED_WINDOW, } from "../actionTypes"; import { getPositionDiff, SizeDiff } from "../resizeUtils"; @@ -22,7 +22,7 @@ import { Dispatchable, WindowId, WindowPositions, - Dispatch + Dispatch, } from "../types"; // Dispatch an action and, if needed rearrange the windows to preserve @@ -46,7 +46,7 @@ function withWindowGraphIntegrity(action: Action): Dispatchable { const current = newSizes[window]; sizeDiff[window] = { height: current.height - original.height, - width: current.width - original.width + width: current.width - original.width, }; } @@ -72,21 +72,21 @@ export function toggleLlamaMode(): Dispatchable { export function toggleEqualizerShadeMode(): Dispatchable { return withWindowGraphIntegrity({ type: TOGGLE_WINDOW_SHADE_MODE, - windowId: "equalizer" + windowId: "equalizer", }); } export function toggleMainWindowShadeMode(): Dispatchable { return withWindowGraphIntegrity({ type: TOGGLE_WINDOW_SHADE_MODE, - windowId: "main" + windowId: "main", }); } export function togglePlaylistShadeMode(): Dispatchable { return withWindowGraphIntegrity({ type: TOGGLE_WINDOW_SHADE_MODE, - windowId: "playlist" + windowId: "playlist", }); } @@ -140,7 +140,7 @@ export function centerWindowsInView(): Dispatchable { left: window.scrollX, top: window.scrollY, width: window.innerWidth, - height: window.innerHeight + height: window.innerHeight, }); } @@ -170,13 +170,13 @@ export function centerWindows(box: { const move = { x: Math.ceil(offsetLeft - bounding.left + (width - boxWidth) / 2), - y: Math.ceil(offsetTop - bounding.top + (height - boxHeight) / 2) + y: Math.ceil(offsetTop - bounding.top + (height - boxHeight) / 2), }; const newPositions = windowsInfo.reduce( (pos, w) => ({ ...pos, - [w.key]: { x: move.x + w.x, y: move.y + w.y } + [w.key]: { x: move.x + w.x, y: move.y + w.y }, }), {} ); @@ -251,7 +251,7 @@ export function ensureWindowsAreOnScreen(): Dispatchable { const newPositions = Utils.objectMap(positions, position => ({ x: position.x - moveX, - y: position.y - moveY + y: position.y - moveY, })); dispatch(updateWindowPositions(newPositions)); diff --git a/js/components/App.js b/js/components/App.js index 20fa829c..64b72d5b 100644 --- a/js/components/App.js +++ b/js/components/App.js @@ -108,7 +108,7 @@ class App extends React.Component { node, remove: () => { node.removeEventListener("keydown", listener); - } + }, }; } @@ -183,7 +183,7 @@ class App extends React.Component { } App.propTypes = { - container: PropTypes.instanceOf(Element) + container: PropTypes.instanceOf(Element), }; const mapStateToProps = state => ({ @@ -192,13 +192,13 @@ const mapStateToProps = state => ({ focused: state.windows.focused, closed: state.display.closed, genWindowsInfo: state.windows.genWindows, - zIndex: state.display.zIndex + zIndex: state.display.zIndex, }); const mapDispatchToProps = dispatch => ({ closeWindow: id => dispatch(Actions.closeWindow(id)), browserWindowSizeChanged: size => - dispatch(Actions.browserWindowSizeChanged(size)) + dispatch(Actions.browserWindowSizeChanged(size)), }); export default connect( diff --git a/js/components/Balance.tsx b/js/components/Balance.tsx index 24862fc1..f02c235d 100644 --- a/js/components/Balance.tsx +++ b/js/components/Balance.tsx @@ -33,13 +33,13 @@ const Balance = (props: Props) => ( ); const mapStateToProps = (state: AppState) => ({ - balance: Selectors.getBalance(state) + balance: Selectors.getBalance(state), }); const mapDispatchToProps = (dispatch: Dispatch) => ({ setBalance: (e: ChangeEvent) => dispatch(Actions.setBalance(Number((e.target as HTMLInputElement).value))), showMarquee: () => dispatch(Actions.setFocus("balance")), - hideMarquee: () => dispatch(Actions.unsetFocus()) + hideMarquee: () => dispatch(Actions.unsetFocus()), }); export default connect( diff --git a/js/components/ContextMenu.tsx b/js/components/ContextMenu.tsx index 22266cd3..0033654f 100644 --- a/js/components/ContextMenu.tsx +++ b/js/components/ContextMenu.tsx @@ -34,7 +34,7 @@ const Portal = (props: PortalProps) => { const style: React.CSSProperties = { top: props.top, left: props.left, - position: "absolute" + position: "absolute", }; return createPortal(
{props.children}
, node); }; @@ -107,7 +107,7 @@ class ContextMenu extends React.Component { top, bottom, selected, - zIndex + zIndex, } = this.props; return ( selected && ( @@ -122,7 +122,7 @@ class ContextMenu extends React.Component { } const mapStateToProps = (state: AppState) => ({ - zIndex: state.display.zIndex + zIndex: state.display.zIndex, }); export default connect(mapStateToProps)(ContextMenu); diff --git a/js/components/ContextMenuWrapper.tsx b/js/components/ContextMenuWrapper.tsx index 4556f1aa..db187b58 100644 --- a/js/components/ContextMenuWrapper.tsx +++ b/js/components/ContextMenuWrapper.tsx @@ -17,7 +17,7 @@ export default class ContextMenuWraper extends React.Component { this.state = { selected: false, offsetTop: null, - offsetLeft: null + offsetLeft: null, }; } @@ -52,7 +52,7 @@ export default class ContextMenuWraper extends React.Component { // TODO: We could do an initial render to see if the menu fits here // and do a second render if it does not. offsetTop: pageY, - offsetLeft: pageX + offsetLeft: pageX, }); // Even if you right click multiple times before closeing, // we should only end up with one global listener. diff --git a/js/components/EqualizerWindow/Band.tsx b/js/components/EqualizerWindow/Band.tsx index 636f111b..38c961dc 100644 --- a/js/components/EqualizerWindow/Band.tsx +++ b/js/components/EqualizerWindow/Band.tsx @@ -42,7 +42,7 @@ const Band = ({ id, onChange, handleMouseDown, - handleMouseUp + handleMouseUp, }: Props) => (
({ handleMouseDown: () => dispatch({ type: SET_BAND_FOCUS, input: "eq", bandFocused: ownProps.band }), - handleMouseUp: () => dispatch({ type: UNSET_FOCUS }) + handleMouseUp: () => dispatch({ type: UNSET_FOCUS }), }); export default connect( diff --git a/js/components/EqualizerWindow/EqAuto.tsx b/js/components/EqualizerWindow/EqAuto.tsx index 8446a6d7..110f7a31 100644 --- a/js/components/EqualizerWindow/EqAuto.tsx +++ b/js/components/EqualizerWindow/EqAuto.tsx @@ -24,7 +24,7 @@ const mapStateToProps = (state: AppState): StateProps => { const mapDispatchToProps = () => (dispatch: Dispatch): DispatchProps => { // We don't support auto. return { - toggleAuto: () => dispatch({ type: SET_EQ_AUTO, value: false }) + toggleAuto: () => dispatch({ type: SET_EQ_AUTO, value: false }), }; }; diff --git a/js/components/EqualizerWindow/EqGraph.js b/js/components/EqualizerWindow/EqGraph.js index f341cd06..321d48a3 100644 --- a/js/components/EqualizerWindow/EqGraph.js +++ b/js/components/EqualizerWindow/EqGraph.js @@ -60,7 +60,7 @@ class EqGraph extends React.Component { colorsCanvas.height = height; colorsCtx.drawImage(bgImage, 0, 0, width, height); this.setState({ - colorPattern: this.canvasCtx.createPattern(colorsCanvas, "repeat-x") + colorPattern: this.canvasCtx.createPattern(colorsCanvas, "repeat-x"), }); }; bgImage.src = lineColorsImage; @@ -137,5 +137,5 @@ class EqGraph extends React.Component { export default connect(state => ({ ...state.equalizer.sliders, lineColorsImage: state.display.skinImages.EQ_GRAPH_LINE_COLORS, - preampLineUrl: state.display.skinImages.EQ_PREAMP_LINE + preampLineUrl: state.display.skinImages.EQ_PREAMP_LINE, }))(EqGraph); diff --git a/js/components/EqualizerWindow/EqOn.tsx b/js/components/EqualizerWindow/EqOn.tsx index 6620fa43..1f66e3bc 100644 --- a/js/components/EqualizerWindow/EqOn.tsx +++ b/js/components/EqualizerWindow/EqOn.tsx @@ -18,7 +18,7 @@ const EqOn = (props: StateProps & DispatchProps) => {
@@ -26,7 +26,7 @@ const EqOn = (props: StateProps & DispatchProps) => { }; const mapStateToProps = (state: AppState): StateProps => ({ - on: state.equalizer.on + on: state.equalizer.on, }); const mapDispatchProps = (dispatch: Dispatch): DispatchProps => { diff --git a/js/components/EqualizerWindow/EqualizerShade.tsx b/js/components/EqualizerWindow/EqualizerShade.tsx index 66ebe0ce..12b12e96 100644 --- a/js/components/EqualizerWindow/EqualizerShade.tsx +++ b/js/components/EqualizerWindow/EqualizerShade.tsx @@ -40,13 +40,13 @@ const EqualizerShade = (props: StateProps & DispatchProps) => { const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => { return { closeWindow: () => dispatch(closeWindow("equalizer")), - toggleEqualizerShadeMode: () => dispatch(toggleEqualizerShadeMode()) + toggleEqualizerShadeMode: () => dispatch(toggleEqualizerShadeMode()), }; }; const mapStateToProps = (state: AppState): StateProps => ({ volume: state.media.volume, - balance: state.media.balance + balance: state.media.balance, }); export default connect( diff --git a/js/components/EqualizerWindow/PresetsContextMenu.tsx b/js/components/EqualizerWindow/PresetsContextMenu.tsx index b6238664..9db10709 100644 --- a/js/components/EqualizerWindow/PresetsContextMenu.tsx +++ b/js/components/EqualizerWindow/PresetsContextMenu.tsx @@ -4,7 +4,7 @@ import builtin from "../../../presets/builtin.json"; import { openEqfFileDialog, downloadPreset, - setEqFromObject + setEqFromObject, } from "../../actionCreators"; import { Node, Parent, Hr } from "../ContextMenu"; import ContextMenuTarget from "../ContextMenuTarget"; @@ -37,7 +37,7 @@ const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => { return { openEqfFileDialog: () => dispatch(openEqfFileDialog()), downloadPreset: () => dispatch(downloadPreset()), - setEqFromObject: preset => dispatch(setEqFromObject(preset)) + setEqFromObject: preset => dispatch(setEqFromObject(preset)), }; }; diff --git a/js/components/EqualizerWindow/index.test.js b/js/components/EqualizerWindow/index.test.js index 87948d7c..ae9be5f7 100644 --- a/js/components/EqualizerWindow/index.test.js +++ b/js/components/EqualizerWindow/index.test.js @@ -10,7 +10,7 @@ const media = { setPreamp: jest.fn(), setBalance: jest.fn(), getAnalyser: () => null, - on: jest.fn() + on: jest.fn(), }; const canvasMockify = require("canvas-mock"); diff --git a/js/components/EqualizerWindow/index.tsx b/js/components/EqualizerWindow/index.tsx index 02b3cd7d..0fb641a3 100644 --- a/js/components/EqualizerWindow/index.tsx +++ b/js/components/EqualizerWindow/index.tsx @@ -10,7 +10,7 @@ import { setEqToMid, setEqToMin, closeWindow, - toggleEqualizerShadeMode + toggleEqualizerShadeMode, } from "../../actionCreators"; import { SET_FOCUSED_WINDOW } from "../../actionTypes"; @@ -53,7 +53,7 @@ const EqualizerWindow = (props: StateProps & DispatchProps) => { doubled, shade, window: true, - draggable: true + draggable: true, }); return (
({ setHertzValue: (hertz: BandType) => (value: number) => dispatch(setEqBand(hertz, value)), closeEqualizerWindow: () => dispatch(closeWindow("equalizer")), - toggleEqualizerShadeMode: () => dispatch(toggleEqualizerShadeMode()) + toggleEqualizerShadeMode: () => dispatch(toggleEqualizerShadeMode()), }); const mapStateToProps = (state: AppState): StateProps => ({ doubled: state.display.doubled, selected: state.windows.focused === WINDOWS.EQUALIZER, - shade: getWindowShade(state)("equalizer") + shade: getWindowShade(state)("equalizer"), }); export default connect( diff --git a/js/components/GenWindow/index.tsx b/js/components/GenWindow/index.tsx index 561c2684..e21b96d9 100644 --- a/js/components/GenWindow/index.tsx +++ b/js/components/GenWindow/index.tsx @@ -69,7 +69,7 @@ export const GenWindow = ({ windowSize, setGenWindowSize, width, - height + height, }: Props) => { return (
{children({ width: width - CHROME_WIDTH, - height: height - CHROME_HEIGHT + height: height - CHROME_HEIGHT, })}
@@ -124,7 +124,7 @@ const mapStateToProps = (state: AppState, ownProps: OwnProps): StateProps => { width, height, selected: state.windows.focused === ownProps.windowId, - windowSize: state.windows.genWindows[ownProps.windowId].size + windowSize: state.windows.genWindows[ownProps.windowId].size, }; }; @@ -134,7 +134,7 @@ const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => { dispatch({ type: SET_FOCUSED_WINDOW, window: windowId }), close: (windowId: WindowId) => dispatch(closeWindow(windowId)), setGenWindowSize: (windowId: WindowId, size: [number, number]) => - dispatch(setWindowSize(windowId, size)) + dispatch(setWindowSize(windowId, size)), }; }; diff --git a/js/components/MainWindow/ActionButtons.tsx b/js/components/MainWindow/ActionButtons.tsx index d5089f8f..77d256a1 100644 --- a/js/components/MainWindow/ActionButtons.tsx +++ b/js/components/MainWindow/ActionButtons.tsx @@ -27,7 +27,7 @@ const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => { play: () => dispatch(play()), pause: () => dispatch(pause()), stop: () => dispatch(stop()), - next: () => dispatch(next()) + next: () => dispatch(next()), }; }; diff --git a/js/components/MainWindow/ClutterBar.tsx b/js/components/MainWindow/ClutterBar.tsx index b812bb03..4b8a0b2a 100644 --- a/js/components/MainWindow/ClutterBar.tsx +++ b/js/components/MainWindow/ClutterBar.tsx @@ -36,7 +36,7 @@ const ClutterBar = (props: StateProps & DispatchProps) => ( ); const mapStateToProps = (state: AppState): StateProps => ({ - doubled: state.display.doubled + doubled: state.display.doubled, }); const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => ({ @@ -44,7 +44,7 @@ const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => ({ handleMouseUp: () => { dispatch(toggleDoubleSizeMode()); dispatch({ type: UNSET_FOCUS }); - } + }, }); export default connect( diff --git a/js/components/MainWindow/Eject.tsx b/js/components/MainWindow/Eject.tsx index 2f7167c1..a3c86e77 100644 --- a/js/components/MainWindow/Eject.tsx +++ b/js/components/MainWindow/Eject.tsx @@ -13,7 +13,7 @@ const Eject = (props: DispatchProps) => ( ); const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => ({ - openMediaFileDialog: () => dispatch(Actions.openMediaFileDialog()) + openMediaFileDialog: () => dispatch(Actions.openMediaFileDialog()), }); export default connect( diff --git a/js/components/MainWindow/EqToggleButton.tsx b/js/components/MainWindow/EqToggleButton.tsx index 24233cac..ff94e6b4 100644 --- a/js/components/MainWindow/EqToggleButton.tsx +++ b/js/components/MainWindow/EqToggleButton.tsx @@ -26,11 +26,11 @@ const EqToggleButton = (props: Props) => ( ); const mapStateToProps = (state: AppState): StateProps => ({ - windowOpen: getWindowOpen(state)("equalizer") + windowOpen: getWindowOpen(state)("equalizer"), }); const mapDispatchToProps = { - handleClick: () => toggleWindow("equalizer") + handleClick: () => toggleWindow("equalizer"), }; export default connect( diff --git a/js/components/MainWindow/MainBalance.tsx b/js/components/MainWindow/MainBalance.tsx index ba9f6188..91effaf7 100644 --- a/js/components/MainWindow/MainBalance.tsx +++ b/js/components/MainWindow/MainBalance.tsx @@ -23,7 +23,7 @@ const MainBalance = (props: StateProps) => ( ); const mapStateToProps = (state: AppState): StateProps => ({ - balance: state.media.balance + balance: state.media.balance, }); export default connect(mapStateToProps)(MainBalance); diff --git a/js/components/MainWindow/MainContextMenu.tsx b/js/components/MainWindow/MainContextMenu.tsx index bc86f720..4ea24d03 100644 --- a/js/components/MainWindow/MainContextMenu.tsx +++ b/js/components/MainWindow/MainContextMenu.tsx @@ -4,7 +4,7 @@ import { close, openMediaFileDialog, loadMediaFiles, - toggleWindow + toggleWindow, } from "../../actionCreators"; import { getGenWindows } from "../../selectors"; import { LOAD_STYLE } from "../../constants"; @@ -18,7 +18,7 @@ import { Track, WindowId, FilePicker, - LoadStyle + LoadStyle, } from "../../types"; import { WebampWindow } from "../../reducers/windows"; @@ -96,7 +96,7 @@ const MainContextMenu = (props: Props) => ( const mapStateToProps = (state: AppState): StateProps => ({ networkConnected: state.network.connected, - genWindows: getGenWindows(state) + genWindows: getGenWindows(state), }); const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => { @@ -105,7 +105,7 @@ const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => { openMediaFileDialog: () => dispatch(openMediaFileDialog()), loadMediaFiles: (tracks: Track[], loadStyle: LoadStyle) => dispatch(loadMediaFiles(tracks, loadStyle)), - toggleGenWindow: (windowId: WindowId) => dispatch(toggleWindow(windowId)) + toggleGenWindow: (windowId: WindowId) => dispatch(toggleWindow(windowId)), }; }; diff --git a/js/components/MainWindow/MainVolume.tsx b/js/components/MainWindow/MainVolume.tsx index 19d13806..7a7918d9 100644 --- a/js/components/MainWindow/MainVolume.tsx +++ b/js/components/MainWindow/MainVolume.tsx @@ -16,7 +16,7 @@ const MainVolume = (props: Props) => { const offset = (sprite - 1) * 15; const style = { - backgroundPosition: `0 -${offset}px` + backgroundPosition: `0 -${offset}px`, }; return (
@@ -26,7 +26,7 @@ const MainVolume = (props: Props) => { }; const mapStateToProps = (state: AppState): Props => ({ - volume: Selectors.getVolume(state) + volume: Selectors.getVolume(state), }); export default connect(mapStateToProps)(MainVolume); diff --git a/js/components/MainWindow/Marquee.tsx b/js/components/MainWindow/Marquee.tsx index 486349df..23d7323a 100644 --- a/js/components/MainWindow/Marquee.tsx +++ b/js/components/MainWindow/Marquee.tsx @@ -110,7 +110,7 @@ class Marquee extends React.Component { const style: React.CSSProperties = { whiteSpace: "nowrap", willChange: "transform", - transform: `translateX(${offsetPixels})` + transform: `translateX(${offsetPixels})`, }; return (
{ const mapStateToProps = (state: AppState): StateProps => ({ marqueeStep: state.display.marqueeStep, text: Selectors.getMarqueeText(state), - doubled: Selectors.getDoubled(state) + doubled: Selectors.getDoubled(state), }); const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => { return { - stepMarquee: () => dispatch({ type: STEP_MARQUEE }) + stepMarquee: () => dispatch({ type: STEP_MARQUEE }), }; }; diff --git a/js/components/MainWindow/Minimize.tsx b/js/components/MainWindow/Minimize.tsx index 077f7c8e..ceb5fd9f 100644 --- a/js/components/MainWindow/Minimize.tsx +++ b/js/components/MainWindow/Minimize.tsx @@ -13,7 +13,7 @@ const Minimize = ({ minimize }: Props) => ( ); const mapDispatchToProps = (dispatch: Dispatch) => ({ - minimize: () => dispatch(Actions.minimize()) + minimize: () => dispatch(Actions.minimize()), }); export default connect( diff --git a/js/components/MainWindow/MonoStereo.tsx b/js/components/MainWindow/MonoStereo.tsx index 7a453664..f1f2f90a 100644 --- a/js/components/MainWindow/MonoStereo.tsx +++ b/js/components/MainWindow/MonoStereo.tsx @@ -20,7 +20,7 @@ const MonoStereo = (props: Props) => ( const mapStateToProps = (state: AppState): Props => { return { - channels: Selectors.getChannels(state) + channels: Selectors.getChannels(state), }; }; diff --git a/js/components/MainWindow/PlaylistToggleButton.js b/js/components/MainWindow/PlaylistToggleButton.js index 60078cf2..63ab5d33 100644 --- a/js/components/MainWindow/PlaylistToggleButton.js +++ b/js/components/MainWindow/PlaylistToggleButton.js @@ -15,11 +15,11 @@ const PlaylistToggleButton = props => ( ); const mapStateToProps = state => ({ - getWindowOpen: getWindowOpen(state) + getWindowOpen: getWindowOpen(state), }); const mapDispatchToProps = { - handleClick: () => toggleWindow("playlist") + handleClick: () => toggleWindow("playlist"), }; export default connect( diff --git a/js/components/MainWindow/Position.tsx b/js/components/MainWindow/Position.tsx index 21434f45..63fc3503 100644 --- a/js/components/MainWindow/Position.tsx +++ b/js/components/MainWindow/Position.tsx @@ -6,7 +6,7 @@ import { SEEK_TO_PERCENT_COMPLETE, SET_FOCUS, UNSET_FOCUS, - SET_SCRUB_POSITION + SET_SCRUB_POSITION, } from "../../actionTypes"; import * as Selectors from "../../selectors"; @@ -26,7 +26,7 @@ const Position = ({ position, seekToPercentComplete, displayedPosition, - setPosition + setPosition, }: Props) => { // In shade mode, the position slider shows up differently depending on if // it's near the start, middle or end of its progress @@ -69,7 +69,7 @@ const mapStateToProps = (state: AppState): StateProps => { return { displayedPosition, - position + position, }; }; @@ -77,7 +77,7 @@ const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => ({ seekToPercentComplete: e => { dispatch({ type: SEEK_TO_PERCENT_COMPLETE, - percent: Number((e.target as HTMLInputElement).value) + percent: Number((e.target as HTMLInputElement).value), }); dispatch({ type: UNSET_FOCUS }); }, @@ -85,9 +85,9 @@ const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => ({ dispatch({ type: SET_FOCUS, input: "position" }); dispatch({ type: SET_SCRUB_POSITION, - position: Number((e.target as HTMLInputElement).value) + position: Number((e.target as HTMLInputElement).value), }); - } + }, }); export default connect( diff --git a/js/components/MainWindow/Repeat.tsx b/js/components/MainWindow/Repeat.tsx index 219d84e1..e8161bb2 100644 --- a/js/components/MainWindow/Repeat.tsx +++ b/js/components/MainWindow/Repeat.tsx @@ -37,11 +37,11 @@ const Repeat = ({ repeat, handleClick }: Props) => ( ); const mapStateToProps = (state: AppState): StateProps => ({ - repeat: state.media.repeat + repeat: state.media.repeat, }); const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => ({ - handleClick: () => dispatch(toggleRepeat()) + handleClick: () => dispatch(toggleRepeat()), }); export default connect( diff --git a/js/components/MainWindow/Shade.tsx b/js/components/MainWindow/Shade.tsx index 572406df..6da4055e 100644 --- a/js/components/MainWindow/Shade.tsx +++ b/js/components/MainWindow/Shade.tsx @@ -20,7 +20,7 @@ const Shade = (props: DispatchProps) => ( const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => { return { - handleClick: () => dispatch(toggleMainWindowShadeMode()) + handleClick: () => dispatch(toggleMainWindowShadeMode()), }; }; diff --git a/js/components/MainWindow/Shuffle.tsx b/js/components/MainWindow/Shuffle.tsx index 6b4663dc..da917d33 100644 --- a/js/components/MainWindow/Shuffle.tsx +++ b/js/components/MainWindow/Shuffle.tsx @@ -36,11 +36,11 @@ const Shuffle = ({ shuffle, handleClick }: Props) => ( ); const mapStateToProps = (state: AppState): StateProps => ({ - shuffle: state.media.shuffle + shuffle: state.media.shuffle, }); const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => ({ - handleClick: () => dispatch(toggleShuffle()) + handleClick: () => dispatch(toggleShuffle()), }); export default connect( mapStateToProps, diff --git a/js/components/MainWindow/Time.tsx b/js/components/MainWindow/Time.tsx index 51b315c5..f2a33f76 100644 --- a/js/components/MainWindow/Time.tsx +++ b/js/components/MainWindow/Time.tsx @@ -21,7 +21,7 @@ const Time = ({ timeElapsed, duration, timeMode, - toggleTimeMode + toggleTimeMode, }: StateProps & DispatchProps) => { const seconds = timeMode === TIME_MODE.ELAPSED ? timeElapsed : duration - timeElapsed; @@ -57,7 +57,7 @@ const mapStateToProps = (state: AppState): StateProps => { return { timeElapsed, duration: duration || 0, timeMode }; }; const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => ({ - toggleTimeMode: () => dispatch(Actions.toggleTimeMode()) + toggleTimeMode: () => dispatch(Actions.toggleTimeMode()), }); export default connect( diff --git a/js/components/MainWindow/index.test.js b/js/components/MainWindow/index.test.js index a911c718..3299d050 100644 --- a/js/components/MainWindow/index.test.js +++ b/js/components/MainWindow/index.test.js @@ -13,7 +13,7 @@ const media = { setBalance: jest.fn(), setPreamp: jest.fn(), getAnalyser: () => null, - on: jest.fn() + on: jest.fn(), }; const canvasMockify = require("canvas-mock"); diff --git a/js/components/MainWindow/index.tsx b/js/components/MainWindow/index.tsx index b1a9f29b..8f77fa09 100644 --- a/js/components/MainWindow/index.tsx +++ b/js/components/MainWindow/index.tsx @@ -6,7 +6,7 @@ import { loadFilesFromReferences, toggleMainWindowShadeMode, scrollVolume, - loadMedia + loadMedia, } from "../../actionCreators"; import { getWindowShade } from "../../selectors"; @@ -44,7 +44,7 @@ import { AppState, Dispatch, FilePicker, - Track + Track, } from "../../types"; interface StateProps { @@ -86,7 +86,7 @@ export class MainWindow extends React.Component { llama, status, working, - filePickers + filePickers, } = this.props; const className = classnames({ @@ -99,7 +99,7 @@ export class MainWindow extends React.Component { draggable: true, loading, doubled, - llama + llama, }); return ( @@ -174,7 +174,7 @@ const mapStateToProps = (state: AppState): StateProps => { const { media: { status }, display: { loading, doubled, llama, working }, - windows: { focused } + windows: { focused }, } = state; return { mainShade: Boolean(getWindowShade(state)("main")), @@ -183,7 +183,7 @@ const mapStateToProps = (state: AppState): StateProps => { doubled, llama, working, - focused + focused, }; }; @@ -196,7 +196,7 @@ const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => { toggleMainWindowShadeMode: () => dispatch(toggleMainWindowShadeMode()), scrollVolume: (e: React.WheelEvent) => dispatch(scrollVolume(e)), - loadMedia: (e: React.DragEvent) => dispatch(loadMedia(e)) + loadMedia: (e: React.DragEvent) => dispatch(loadMedia(e)), }; }; export default connect( diff --git a/js/components/MediaLibraryWindow/Sidebar.tsx b/js/components/MediaLibraryWindow/Sidebar.tsx index 74599e1a..4f5aa6b2 100644 --- a/js/components/MediaLibraryWindow/Sidebar.tsx +++ b/js/components/MediaLibraryWindow/Sidebar.tsx @@ -7,7 +7,7 @@ export default class Sidebar extends React.Component { style={{ display: "flex", flexDirection: "column", - height: "100%" + height: "100%", }} >
@@ -33,7 +33,7 @@ export default class Sidebar extends React.Component {