Skip to content

[feat] New rule react-dom/no-string-style-prop #1170

@karlhorky

Description

@karlhorky

Describe the problem

Copying over #85 (comment):


We're migrating most of our eslint-plugin-react rules to eslint-plugin-react-x, eslint-plugin-react-dom and eslint-plugin-react-naming-convention today, and I came across one other scenario for non-TypeScript environments like MDX:

The following correctness rules in eslint-plugin-react can be enforced by TypeScript with appropriate tsconfig.json settings:

  • react/style-prop-object

We have found it useful to be able to lint for incorrect style prop values in non-TS environments like MDX.

Describe the solution you'd like

The suggestion by @Rel1cx seems nice:

A no-string-style-prop rule can be added to eslint-plugin-react-x eslint-plugin-react-dom to enforce this.

Comment: #85 (comment)

Alternatives considered

--

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions