-
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
[HOLD] Destructure props of all function components by adding an ESLint rule running the linter with --fix #22671
Comments
Triggered auto assignment to @trjExpensify ( |
Bug0 Triage Checklist (Main S/O)
|
@hayata-suenaga Why not add the rule now in TS setup PR? If we put it in rules for TS files, we wouldn't have to run eslint --fix at all. When migrating components to TS we could remove defaultProps and use prop destructuring. |
I was thinking doing that but @roryabraham suggested we ran and if we gonna do that, we should probably do that in a separate PR |
I don't feel strongly either way, but figured since the rule supports |
I was worried how |
Will do this before the migration will start |
will put PR up tomorrow |
This is on hold for #20179 which will turn off an ESLint setting that conflicts with de-structured props |
now that #20179 has been merged, I'll work on this today |
Turned out that ESLint cannot fix all de-structuring rule violations automatically. These are only files where ESLint was able to fix code automatically. I also tried to run ESLint with the latest version (the current version specified in Current version confirmation
Running the latest ESLint. Still doesn't fix issues automatically @roryabraham what do you think? should we let migration PR also handle prop de-structuring? (we can specify the rule only for |
updated Rory about the limit of |
Closing this per this comment: https://expensify.slack.com/archives/C01GTK53T8Q/p1692139684018249?thread_ts=1689968108.162539&cid=C01GTK53T8Q |
HOLD on #20179
Per this discussion on changing the guideline to always requiring prop destructuring to assign default values to optional props.
Add the following config
and run
--fix
The text was updated successfully, but these errors were encountered: