Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add eslint warning if console.log are left #3813

Merged
merged 1 commit into from
Nov 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dashboard/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"jest": true
},
"rules": {
"no-console": "warn", // warns if a console.log is left in the code
"redos/no-vulnerable": "error", // avoid ReDoS vulnerable regex
"quotes": [
"error", // enforce double quotes
Expand Down
2 changes: 2 additions & 0 deletions dashboard/src/components/ErrorBoundary/ErrorBoundary.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { mount } from "enzyme";
import React from "react";
import ErrorBoundary from "./ErrorBoundary";

/* eslint-disable no-console */

const consoleOrig = console.error;

const defaultProps = {
Expand Down
4 changes: 4 additions & 0 deletions dashboard/src/registerServiceWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,13 @@ function registerValidSW(swUrl: string) {
// the fresh content will have been added to the cache.
// It's the perfect time to display a 'New content is
// available; please refresh.' message in your web app.
/* eslint-disable-next-line no-console */
console.log("New content is available; please refresh.");
} else {
// At this point, everything has been precached.
// It's the perfect time to display a
// 'Content is cached for offline use.' message.
/* eslint-disable-next-line no-console */
console.log("Content is cached for offline use.");
}
}
Expand All @@ -68,6 +70,7 @@ function registerValidSW(swUrl: string) {
};
})
.catch(error => {
/* eslint-disable-next-line no-console */
console.error("Error during service worker registration:", error);
});
}
Expand All @@ -93,6 +96,7 @@ function checkValidServiceWorker(swUrl: string) {
}
})
.catch(() => {
/* eslint-disable-next-line no-console */
console.log("No internet connection found. App is running in offline mode.");
});
}
Expand Down