Skip to content

[feat] no-mix-controlled-with-uncontrolled and no-only-value-prop #1030

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rakleed opened this issue Apr 1, 2025 · 1 comment
Open

[feat] no-mix-controlled-with-uncontrolled and no-only-value-prop #1030

rakleed opened this issue Apr 1, 2025 · 1 comment
Labels
Status: Triaging Issue is still being evaluated. PRs not yet accepted. Type: New Rule Introduce a new rule

Comments

@rakleed
Copy link
Contributor

rakleed commented Apr 1, 2025

Describe the problem

https://github.com/kotarella1110/eslint-plugin-react-form-fields doesn't work in flat config and ESLint@9, so it would be nice to port or make similar rules in your plugin.

Also, it would be nice to support UI libraries like MUI, Ant Design, Mantine UI, etc.

Describe the solution you'd like

No response

Alternatives considered

No response

Additional context

No response

@Rel1cx
Copy link
Owner

Rel1cx commented Apr 1, 2025

I personally would like to have these two rules. The first rule was previously proposed in #486 with a different name. However, under the premise of not compromising the plugin's original scope and abstraction layers (to ensure that the react-x plugin doesn't need to focus on platform-specific details or intricacies within third-party UI libraries), implementing these two rules in eslint-plugin-react-x and keeping them synchronized with component props mapping from third-party UI libraries could be quite challenging.

After #486 was proposed, I began conceptualizing a method to provide specs for components and props of UI libraries through external configurations. These configurations would describe the mapping relationships between the user-defined components, user-defined component props, in the UI library and their corresponding host elements, host element attributes. This includes a controlled property to indicate whether a prop is controlled or uncontrolled. Theoretically, this would allow us to implement such rules in eslint-plugin-react-x without breaking the plugin's original scope and abstraction layer, making them applicable beyond just React DOM Additionally, since these configurations are externally supplied to eslint-plugin-react-x, when the configurations provided by eslint-react become outdated, users can overwrite them with updated configurations based on their project's UI library. This ensures the rules correctly recognize components from these UI libraries without waiting for eslint-react updates and releases.

@Rel1cx Rel1cx added Status: Triaging Issue is still being evaluated. PRs not yet accepted. Type: New Rule Introduce a new rule labels Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triaging Issue is still being evaluated. PRs not yet accepted. Type: New Rule Introduce a new rule
Projects
None yet
Development

No branches or pull requests

2 participants