-
Notifications
You must be signed in to change notification settings - Fork 415
Open
Labels
auto-triage-skipPrevent this issue from being closed due to lack of activityPrevent this issue from being closed due to lack of activitydiscussionM-T: An issue where more input is needed to reach a decisionM-T: An issue where more input is needed to reach a decision
Description
While working on Bolt apps I am normally reaching for the console to log any info/warn/errors. To keep things consistent I created this custom Biome plugin using Grit. I think this would be a great addition to Bolt's developer experience!
Requirements
Here's an example of the .grit plugin:
// Biome GritQL plugin to warn against console usage and suggest app.logger
or {
`console.log($args)` as $node where {
register_diagnostic(
span = $node,
message = "Use app.logger.info() instead of console.log()",
severity = "warn"
)
},
`console.error($args)` as $node where {
register_diagnostic(
span = $node,
message = "Use app.logger.error() instead of console.error()",
severity = "warn"
)
},
`console.warn($args)` as $node where {
register_diagnostic(
span = $node,
message = "Use app.logger.warn() instead of console.warn()",
severity = "warn"
)
},
`console.info($args)` as $node where {
register_diagnostic(
span = $node,
message = "Use app.logger.info() instead of console.info()",
severity = "warn"
)
},
`console.debug($args)` as $node where {
register_diagnostic(
span = $node,
message = "Use app.logger.debug() instead of console.debug()",
severity = "warn"
)
}
}
and here's an example of the warning:

mwbrooks and zimeg
Metadata
Metadata
Assignees
Labels
auto-triage-skipPrevent this issue from being closed due to lack of activityPrevent this issue from being closed due to lack of activitydiscussionM-T: An issue where more input is needed to reach a decisionM-T: An issue where more input is needed to reach a decision