-
Notifications
You must be signed in to change notification settings - Fork 10
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
Switch to use hermes-eslint
as the recommended parser
#33
Comments
Thanks, I've been sick these past few days but I'll look into this next weekend once I'm better |
@bradzacher Would you happen to have more information about the Edit: is it related to https://github.com/facebook/hermes? I am lost on the React Native part. 🤔 |
Sorry, we probably could spruce up the docs.. Or rather add any docs at all heh. I'll look at doing that next week! Hermes is Meta's JavaScript VM. It's primarily used to power react native. This parser is built with first-class support of flow syntax and its designed with performance in mind.
Unlike babel, At Meta we have been using In terms of using it - nothing special is required. Just install the package and set |
Thanks, @bradzacher! Want to give it a try! 👍 Is |
@mrtnzlml For the |
Ah, right, I didn't realize this. Very cool! 😊 Thanks for your help! |
Hi @bradzacher doing some testing here, works pretty well on my source code but when I parse my dist (which people normally don't) with hermes-eslint it crashes but with @babel/eslint-parser it does not Also going through the limited docs
But the code snippet references |
If you can isolate the code that's crashing then I can get this fixed up! It looks like it was a property. The docs are wrong sorry. I forgot to go and get them update this week sorry. I'll make a note to do it on Monday. |
@bradzacher just fyi I haven't forgotten this change! I'm just waiting for doc updates before I start digging into this further |
weird - I did cleanup the docs, but for some reason they didn't publish with the release. |
Just published v0.9.0 with the updated docs. |
Also as an aside, @Brianzchen, we could convert this repo to use flow if you wanted. Internally at meta we have over 400 rules written with flow types! It's a much nicer experience authoring ESLint rules with types 😄! |
I mentioned this in flow-typed#33, but I figured I'd get the ball rolling and show what it can look like. These types allow us to strictly type the lint rules so that they - only use the latest ESLint APIs - declare a strict and complete rule object - correctly declare tests - safely access AST node properties This PR also switches to `hermes-eslint` (as per flow-typed#33). cc @mrtnzlml
Hey there, I trying out a migration from I had to disable the For instance on line breaks: foo?:
| Foo
| Bar |
@pascalduez working on the upgrade now. Looks like there are some rules that definitely need fixing and on top of that will need to run assertions tests on both babel and hermes... |
We just released v0.8.0 of
hermes-eslint
.As of this release we have full support for ESLint 8+ - meaning we support the latest ESTree syntax for class properties, class private properties and optional chaining.
hermes-eslint
also has a fully-featured scope analyser which understands flow types. This means that the rulesft-flow/define-flow-type
andft-flow/use-flow-type
are no longer needed! Also fun side-note that the rulesreact/jsx-uses-react
andreact/jsx-uses-vars
are not needed because the analyser also supports JSX!Worth noting that this will also reveal a bunch of
no-undef
errors in codebases because types are now analysed by the lint rule and types like$ReadOnly
are global and have no global declared by ESLint. Sono-undef
should ideally be turned off in the recommended config. Flow checks this anyway, so it's a superfluous rule.The text was updated successfully, but these errors were encountered: