Skip to content
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

fix(eslint-config): switch to new babel parser #34020

Closed
wants to merge 4 commits into from

Conversation

Kerumen
Copy link
Contributor

@Kerumen Kerumen commented Jun 17, 2022

Summary

babel-eslint is deprecated now. We should use the new Babel parser.

Changelog

[General] [Fixed] - Use new Babel parser instead of deprecated one

Test Plan

Ensure lint is working as expected.

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Jun 17, 2022
@facebook-github-bot
Copy link
Contributor

@jacdebug has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@analysis-bot
Copy link

analysis-bot commented Jun 17, 2022

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,824,049 +31
android hermes armeabi-v7a 7,211,097 +37
android hermes x86 8,134,514 +30
android hermes x86_64 8,114,560 +33
android jsc arm64-v8a 9,690,968 +21
android jsc armeabi-v7a 8,446,911 +22
android jsc x86 9,642,197 +26
android jsc x86_64 10,239,256 +22

Base commit: ea29ae1
Branch: main

@cortinico
Copy link
Contributor

Thanks for sending this over @Kerumen

This is sadly not sufficient. Please check another other similar attempt here:

We need to update all the references of babel-eslint in the codebase

@Kerumen
Copy link
Contributor Author

Kerumen commented Jun 17, 2022

@cortinico I don't see a lot of reference. Maybe I should also update the test here?

@cortinico
Copy link
Contributor

@cortinico I don't see a lot of reference. Maybe I should also update the test here?

A quick grep returns this:

rg "babel-eslint"
CHANGELOG.md
2835:- Upgrade babel-eslint to 9.0.0 ([44dc283bcd](https://github.com/facebook/react-native/commit/44dc283bcd0a75826d9be86cdc727e32d5697ef2) by [@rafeca](https://github.com/rafeca))
2966:- Upgrade babel-eslint to v9.0.0-beta.2 with better support for Flow ([abf1188de2](https://github.com/facebook/react-native/commit/abf1188de225e4b7d36ecbad316af92ca29c85c2) by [@rubennorte](https://github.com/rubennorte))

yarn.lock
1780:babel-eslint@^10.1.0:
1782:  resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232"

repo-config/package.json
19:    "babel-eslint": "^10.1.0",

packages/eslint-config-react-native-community/yarn.lock
403:babel-eslint@^10.1.0:
405:  resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232"

packages/eslint-config-react-native-community/package.json
17:    "babel-eslint": "^10.1.0",

packages/eslint-config-react-native-community/index.js
39:      parser: 'babel-eslint',

packages/eslint-plugin-react-native-community/__tests__/eslint-tester.js
15:  parser: require.resolve('babel-eslint'),

packages/eslint-plugin-specs/__tests__/eslint-tester.js
15:  parser: require.resolve('babel-eslint'),

@Kerumen
Copy link
Contributor Author

Kerumen commented Jun 17, 2022

The only important one here are repo-config/package.json and packages/eslint-plugin-specs. Should I update them? I don't know what repo-config is doing.

@cortinico
Copy link
Contributor

Should I update them? I don't know what repo-config is doing.

Yeah the should all be updated.

repo-config is the yarn workspace for the whole repository

@Kerumen
Copy link
Contributor Author

Kerumen commented Jun 17, 2022

@cortinico Done! ✅

@cortinico
Copy link
Contributor

@cortinico Done! ✅

Great 👍 The problem is that now we need to make the CI green

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: ea29ae1
Branch: main

@Kerumen
Copy link
Contributor Author

Kerumen commented Jun 17, 2022

The CI is green now! 🟢

Here is what I did:

  • I added requireConfigFile: false as it's needed since Babel v11
  • I added @babel/preset-flow for eslint-plugin-specs as it tests Flow code with some Flow syntax
  • I added missing @babel/core in eslint-config

@cortinico
Copy link
Contributor

The CI is green now! 🟢

Here is what I did:

  • I added requireConfigFile: false as it's needed since Babel v11
  • I added @babel/preset-flow for eslint-plugin-specs as it tests Flow code with some Flow syntax
  • I added missing @babel/core in eslint-config

Awesome stuff! We'll re-import this and we should be fine merging it 👍

@facebook-github-bot
Copy link
Contributor

@jacdebug has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@ghost
Copy link

ghost commented Jun 21, 2022

Any progress here? 🚀

@cortinico
Copy link
Contributor

Any progress here? 🚀

Sadly not. I've been trying to merge this PR internally, but our setup related to babel is quite intricate and it's more challenging than expected.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @Kerumen in 97291bf.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label Jun 22, 2022
@cortinico
Copy link
Contributor

Kudos to @jacdebug for unblocking this 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 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