Closed
Description
Tell us about your environment
- ESLint Version: 5.8.0/master
- Node Version: n/a
- npm Version: n/a
What parser (default, Babel-ESLint, etc.) are you using?
default
Please show your full configuration:
Configuration
{
rules: {"no-else-return": 2}
}
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
function foo(){
let bar = 0;
if(cond) {
return bar;
} else {
let bar = 1;
return bar;
}
}
What did you expect to happen?
not fix to incorrect code.
What actually happened? Please include the actual, raw output from ESLint.
fixed code:
function foo(){
let bar = 0;
if(cond) {
return bar;
}
let bar = 1;
return bar;
}
7:13 error Parsing error: Identifier 'bar' has already been declared
Are you willing to submit a pull request to fix this bug?
yes, but I don't have time to do it in the following days. please feel free to take it if someone else have interests.