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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(biome): enable noConsoleLog rule #1268

Merged
merged 5 commits into from
Jun 18, 2024
Merged

Conversation

setchy
Copy link
Member

@setchy setchy commented Jun 18, 2024

Avoid future console.logs accidentally creeping in 馃檲

@setchy setchy added the build Build, action or package manager changes label Jun 18, 2024
@setchy setchy added this to the Release 5.10.0 milestone Jun 18, 2024
scripts/notarize.js Outdated Show resolved Hide resolved
@setchy setchy merged commit d6123f0 into main Jun 18, 2024
7 checks passed
@setchy setchy deleted the build/biomejs-console-log branch June 18, 2024 18:47
Copy link
Member

@afonsojramos afonsojramos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact that you refactored a console log into its own function to not put the ignore on multiple places is a bit hilarious 馃槅

@setchy
Copy link
Member Author

setchy commented Jun 18, 2024

The fact that you refactored a console log into its own function to not put the ignore on multiple places is a bit hilarious 馃槅

just making our friend @bmulholland happy 馃槃

#1268 (comment)

@bmulholland
Copy link
Collaborator

bmulholland commented Jun 19, 2024

Well, to be fair, I was thinking of going one step further:
logger.ts:

function debugLog(msg) {
  // biome-ignore lint/suspicious/noConsoleLog: debug logging
  console.log(msg);
}

The point isn't to centralize the biome-ignore, but more to make the intent clear. Specifically: if I'm reading the code, and I see console.log, I think "this is a mistake, shouldn't be here." But if I'm reading code and see debugLog, I don't question it, and even consider it thoughtful and helpful.

Also, centralizing it means that we could in future e.g. change the debug log to a log file, which could be submitted with bug reporst.

My mental reference here is Rails' log levels: https://guides.rubyonrails.org/debugging_rails_applications.html#sending-messages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build, action or package manager changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants