Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
[Issue HHS#2037]Add no console log to eslint rules (#182)
Browse files Browse the repository at this point in the history
Fixes HHS#2037

> Added new rule to eslint to prevent leaving behind console log
statements

> normal expected rule in eslint configurations
  • Loading branch information
btabaska authored and acouch committed Sep 18, 2024
1 parent 766a7e6 commit 7a0ce80
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ module.exports = {
"@typescript-eslint/no-explicit-any": "error",
// Just warn since playwright tests may not use screen the way jest would
"testing-library/prefer-screen-queries": "warn",
// Prevent unnecessary console statements
"no-console": ["error", { allow: ["warn", "error"] }],
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/api/BaseApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ const throwError = (
searchInputs?: QueryParamData,
firstError?: APIResponseError,
) => {
console.log("Throwing error: ", message, status_code, searchInputs);
console.error("Throwing error: ", message, status_code, searchInputs);

// Include just firstError for now, we can expand this
// If we need ValidationErrors to be more expanded
Expand Down

0 comments on commit 7a0ce80

Please sign in to comment.