Skip to content

Conversation

@pipopotamasu
Copy link
Contributor

@pipopotamasu pipopotamasu commented Oct 28, 2025

Summary:

Implements: #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 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)

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
image

@meta-cla
Copy link

meta-cla bot commented Oct 28, 2025

Hi @pipopotamasu!

Thank you for your pull request and welcome to our community.

Action Required

In 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.

Process

In 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 CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

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"
Copy link
Contributor Author

@pipopotamasu pipopotamasu Oct 28, 2025

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

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 28, 2025
@meta-cla
Copy link

meta-cla bot commented Oct 28, 2025

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Oct 28, 2025
Copy link

@tysoncung tysoncung left a 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.

Copy link

@tysoncung tysoncung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@huntie huntie left a 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.)

@meta-codesync
Copy link

meta-codesync bot commented Oct 30, 2025

@huntie has imported this pull request. If you are a Meta employee, you can view this in D85851077.

@pipopotamasu
Copy link
Contributor Author

@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

@huntie
Copy link
Member

huntie commented Nov 3, 2025

@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.

@react-native-bot
Copy link
Collaborator


Warnings
⚠️ ❗ JavaScript API change detected - This PR commits an update to ReactNativeApi.d.ts, indicating a change to React Native's public JavaScript API. Please include a clear changelog message. This change will be subject to extra review.

This change was flagged as: BREAKING

Generated by 🚫 dangerJS against 1b6f1e3

@pipopotamasu
Copy link
Contributor Author

Warnings
⚠️ ❗ JavaScript API change detected - This PR commits an update to ReactNativeApi.d.ts, indicating a change to React Native's public JavaScript API. Please include a clear changelog message. This change will be subject to extra review.
This change was flagged as: BREAKING

Generated by 🚫 dangerJS against 1b6f1e3

Hmm, danger is flagging the merge commit of main branch as BREAKING change. I think this is a false-positive warning

@meta-codesync meta-codesync bot closed this in 1859245 Nov 13, 2025
@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Nov 13, 2025
@meta-codesync
Copy link

meta-codesync bot commented Nov 13, 2025

@huntie merged this pull request in 1859245.

@react-native-bot
Copy link
Collaborator

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?

douglowder pushed a commit to react-native-tvos/react-native-tvos that referenced this pull request Nov 15, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants