chore: Remove console.log left in code and added eslint rule to prevent it happening again
This commit is contained in:
@@ -2,6 +2,14 @@
|
||||
"extends": [
|
||||
"../.eslintrc"
|
||||
],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["scripts/*"],
|
||||
"rules": {
|
||||
"no-console": "off"
|
||||
}
|
||||
}
|
||||
],
|
||||
"env": {
|
||||
"jest": true,
|
||||
"node": true
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable no-console */
|
||||
import { IncomingMessage } from "http";
|
||||
import chalk from "chalk";
|
||||
import { isEmpty, isArray, isObject, isString } from "lodash";
|
||||
|
||||
@@ -32,9 +32,6 @@ if (env.SENTRY_DSN) {
|
||||
export function requestErrorHandler(error: any, ctx: AppContext) {
|
||||
// we don't need to report every time a request stops to the bug tracker
|
||||
if (error.code === "EPIPE" || error.code === "ECONNRESET") {
|
||||
console.warn("Connection error", {
|
||||
error,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -69,6 +66,7 @@ export function requestErrorHandler(error: any, ctx: AppContext) {
|
||||
Sentry.captureException(error);
|
||||
});
|
||||
} else {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
/* eslint-disable @typescript-eslint/ban-types */
|
||||
import Logger from "@server/logging/Logger";
|
||||
|
||||
const Deprecated = (message?: string) => (
|
||||
target: Object,
|
||||
propertyKey: string
|
||||
) => {
|
||||
if (process.env[propertyKey]) {
|
||||
console.warn(
|
||||
Logger.warn(
|
||||
`The environment variable ${propertyKey} is deprecated and will be removed in a future release. ${message}`
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
import Logger from "@server/logging/Logger";
|
||||
|
||||
export type Chunk = {
|
||||
file: string;
|
||||
@@ -17,7 +18,7 @@ export const readManifestFile = (file = "./build/app/manifest.json") => {
|
||||
try {
|
||||
manifest = fs.readFileSync(absoluteFilePath, "utf8") as string;
|
||||
} catch (err) {
|
||||
console.warn(
|
||||
Logger.warn(
|
||||
`Can not find ${absoluteFilePath}. Try executing "yarn vite:build" before running in production mode.`
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user