Skip to content

Commit

Permalink
Fix defineFlowType getting scope on older version (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brianzchen authored Feb 15, 2024
1 parent edf6c2e commit 74bc494
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "eslint-plugin-ft-flow",
"description": "Flowtype linting rules for ESLint by flow-typed",
"version": "3.0.4",
"version": "3.0.5",
"license": "MIT",
"main": "./dist/index.js",
"repository": {
Expand Down
3 changes: 1 addition & 2 deletions src/rules/defineFlowType.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ const create = (context) => {
}
},
Program(node) {
const newGetScope = context.sourceCode.getScope;
if (newGetScope) {
if (context.sourceCode?.getScope) {
globalScope = context.sourceCode.getScope(node);
} else {
globalScope = context.getScope();
Expand Down

0 comments on commit 74bc494

Please sign in to comment.