Clarified misleading example in "Configuring plugins" section #452
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When I first read through the docs "chronologically", it really confused me to reach the "Plugins" docs and see the list of available plugins with their "default" check marks, because the React plugin didn't have one. The comment right above my change says literally that all those enabled plugins in this example are "enabled by default", which is wrong. I am by no means a Rust expert, but I am pretty sure that this line here defines the default-enabled plugins to be OXC, Unicorn and TypeScript: https://github.com/oxc-project/oxc/blob/42de3d14da0a1c4f1a80c9e692627e928d556389/crates/oxc_linter/src/config/plugins.rs#L61, which means that the "Plugins" docs' table is correct, and this example config's comment here is not.
An alternative change would be to change the comment (instead of the code) to something like
// Enable the React plugin, in addition to the default plugins
. This would also implicitly highlight the fact once more that theplugins
array needs to contain all enabled plugins, including the ones that are enabled out of the box.