-
Notifications
You must be signed in to change notification settings - Fork 25k
Add support for Flat Config (eslint v9) #54297
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
Conversation
|
Hi @pipopotamasu! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
| "eslint-plugin-jest": "^29.0.1", | ||
| "eslint-plugin-react": "^7.30.1", | ||
| "eslint-plugin-react-hooks": "^5.2.0", | ||
| "eslint-plugin-react-native": "^4.0.0" |
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.
Upgraded eslint-plugin-react-native because v4 doesn't support eslint v9
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
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 is an excellent PR that addresses a critical need for ESLint 9 compatibility. The implementation is well-structured with backward compatibility maintained.
tysoncung
left a comment
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.
LGTM
huntie
left a comment
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.
LGTM and have confirmed that the eslint-plugin-react-native 4→5 diff is structural only.
(Sidenote: Wow, we should both aim to upstream this pkg and simplify our config. But let's not change this now.)
|
@huntie Thank you for your quick review and approval. Looks like some Facebook internal CI checks failed. Feel free to tell me if you want me to fix something to pass these checks |
|
@pipopotamasu Working on it (any dep bumps need re-syncing/alignment within our main repo). I'll reach out if there are any functional errors from this change. |
|
Hmm, danger is flagging the merge commit of |
|
This pull request was successfully merged by @pipopotamasu in 1859245 When will my fix make it into a release? | How to file a pick request? |
Summary: Implements: facebook/react-native#42996 Add support for Flat config (eslint v9) to `eslint-config-react-native`. To achieve this, I created `packages/eslint-config-react-native/flat.js` to export flat config as well as maintain legacy config for backward compatibility. I recognize we have had [the PR for supporting Flat config](facebook/react-native#42996) already, but it looks stale and doesn't seem likely to move forward. That's why I created this PR. I also updated `eslint-plugin-react-native` and `eslint-plugin-specs` so that they comply with the current eslint plugin format. ## Changelog: [GENERAL] [ADDED] - Add support for Flat Config (eslint v9) Pull Request resolved: facebook/react-native#54297 Test Plan: 1. Pull this branch into your local machine 2. `cd packages/eslint-config-react-native` 3. `yarn link` 4. Clone https://github.com/pipopotamasu/rn-eslint-config-test in your local machine 5. `cd path/to/rn-eslint-config-test` 6. `yarn install` 7. `yarn link "react-native/eslint-config"` 8. `yarn lint` 9. Confirm that eslint rules from `react-native/eslint-config` are applied <img width="1470" height="628" alt="image" src="https://github.com/user-attachments/assets/955fd655-8a79-4dd4-9031-e505d218d63a" /> Reviewed By: vzaidman Differential Revision: D85851077 Pulled By: huntie fbshipit-source-id: 9c78ecc4f5c3b10175a89417628b599735f95215
Summary:
Implements: #42996
Add support for Flat config (eslint v9) to
eslint-config-react-native. To achieve this, I createdpackages/eslint-config-react-native/flat.jsto export flat config as well as maintain legacy config for backward compatibility. I recognize we have had the PR for supporting Flat config already, but it looks stale and doesn't seem likely to move forward. That's why I created this PR.I also updated
eslint-plugin-react-nativeandeslint-plugin-specsso that they comply with the current eslint plugin format.Changelog:
[GENERAL] [ADDED] - Add support for Flat Config (eslint v9)
Test Plan:
cd packages/eslint-config-react-nativeyarn linkcd path/to/rn-eslint-config-testyarn installyarn link "@react-native/eslint-config"yarn lint@react-native/eslint-configare applied