From 552c56390c6cb817ebdd622d4b5778f95462888d Mon Sep 17 00:00:00 2001 From: Marks Polakovs Date: Mon, 20 Apr 2020 14:54:43 +0200 Subject: [PATCH] prettier all the things --- src/api.ts | 2 +- src/mixer/state.ts | 46 +++++++++++++++++-------------------- src/wavesurfer-plugins.d.ts | 2 +- tsconfig.json | 12 +++------- 4 files changed, 26 insertions(+), 36 deletions(-) diff --git a/src/api.ts b/src/api.ts index 919c3f7..70de072 100644 --- a/src/api.ts +++ b/src/api.ts @@ -12,7 +12,7 @@ export async function apiRequest( params: any, need_auth: boolean = true ): Promise { - var req: Promise| null = null; + var req: Promise | null = null; if (method === "GET") { req = fetch(url + qs.stringify(params, { addQueryPrefix: true }), { credentials: need_auth ? "include" : "omit", diff --git a/src/mixer/state.ts b/src/mixer/state.ts index eb1c56e..9ee3fbd 100644 --- a/src/mixer/state.ts +++ b/src/mixer/state.ts @@ -13,8 +13,8 @@ import { Track, MYRADIO_NON_API_BASE, AuxItem } from "../api"; import { AppThunk } from "../store"; import { RootState } from "../rootReducer"; import WaveSurfer from "wavesurfer.js"; -import CursorPlugin from 'wavesurfer.js/dist/plugin/wavesurfer.cursor.min.js'; -import RegionsPlugin from 'wavesurfer.js/dist/plugin/wavesurfer.regions.min.js'; +import CursorPlugin from "wavesurfer.js/dist/plugin/wavesurfer.cursor.min.js"; +import RegionsPlugin from "wavesurfer.js/dist/plugin/wavesurfer.regions.min.js"; import * as later from "later"; import NewsIntro from "../assets/audio/NewsIntro.wav"; import NewsEndCountdown from "../assets/audio/NewsEndCountdown.wav"; @@ -385,20 +385,18 @@ export const load = ( credentials: "include", } as any, plugins: [ - CursorPlugin.create( - { - showTime: true, - opacity: 1, - customShowTimeStyle: { - 'background-color': '#000', - color: '#fff', - padding: '2px', - 'font-size': '10px' - } - } - ), - RegionsPlugin.create({}) - ] + CursorPlugin.create({ + showTime: true, + opacity: 1, + customShowTimeStyle: { + "background-color": "#000", + color: "#fff", + padding: "2px", + "font-size": "10px", + }, + }), + RegionsPlugin.create({}), + ], }); wavesurfer.on("ready", () => { @@ -421,15 +419,13 @@ export const load = ( wavesurfer.play(); } if (state.loadedItem && "intro" in state.loadedItem) { - wavesurfer.addRegion( - { - id: "intro", - resize: false, - start: 0, - end: state.loadedItem.intro, - color: 'rgba(125,0,255, 0.12)' - } - ) + wavesurfer.addRegion({ + id: "intro", + resize: false, + start: 0, + end: state.loadedItem.intro, + color: "rgba(125,0,255, 0.12)", + }); } }); wavesurfer.on("play", () => { diff --git a/src/wavesurfer-plugins.d.ts b/src/wavesurfer-plugins.d.ts index 8a5fe7f..a7271d3 100644 --- a/src/wavesurfer-plugins.d.ts +++ b/src/wavesurfer-plugins.d.ts @@ -1,3 +1,3 @@ declare module "wavesurfer.js/dist/plugin/wavesurfer.cursor.min.js"; -declare module "wavesurfer.js/dist/plugin/wavesurfer.regions.min.js"; \ No newline at end of file +declare module "wavesurfer.js/dist/plugin/wavesurfer.regions.min.js"; diff --git a/tsconfig.json b/tsconfig.json index 8ebed57..af10394 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,11 +1,7 @@ { "compilerOptions": { "target": "es5", - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], + "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, "esModuleInterop": true, @@ -17,9 +13,7 @@ "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, - "jsx": "react", + "jsx": "react" }, - "include": [ - "src" - ] + "include": ["src"] }