gajus / gajus/eslint-plugin-flowtype

Flow generics trigger no-shadow rule

Open
#275 4 comments 3 reactions 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
1.1k
Forks
151
PR merge metrics
No merged PRs in 30d

Description

Declarations like:
```
export function foo(bar: T) {
return bar
}
```

are marked by the linter as `'T' is already declared in the upper scope. (no-shadow)`

Versions:
```
"babel-eslint": "8.0.0",
"eslint": "4.7.2",
"eslint-config-airbnb": "15.1.0",
"eslint-config-prettier": "2.6.0",
"eslint-plugin-flowtype": "2.36.0",
"eslint-plugin-import": "2.7.0",
"eslint-plugin-jsx-a11y": "6.0.2",
"eslint-plugin-prettier": "2.3.1",
"eslint-plugin-react": "7.4.0",
"flow-bin": "0.55.0",
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported no-shadow warning with the Flow generic declaration and the listed ESLint, babel-eslint, and Flow versions. Trace how the no-shadow rule handles the generic type parameter; done means valid declarations like foo no longer produce the warning while genuine shadowing remains reported.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.