-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[No QA] fix for eslint bug #15261 #22597
[No QA] fix for eslint bug #15261 #22597
Conversation
@allroundexperts Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
Reviewer Checklist
Screen.Recording.2023-07-11.at.10.08.28.PM.movScreenshots/VideosWebMobile Web - ChromeMobile Web - SafariDesktopiOSAndroid |
.eslintrc.js
Outdated
{ | ||
name: 'react-native', | ||
importNames: ['useWindowDimensions', 'StatusBar', 'TouchableOpacity', 'TouchableWithoutFeedback', 'TouchableNativeFeedback', 'TouchableHighlight'], | ||
message: `If you're using following components from react native:\n |
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.
NAB: I find this format is more readable:
message: [
"For 'useWindowDimensions', please use 'src/hooks/useWindowDimensions' instead.",
"For 'TouchableOpacity', 'TouchableWithoutFeedback', 'TouchableNativeFeedback', 'TouchableHighlight', please use 'PressableWithFeedback' and/or 'PressableWithoutFeedback' from 'src/components/Pressable' instead.",
"For 'StatusBar', please use 'src/libs/StatusBar' instead.",
].join('\n'),
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.
Hi @blazejkustra, I edited the message format as you suggested. But I think adding one more new line at top, makes it more readable. So, in VS code the final result seems like the following:
Thank you for your advice.
This comment was marked as outdated.
This comment was marked as outdated.
.eslintrc.js
Outdated
paths: [ | ||
{ | ||
name: 'react-native', | ||
importNames: ['useWindowDimensions', 'StatusBar', 'TouchableOpacity', 'TouchableWithoutFeedback', 'TouchableNativeFeedback', 'TouchableHighlight'], |
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.
I think you missed to include Pressable
?
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.
thanks @allroundexperts you're right, my mistake.
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.
One minor change needed.
looks like there's a prettier diff that needs to be committed |
@HLEDYA Can you please fix the lint error? |
@roryabraham, @allroundexperts: sorry guys |
No worries. I usually run |
Hi @roryabraham! |
FWIW I have my editor configured to run prettier whenever I save. It's pretty easy to set up that way and then I never think about formatting my code. Just type and press |
🚀 Deployed to staging by https://github.com/roryabraham in version: 1.3.40-0 🚀
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
@HLEDYA @allroundexperts @roryabraham Can you pls QA this internally? |
@mvtglobally this should have been marked as |
Thank you @roryabraham, I also enabled format on save for my VS code ide. |
🚀 Deployed to production by https://github.com/Julesssss in version: 1.3.40-5 🚀
|
Details
Only the last restricted import from the same path is checked and others are ignored when there are multiple imports due to the eslint bug
Fixed Issues
$ #22459
PROPOSAL: #22459 (comment)
Tests
Offline tests
Same steps above
QA Steps
Same steps above
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Since it is not a UI issue, no ui screenshots are added. Eslint gives console error when a restricted component is used as shown in the following:
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android