TSLint compliance

This commit is contained in:
hensm
2020-02-15 06:06:57 +00:00
parent 809a591bbd
commit 14999a4f57
19 changed files with 219 additions and 77 deletions

View File

@@ -91,8 +91,9 @@ function getSession (opts: InitOptions): Promise<cast.Session> {
}
}
// TODO: Handle this
function sessionListener () {}
function sessionListener () {
// TODO: Handle this
}
function onRequestSessionSuccess (session: cast.Session) {
resolve(session);
@@ -136,7 +137,7 @@ function getMedia (opts: InitOptions): Promise<cast.media.Media> {
= await startMediaServer(mediaTitle, port);
const baseUrl = new URL(`http://${host}:${port}/`);
mediaUrl = new URL(mediaPath, baseUrl)
mediaUrl = new URL(mediaPath, baseUrl);
subtitleUrls = subtitlePaths.map(
path => new URL(path, baseUrl));
@@ -395,6 +396,7 @@ export async function init (opts: InitOptions) {
});
if (await options.get("mediaStopOnUnload")) {
// tslint:disable-next-line: no-empty
currentSession.stop(() => {}, () => {});
}
});

View File

@@ -43,7 +43,7 @@ export function bindPropertyDescriptor (
* element and collect them into a property descriptor map.
*/
export function clonePropsDescriptor<T> (
target: T, props: Array<any/*keyof typeof T*/>)
target: T, props: any[])
: PropertyDescriptorMap {
return props.reduce<PropertyDescriptorMap>((descriptorMap, prop) => {

View File

@@ -51,6 +51,7 @@ function deepQuerySelector (selector: string): Element | null {
, XPathResult.ORDERED_NODE_ITERATOR_TYPE);
let node: Node | null;
// tslint:disable-next-line: no-conditional-assignment
while (node = result.iterateNext()) {
const shadowRoot = getShadowRootFromNode(node);
if (!shadowRoot) {
@@ -78,6 +79,7 @@ function deepQuerySelectorAll (selector: string): Node[] {
const nodes: Node[] = [];
let node: Node | null;
// tslint:disable-next-line: no-conditional-assignment
while (node = result.iterateNext()) {
const shadowRoot = getShadowRootFromNode(node);
if (shadowRoot) {
@@ -361,7 +363,7 @@ document.addEventListener("DOMContentLoaded", () => {
const mediaElements = document.querySelectorAll(mediaSelector);
const deepMediaElements = deepQuerySelectorAll(mediaSelector);
for (const mediaElement of [...Array.from(mediaElements), ...deepMediaElements]) {
for (const mediaElement of [...mediaElements, ...deepMediaElements]) {
wrapMediaElement(mediaElement as HTMLMediaElement);
}
});

View File

@@ -35,7 +35,7 @@ function sendAppMessage (subject: string, data: any) {
session.sendMessage(FX_CAST_RECEIVER_APP_NAMESPACE, {
subject
, data
}, () => {}, () => {});
});
}
@@ -45,7 +45,6 @@ window.addEventListener("beforeunload", () => {
async function onRequestSessionSuccess (newSession: cast.Session) {
cast.logMessage("onRequestSessionSuccess");
session = newSession;