gajus / gajus/eslint-plugin-flowtype

TypeError: globalScope.__defineGeneric is not a function on define-flow-type

Open
#524 6 comments 12 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.1k
Forks
151
PR merge metrics
No merged PRs in 30d

Description

Es lint errors when there is not defined type
```
Oops! Something went wrong! :(

ESLint: 8.31.0

TypeError: globalScope.__defineGeneric is not a function
Occurred while linting /home/st.cremer/Сайты/flow/src/services/training/trainingTypes.js:7
Rule: "flowtype/define-flow-type"
at makeDefined (/home/st.cremer/Сайты/flow/node_modules/eslint-plugin-flowtype/dist/rules/defineFlowType.js:21:21)
at GenericTypeAnnotation (/home/st.cremer/Сайты/flow/node_modules/eslint-plugin-flowtype/dist/rules/defineFlowType.js:49:9)
at ruleErrorHandler (/home/st.cremer/Сайты/flow/node_modules/eslint/lib/linter/linter.js:1115:28)
at /home/st.cremer/Сайты/flow/node_modules/eslint/lib/linter/safe-emitter.js:45:58
at Array.forEach ()
at Object.emit (/home/st.cremer/Сайты/flow/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
at NodeEventGenerator.applySelector (/home/st.cremer/Сайты/flow/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
at NodeEventGenerator.applySelectors (/home/st.cremer/Сайты/flow/node_modules/eslint/lib/linter/node-event-generator.js:326:22)
at NodeEventGenerator.enterNode (/home/st.cremer/Сайты/flow/node_modules/eslint/lib/linter/node-event-generator.js:340:14)
at CodePathAnalyzer.enterNode (/home/st.cremer/Сайты/flow/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js:795:23)
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with ESLint 8.31.0 on src/services/training/trainingTypes.js:7 and the flowtype/define-flow-type rule. Start by reading node_modules/eslint-plugin-flowtype/dist/rules/defineFlowType.js at makeDefined and GenericTypeAnnotation, then verify the lint run completes without this TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
eslint, javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.