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

Move react/jsx-key to eslint-config-standard-react #47

Open
timdp opened this issue Oct 14, 2022 · 0 comments
Open

Move react/jsx-key to eslint-config-standard-react #47

timdp opened this issue Oct 14, 2022 · 0 comments

Comments

@timdp
Copy link

timdp commented Oct 14, 2022

What version of this package are you using?

11.0.0

What problem do you want to solve?

I'm using eslint-config-standard-jsx with jsx-slack.

In this case, JSX renders to static JSON for consumption by the Slack API. It never re-renders. This makes the key property on lists useless in this case (contrary to in React or e.g., Ink).

I've added { rules: { 'react/jsx-key': 'off' } } to my .eslintrc as a workaround but this does not make sense to me. The package's name only references JSX, not React or Ink, and should therefore not assume that the virtual DOM is always going to need reconciliation.

What do you think is the correct solution to this problem?

Remove the rule from this package and move it into the React one.

This does of course mean that users of Ink and other "dynamic" JSX renderers will lose the rule. I'll concede that "static" JSX is a bit of an edge case, so as an alternative, maybe that should be spun off into a separate eslint-config-standard-jsx-static or equivalent.

Are you willing to submit a pull request to implement this change?

Sure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant