fix: modify the criteria for verifying the Rsdoctor plugin#2992
fix: modify the criteria for verifying the Rsdoctor plugin#2992chenjiahan merged 1 commit intomainfrom
Conversation
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
0fafa80 to
8b3a132
Compare
|
|
||
| let isAutoRegister = false; | ||
|
|
||
| function isRsdoctorPlugin(plugin: Configuration['plugins'] & { isRsdoctorPlugin?: boolean }) { |
There was a problem hiding this comment.
function -> const + arrow function
| (plugin) => plugin?.constructor?.name === pluginName, | ||
| // If user has add Rsdoctor plugin in config file, will return. | ||
| const registered = config.plugins?.some( | ||
| (plugin) => isRsdoctorPlugin(plugin as unknown as Configuration['plugins'] & { isRsdoctorPlugin?: boolean }) || plugin?.constructor?.name === pluginName, |
There was a problem hiding this comment.
We can move the plugin?.constructor?.name === pluginName to isRsdoctorPlugin() helper.
There was a problem hiding this comment.
We can move the
plugin?.constructor?.name === pluginNametoisRsdoctorPlugin()helper.
@chenjiahan I just worry about remove the plugin?.constructor?.name === pluginName may be a break change.
There was a problem hiding this comment.
No, I mean move the logic to the function, not to remove it.
| (plugin) => plugin?.constructor?.name === pluginName, | ||
| // If user has add Rsdoctor plugin in config file, will return. | ||
| const registered = config.plugins?.some( | ||
| (plugin) => isRsdoctorPlugin(plugin as unknown as Configuration['plugins'] & { isRsdoctorPlugin?: boolean }) || plugin?.constructor?.name === pluginName, |
There was a problem hiding this comment.
We can declare a type to reuse it
| (plugin) => isRsdoctorPlugin(plugin as unknown as Configuration['plugins'] & { isRsdoctorPlugin?: boolean }) || plugin?.constructor?.name === pluginName, | |
| type MaybeRsdoctorPlugin = Configuration['plugins'] & { isRsdoctorPlugin?: boolean }) |
6e9fedf to
5743aac
Compare
fix: rsdoctor plugin fix: rsdoctor plugin feat: support add plugins for specified environment (#2986) Co-authored-by: neverland <jait.chen@foxmail.com> Update packages/core/src/plugins/rsdoctor.ts Co-authored-by: neverland <chenjiahan.jait@bytedance.com> Update packages/core/src/plugins/rsdoctor.ts Co-authored-by: neverland <chenjiahan.jait@bytedance.com> Update packages/core/src/plugins/rsdoctor.ts Co-authored-by: neverland <chenjiahan.jait@bytedance.com> fix: modify the criteria for verifying the Rsdoctor plugin. fix: modify the criteria for verifying the Rsdoctor plugin.
5743aac to
248a059
Compare

Summary
fix: modify the criteria for verifying the Rsdoctor plugin.
Related Links
Checklist