Skip to content

migrate to ESLint flat config, convert to ESM#4737

Merged
Simek merged 13 commits into
react:mainfrom
Simek:esm-and-eslint-flat-config
Sep 12, 2025
Merged

migrate to ESLint flat config, convert to ESM#4737
Simek merged 13 commits into
react:mainfrom
Simek:esm-and-eslint-flat-config

Conversation

@Simek

@Simek Simek commented Aug 18, 2025

Copy link
Copy Markdown
Collaborator

Why

Refactor and migrate to flat config ESLint v9 setup. Convert monorepo to ESM to leverage properly minimal required Node version and simplify linting.

How

Upgrade ESLint to v9, convert setup to flat config, remove redundant stand-alone Prettier checks.

In the process, I have also:

  • reorganized the repository structure, so all scripts are placed in scripts directory, and all monorepo packages resides in packages directory
  • fixed lint-examples packages scripts, and formatted ./docs files using it
  • fixed sync-api-docs packages, it runs correctly, but looks like no files in core repo contain @generate-docs annotation anymore
  • fixed and re-enabled remark-lint-no-broken-external-links check plugin for unversioned docs via new script which should be run locally
  • fixed and hooked up image-check script
  • fixed Snack remark plugin tests

Future TODOs

  • fix LLMS generation (it's not working properly on PROD, see https://reactnative.dev/llms.txt)
  • figure out SCSS linting (@eslint/css cannot parse SCSS files yet), for now we only use stand-alone Prettier to format the files

Test plan

All lint checks and tests across monorepo are working and do not yield any errors. Website apps runs and builds as expected.

@netlify

netlify Bot commented Aug 18, 2025

Copy link
Copy Markdown

Deploy Preview for react-native ready!

Name Link
🔨 Latest commit 9dfd849
🔍 Latest deploy log https://app.netlify.com/projects/react-native/deploys/68c19e9e229c3c000874d83e
😎 Deploy Preview https://deploy-preview-4737--react-native.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Simek Simek marked this pull request as ready for review August 26, 2025 09:59
@Simek Simek requested a review from cortinico August 26, 2025 09:59
@clicktodev

Copy link
Copy Markdown
Contributor

can you make sure ide detection still works? because the eslint extension in vscode sometimes stops working when migrating to eslint v9

here's an example

@Simek

Simek commented Sep 9, 2025

Copy link
Copy Markdown
Collaborator Author

Thanks for bringing this up! 👍 Usually, in-IDEs detection problems reflects the issues in the lint config definition, or monorepo/workspace setup on users machine.

For this PR, I have tested the following editors (also with MD/MDX content, not only for JS/CJS/MJS/TS as seen on screenshots below):

  • JetBrains IDEA
Screenshot 2025-09-09 at 16 25 19
  • VS Code
Screenshot 2025-09-09 at 16 26 43
  • Zed
Screenshot 2025-09-09 at 16 27 51

@clicktodev

Copy link
Copy Markdown
Contributor

awesome, it seems as long as the eslint config is exported from the root of the project then it's correctly detected by IDEs, so in the case of nextra i needed to reexport from root it because it's defined in a package

@robhogan robhogan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is some really nice cleanup and modernisation, thanks!

@Simek Simek merged commit be4b5d9 into react:main Sep 12, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants