Is it possible to enable plugins without overwriting default plugins? #16923
-
|
Hello! 👋 I'm looking to configure the [rules-of-hooks](https://oxc.rs/docs/guide/usage/linter/rules/react/rules-of-hooks.html#react-rules-of-hooks) plugin and I'm a bit confused by the docs. The plugin documentation shows this setup: {
"plugins": ["react"],
"rules": {
"react/rules-of-hooks": "error"
}
}However, the [OXC plugin page](https://oxc.rs/docs/guide/usage/linter/plugins.html#enabling-plugins-in-a-configuration-file) has this note:
My question is: if I add Or can I just configure the rule like this and keep the defaults? "rules": {
"react/rules-of-hooks": "error"
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
You don't need to specify all default plugins. Just configure the rule directly: {
"rules": {
"react/rules-of-hooks": "error"
}
}Oxlint will automatically enable the necessary plugin when you reference a rule from it. The So for your use case, the second approach (just adding the rule) is the correct one. |
Beta Was this translation helpful? Give feedback.
You don't need to specify all default plugins. Just configure the rule directly:
{ "rules": { "react/rules-of-hooks": "error" } }Oxlint will automatically enable the necessary plugin when you reference a rule from it. The
pluginsfield is only needed when you want to completely customize which plugins are active (e.g., to disable default plugins or enable all rules from a specific plugin at once).So for your use case, the second approach (just adding the rule) is the correct one.