-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[New]: forbid-dom-props
: support React Strict Dom elements (html.div
, etc)
#3946
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
base: master
Are you sure you want to change the base?
[New]: forbid-dom-props
: support React Strict Dom elements (html.div
, etc)
#3946
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3946 +/- ##
==========================================
- Coverage 97.84% 97.72% -0.12%
==========================================
Files 136 133 -3
Lines 10008 9999 -9
Branches 3717 3720 +3
==========================================
- Hits 9792 9772 -20
- Misses 216 227 +11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Note: the failing checks seems to be related to other rules this PR is not chaning: |
interesting, i'd never heard of this before. seems like an evolution of react-native-web? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like something that needs to be behind an option - i assume that the lowercase only works because of the .
? (meaning that const { div } = html; <div />
wouldn't work?
@ljharb re RSD: RSD is alternative approach for React Native + Web codesharing. RN Web took RN-first approach, while RSD takes. web-first approach. re impl: Since RSD closely resembles regular DOM elements, I though that |
I think either one is fine as long as it's behind an option, since this is an official react offering (if it was unofficial, then it should go in the component rule for sure) |
@ljharb how should I implement such option? Is it an extra param for the rule, like |
Summary
Add suport for React Strict DOM notation of DOM nodes:
html.div
,html.span
,h.h1
, etcDetails
The code is based on
forbid-component-props
rule that already supportedNamespace.Component
notation.Testing
Added pass/fail tests for
html.div
,h.span
, etc