Rules
no-context-provider
Full Name in eslint-plugin-react-x
Full Name in @eslint-react/eslint-plugin
Features
🔄
Presets
xrecommendedrecommended-typescriptrecommended-type-checked
Description
Replaces usages of <Context.Provider> with <Context>.
In React 19, you can render <Context> as a provider instead of <Context.Provider>.
In addition, it is recommended to enable the naming-convention/context-name rule to enforce consistent naming conventions for contexts.
Examples
Before
After
Implementation
Further Reading
See Also
no-forward-ref
Replaces usages offorwardRefwith passingrefas a prop.no-use-context
Replaces usages ofuseContextwithuse.