Skip to content

feat: add suppressEnabledInfo option to suppress type checker info message#46

Closed
zalishchuk wants to merge 1 commit intorstackjs:mainfrom
zalishchuk:suppress-enabled-info
Closed

feat: add suppressEnabledInfo option to suppress type checker info message#46
zalishchuk wants to merge 1 commit intorstackjs:mainfrom
zalishchuk:suppress-enabled-info

Conversation

@zalishchuk
Copy link

No description provided.

Copy link
Member

@chenjiahan chenjiahan left a comment

Choose a reason for hiding this comment

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

Could you provide some context for this new option? If the log is annoying, we should consider updating the message or removing it by default.

@zalishchuk
Copy link
Author

@chenjiahan I've added a custom plugin to warn/info about heavy plugins like ESLint/Stylelint or the Type Checker. Now, I want to change the severity to warn, so I can suppress the internal production build message about the plugin being enabled. This way, I can notify the developer myself using a custom severity level or not notify about the Type Check at all

I thought it would be helpful to allow the user the option to mute this message

Example:
image

@chenjiahan
Copy link
Member

Thanks for the explanation. I'd prefer not to add an option just to control one log line since it is not a general design. You could instead use logger.override in Rsbuild to filter the info logs: https://rsbuild.rs/api/javascript-api/core#custom-logger

@zalishchuk
Copy link
Author

Thanks for the tip, it worked. For anyone facing the same issue in the future when trying to suppress the Type Checker info, here is the solution:

const originalLoggerInfo = logger.info;
const TYPE_CHECKER_MESSAGE = 'Type checker is enabled. It may take some time.';
logger.override({
  info: (message, ...args) => {
    if (String(message).includes(TYPE_CHECKER_MESSAGE)) return;
    return originalLoggerInfo(message, ...args);
  },
});

@zalishchuk zalishchuk closed this Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants