You've already forked tf2wikipricing
lint: clarify types on log functions
This commit is contained in:
@@ -2,17 +2,17 @@ declare let __EXTENSION_NAME: string;
|
|||||||
const logHeader = `[${__EXTENSION_NAME}] `;
|
const logHeader = `[${__EXTENSION_NAME}] `;
|
||||||
|
|
||||||
/** `console.debug` with header; automatically NO-OP on production build */
|
/** `console.debug` with header; automatically NO-OP on production build */
|
||||||
function logDebug(message?: any, ...optionalParams: any[]): void {
|
function logDebug(message?: string, ...optionalParams: Array<unknown>): void {
|
||||||
if(process.env.NODE_ENV !== 'production') console.debug(logHeader + message, optionalParams);
|
if(process.env.NODE_ENV !== 'production') console.debug(logHeader + message, optionalParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** `console.log` with header */
|
/** `console.log` with header */
|
||||||
function log(message?: any, ...optionalParams: any[]): void {
|
function log(message?: string, ...optionalParams: Array<unknown>): void {
|
||||||
console.log(logHeader + message, optionalParams)
|
console.log(logHeader + message, optionalParams)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** `console.error` with header */
|
/** `console.error` with header */
|
||||||
function logError(message?: any, ...optionalParams: any[]): void {
|
function logError(message?: string, ...optionalParams: Array<unknown>): void {
|
||||||
console.error(logHeader + message, optionalParams)
|
console.error(logHeader + message, optionalParams)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user