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

hermes-eslint missing __defineGeneric in context getScope #1285

Closed
Brianzchen opened this issue Jan 27, 2024 · 1 comment
Closed

hermes-eslint missing __defineGeneric in context getScope #1285

Brianzchen opened this issue Jan 27, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Brianzchen
Copy link

Bug Description

Hello, I maintain eslint-plugin-ft-flow and have this issue. There is a rule that calls __defineGeneric which comes from create function's context.getScope or context.sourceCode.getScope(node). The problem is with flow users being recommended to use hermes-eslint over @babel/eslint-parser this function does not exist in hermes-eslint and is throwing errors that __defineGeneric is not a function.

What do you recommend is the appropriate replacement function here or is it something that's mistakeningly missing from hermes.

Thank you!
cc @pieterv

Steps To Reproduce

  1. Clone https://github.com/flow-typed/eslint-plugin-ft-flow/tree/missing-define-generic
  2. Checkout to the branch missing-define-generic
  3. Run yarn to install dependencies
  4. Run yarn test:rules to see the errors
  5. Rule in question can be found in src/rules/defineFlowType.js and you can modify it before running yarn test:rules again

code example:

The Expected Behavior

It does not error

@Brianzchen Brianzchen added the bug Something isn't working label Jan 27, 2024
@Brianzchen
Copy link
Author

Actually scratch that, managed to rewrite our function without the need for __defineGeneric here flow-typed/eslint-plugin-ft-flow#50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant