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 __defineGeneric not a function #50

Merged
merged 5 commits into from
Jan 27, 2024
Merged

Conversation

Brianzchen
Copy link
Member

Closes #49 by rewriting the way we identify and then add flow types as defined to the eslint scope

@Brianzchen Brianzchen merged commit 7e41249 into master Jan 27, 2024
3 checks passed
@Brianzchen Brianzchen deleted the missing-define-generic branch January 27, 2024 23:25
Comment on lines +68 to +73
const newGetScope = context.sourceCode.getScope;
if (newGetScope) {
globalScope = context.sourceCode.getScope(node);
} else {
globalScope = context.getScope();
}
Copy link

Choose a reason for hiding this comment

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

@Brianzchen context.sourceCode can be undefined in older versions of eslint so this code causes the following error: TypeError: Cannot read properties of undefined (reading 'getScope').

I think you want something like:

      if (context.sourceCode != null && context.sourceCode.getScope != nul) {
        globalScope = context.sourceCode.getScope(node);
      } else {
        globalScope = context.getScope();
      }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

globalScope.__defineGeneric is not a function
2 participants