mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-10 17:49:58 +00:00
Narrow linting rules and fix for eslintrc for js files
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
export class Logger {
|
||||
constructor(private prefix: string) {}
|
||||
|
||||
public log(message: string, data?: any) {
|
||||
public log(message: string, data?: unknown) {
|
||||
const formattedMessage = `${this.prefix} (Log): ${message}`;
|
||||
if (data) {
|
||||
// eslint-disable-next-line no-console
|
||||
@@ -13,7 +13,7 @@ export class Logger {
|
||||
console.log(formattedMessage);
|
||||
}
|
||||
}
|
||||
public info(message: string, data?: any) {
|
||||
public info(message: string, data?: unknown) {
|
||||
const formattedMessage = `${this.prefix} (Info): ${message}`;
|
||||
if (data) {
|
||||
console.info(formattedMessage, data);
|
||||
@@ -21,7 +21,7 @@ export class Logger {
|
||||
console.info(formattedMessage);
|
||||
}
|
||||
}
|
||||
public warn(message: string, data?: any) {
|
||||
public warn(message: string, data?: unknown) {
|
||||
const formattedMessage = `${this.prefix} (Warning): ${message}`;
|
||||
if (data) {
|
||||
console.warn(formattedMessage, data);
|
||||
@@ -29,7 +29,7 @@ export class Logger {
|
||||
console.warn(formattedMessage);
|
||||
}
|
||||
}
|
||||
public error(message: string, data?: any) {
|
||||
public error(message: string, data?: unknown) {
|
||||
const formattedMessage = `${this.prefix} (Error): ${message}`;
|
||||
if (data) {
|
||||
console.error(formattedMessage, data);
|
||||
|
||||
@@ -32,7 +32,6 @@ function connectNative(application: string): Port {
|
||||
|
||||
// Port proxy API
|
||||
const portObject: Port = {
|
||||
error: null as any,
|
||||
name: "",
|
||||
|
||||
onDisconnect: {
|
||||
@@ -150,7 +149,7 @@ function connectNative(application: string): Port {
|
||||
}
|
||||
});
|
||||
|
||||
port.onMessage.addListener((message: any) => {
|
||||
port.onMessage.addListener((message: Message) => {
|
||||
if (!isNativeHostStatusKnown) {
|
||||
isNativeHostStatusKnown = true;
|
||||
messageQueue = [];
|
||||
@@ -177,8 +176,6 @@ async function sendNativeMessage(application: string, message: Message) {
|
||||
);
|
||||
}
|
||||
|
||||
const port = await options.get("bridgeBackupPort");
|
||||
|
||||
return await new Promise((resolve, reject) => {
|
||||
const ws = new WebSocket(
|
||||
`ws://${bridgeBackupHost}:${bridgeBackupPort}`
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
import logger from "./logger";
|
||||
|
||||
import { ReceiverSelectorMediaType } from "../background/receiverSelector";
|
||||
|
||||
export function getNextEllipsis(ellipsis: string): string {
|
||||
@@ -18,7 +16,7 @@ export function getNextEllipsis(ellipsis: string): string {
|
||||
*/
|
||||
export function stringify(
|
||||
templateStrings: TemplateStringsArray,
|
||||
...substitutions: any[]
|
||||
...substitutions: unknown[]
|
||||
) {
|
||||
let formattedString = "";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user