Skip to content

Commit

Permalink
lint for stray console.logs
Browse files Browse the repository at this point in the history
  • Loading branch information
david-crespo committed Jan 9, 2025
1 parent 2fa9b42 commit da15741
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ module.exports = {
'import/no-default-export': 'error',
'import/no-unresolved': 'off', // plugin doesn't know anything
'jsx-a11y/label-has-associated-control': [2, { controlComponents: ['button'] }],
// only worry about console.log
'no-console': ['error', { allow: ['warn', 'error', 'info', 'table'] }],
'no-param-reassign': 'error',
'no-restricted-imports': [
'error',
Expand Down
2 changes: 1 addition & 1 deletion app/api/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ export const wrapQueryClient = <A extends ApiClient>(api: A, queryClient: QueryC
// directly without further processing
throw data
}
console.log(options.explanation)
console.info(options.explanation)
return { type: 'error' as const, data }
}),
...options,
Expand Down
2 changes: 1 addition & 1 deletion app/api/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function handleResult<T>(result: ApiResult<T>): T {
}

function logHeading(s: string) {
console.log(`%c${s}`, 'font-size: 16px; font-weight: bold;')
console.info(`%c${s}`, 'font-size: 16px; font-weight: bold;')
}

if (typeof window !== 'undefined') {
Expand Down
2 changes: 1 addition & 1 deletion app/forms/image-upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ export function Component() {
.catch((e) => {
// eat a 404 since that's what we want. anything else should still blow up
if (e.statusCode === 404) {
console.log(
console.info(
'/v1/images 404 is expected. It means the image name is not taken.'
)
return null
Expand Down
4 changes: 2 additions & 2 deletions app/msw-mock-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function getChaos() {
const chaos = getChaos()

if (process.env.NODE_ENV !== 'production' && chaos) {
console.log(`
console.info(`
▄████████ ▄█ █▄ ▄████████ ▄██████▄ ▄████████
███ ███ ███ ███ ███ ███ ███ ███ ███ ███
███ █▀ ███ ███ ███ ███ ███ ███ ███ █▀
Expand All @@ -34,7 +34,7 @@ if (process.env.NODE_ENV !== 'production' && chaos) {
███ ███ ███ ███ ███ ███ ▄███ ███ ███
▀█ ███ █▀ ▀██████▀ ████████▀ ██████████
`)
console.log(`Running MSW in CHAOS MODE with ${chaos}% likelihood of random failure`)
console.info(`Running MSW in CHAOS MODE with ${chaos}% likelihood of random failure`)
}

/** Return true for failure with a given likelihood */
Expand Down

0 comments on commit da15741

Please sign in to comment.