Skip to content

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

@timdp

Description

@timdp

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions