Replies: 2 comments 2 replies
-
I think adding a custom message option for I'm not entirely sure how a generic option to override the message for rules would work. In some cases, lint rules are more objective than they are subjective, and ideally in those cases we would just provide the best message by default. In other cases like |
Beta Was this translation helpful? Give feedback.
-
The rule does print more messages though: https://biomejs.dev/linter/rules/no-console/ Are you referring to the first message? How would you improve it? Feel free to send a PR if you think the message isn't good enough. As for providing a custom message, I'm not much in favour. We structure our messaging to match our rule pillars https://biomejs.dev/linter/#rule-pillars, with high quality in mind. If we allow overriding messages, we lose that something that people praise us for. I'd prefer seeing PRs to improve them. The rule |
Beta Was this translation helpful? Give feedback.
-
I'd like to disable console logs, common in debugging, in favor of a more intentional logger. One of the reasons is to avoid logging sensitive data.
However, if I simply turn on the rule, the only message is "Don't use console", which doesn't explain why. It might encourage people (especially someone new to the project) to simply start using the logger by default to avoid the error rather than being sure not to commit debug code to main.
I'm also curious if it would make sense to have a generic rule that could apply to any of the rules. Something like
"defaultMessage": "Moving pianos are dangerous"
, that could still be overridden by specific rules that have allow for custom messages for specific scenarios (e.g.noRestrictedImports
letting you explain each import).Beta Was this translation helpful? Give feedback.
All reactions