-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Rule proposal: ensure style prop on DOM element tags is an object #715
Labels
Comments
Name: |
I can work on this |
petersendidit
added a commit
to petersendidit/eslint-plugin-react
that referenced
this issue
Aug 8, 2016
petersendidit
added a commit
to petersendidit/eslint-plugin-react
that referenced
this issue
Aug 13, 2016
petersendidit
added a commit
to petersendidit/eslint-plugin-react
that referenced
this issue
Aug 13, 2016
petersendidit
added a commit
to petersendidit/eslint-plugin-react
that referenced
this issue
Aug 13, 2016
petersendidit
added a commit
to petersendidit/eslint-plugin-react
that referenced
this issue
Aug 21, 2016
petersendidit
added a commit
to petersendidit/eslint-plugin-react
that referenced
this issue
Aug 21, 2016
petersendidit
added a commit
to petersendidit/eslint-plugin-react
that referenced
this issue
Aug 22, 2016
yannickcr
pushed a commit
that referenced
this issue
Aug 22, 2016
fson
added a commit
to fson/create-react-app
that referenced
this issue
Sep 21, 2016
New rules: * `react/no-danger-with-children` (jsx-eslint/eslint-plugin-react#710) * `react/no-find-dom-node` (jsx-eslint/eslint-plugin-react#678) * `react/style-prop-object` (jsx-eslint/eslint-plugin-react#715)
gaearon
pushed a commit
to facebook/create-react-app
that referenced
this issue
Sep 22, 2016
* Update eslint-plugin-react and enable new rules New rules: * `react/no-danger-with-children` (jsx-eslint/eslint-plugin-react#710) * `react/no-find-dom-node` (jsx-eslint/eslint-plugin-react#678) * `react/style-prop-object` (jsx-eslint/eslint-plugin-react#715) * Remove react/no-find-dom-node for now
feiqitian
pushed a commit
to feiqitian/create-react-app
that referenced
this issue
Oct 25, 2016
* Update eslint-plugin-react and enable new rules New rules: * `react/no-danger-with-children` (jsx-eslint/eslint-plugin-react#710) * `react/no-find-dom-node` (jsx-eslint/eslint-plugin-react#678) * `react/style-prop-object` (jsx-eslint/eslint-plugin-react#715) * Remove react/no-find-dom-node for now
rrdelaney
pushed a commit
to rrdelaney/reason-scripts
that referenced
this issue
May 23, 2018
* Update eslint-plugin-react and enable new rules New rules: * `react/no-danger-with-children` (jsx-eslint/eslint-plugin-react#710) * `react/no-find-dom-node` (jsx-eslint/eslint-plugin-react#678) * `react/style-prop-object` (jsx-eslint/eslint-plugin-react#715) * Remove react/no-find-dom-node for now
sven3270350
added a commit
to sven3270350/react-typescript
that referenced
this issue
Aug 11, 2022
* Update eslint-plugin-react and enable new rules New rules: * `react/no-danger-with-children` (jsx-eslint/eslint-plugin-react#710) * `react/no-find-dom-node` (jsx-eslint/eslint-plugin-react#678) * `react/style-prop-object` (jsx-eslint/eslint-plugin-react#715) * Remove react/no-find-dom-node for now
OrdinalKing
pushed a commit
to OrdinalKing/create-react-app-ts-redux-saga-mui
that referenced
this issue
Aug 26, 2022
* Update eslint-plugin-react and enable new rules New rules: * `react/no-danger-with-children` (jsx-eslint/eslint-plugin-react#710) * `react/no-find-dom-node` (jsx-eslint/eslint-plugin-react#678) * `react/style-prop-object` (jsx-eslint/eslint-plugin-react#715) * Remove react/no-find-dom-node for now
SmartCodiDev
added a commit
to SmartCodiDev/redux-saga-mui
that referenced
this issue
May 31, 2024
* Update eslint-plugin-react and enable new rules New rules: * `react/no-danger-with-children` (jsx-eslint/eslint-plugin-react#710) * `react/no-find-dom-node` (jsx-eslint/eslint-plugin-react#678) * `react/style-prop-object` (jsx-eslint/eslint-plugin-react#715) * Remove react/no-find-dom-node for now
Kumljevx1
added a commit
to Kumljevx1/create-react-app
that referenced
this issue
Aug 26, 2024
* Update eslint-plugin-react and enable new rules New rules: * `react/no-danger-with-children` (jsx-eslint/eslint-plugin-react#710) * `react/no-find-dom-node` (jsx-eslint/eslint-plugin-react#678) * `react/style-prop-object` (jsx-eslint/eslint-plugin-react#715) * Remove react/no-find-dom-node for now
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
React will issue a warning in dev if you pass a non-object to the
style
prop on DOM element tagshttps://github.com/facebook/react/blob/85dcbf83/src/renderers/dom/shared/ReactDOMComponent.js#L204-L207
This should be easy enough to enforce for most cases with a linter rule.
Bad:
Good:
It would be even nicer if it validated that the values of the style object are all strings.
The text was updated successfully, but these errors were encountered: