Skip to content
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

[feat] react-dom/no-unknown-property for MDX and other non-TS envs #846

Closed
karlhorky opened this issue Oct 29, 2024 · 2 comments
Closed
Labels
Status: Released The issue has been released Type: New Rule Introduce a new rule

Comments

@karlhorky
Copy link
Contributor

karlhorky commented Oct 29, 2024

Describe the problem

Similar to #834

I ran into an issue today that react-x/no-unknown-property is not implemented in eslint-plugin-react-x, as noted in #85:

The following can be enforced by TypeScript, no need to implement them

  • react/no-unknown-property

This causes problems for environments where TypeScript is not available

Eg. there is not yet full TypeScript support for MDX files, and it appears ESLint doesn't support multiple parsers for a set of files (eg. for trying to use typescript-eslint parser along with the MDX parser).

Describe the solution you'd like

It would be great to get react-x/no-unknown-property implemented for other languages like MDX? (and also just for completeness, for other situations where TypeScript cannot be used)

Alternatives considered

Keep using react/no-unknown-property via eslint-plugin-react

Additional context

Ideally, this rule would be implemented also with abilities to extend for other environments like React Three Fiber (a missing feature of react/no-unknown-property):

@Rel1cx
Copy link
Owner

Rel1cx commented Oct 30, 2024

I will add this rule, but as you mentioned, the issue of applicability across different environments, rather than adding options to rules, I think a better approach is to provide react-dom/no-unknown-property, similar to react/no-unknown-property, which is essentially a react-dom rule. Other environments (not necessarily provided by us) would offer corresponding react-native/no-unknown-property, react-three-fiber/no-unknown-property, etc.

This way, not only can the no-unknown-property rule in each environment be updated and released according to its own versioning cadence (to sync the propertires changes), but it also reduces the complexity of JS tool configurations, especially with ESLint, where we've heard too many complaints about overly complex configurations. This is one of the main reasons many users have switched from ESLint to biome, oxlint recently.

We believe that through better rule design and plugin positioning, we can avoid configuration complexity without sacrificing functionality.

@Rel1cx Rel1cx closed this as completed in 4e092d6 Oct 31, 2024
@Rel1cx Rel1cx added Status: Released The issue has been released Type: New Rule Introduce a new rule labels Nov 20, 2024
@karlhorky
Copy link
Contributor Author

@Rel1cx thanks, confirmed that react-dom/no-unknown-property works 🎉 (also with MDX files)

@karlhorky karlhorky changed the title [feat] react-x/no-unknown-property for MDX and other non-TS envs [feat] react-dom/no-unknown-property for MDX and other non-TS envs Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Released The issue has been released Type: New Rule Introduce a new rule
Projects
None yet
Development

No branches or pull requests

2 participants