-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Description
Environment
Node version: 16.16.0
npm version: 8.11.0
Local ESLint version: 8.41.0
Global ESLint version: 8.41.0
Operating System: RHEL 7
What parser are you using?
Default (Espree)
What did you do?
Configuration
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "script",
"ecmaFeatures": {}
},
"rules": {
"block-scoped-var": [
"error"
]
},
"env": {
"es2021": true
}
}
define([], function() {
if (true) {
var myvar = 10;
} else if (true) {
var myvar = 10;
} else if (true) {
var myvar = 10;
} else if (true) {
var myvar = 10;
}
});
What did you expect to happen?
Error for each line should be reported only once
What actually happened?
Error for each line is reported 3 times
Link to Minimal Reproducible Example
Participation
- I am willing to submit a pull request for this issue.
Additional comments
Errors reported:
Error 3:11
'myvar' used outside of binding context. (block-scoped-var)
Error 3:11
'myvar' used outside of binding context. (block-scoped-var)
Error 3:11
'myvar' used outside of binding context. (block-scoped-var)
Error 5:11
'myvar' used outside of binding context. (block-scoped-var)
Error 5:11
'myvar' used outside of binding context. (block-scoped-var)
Error 5:11
'myvar' used outside of binding context. (block-scoped-var)
Error 7:11
'myvar' used outside of binding context. (block-scoped-var)
Error 7:11
'myvar' used outside of binding context. (block-scoped-var)
Error 7:11
'myvar' used outside of binding context. (block-scoped-var)
Error 9:11
'myvar' used outside of binding context. (block-scoped-var)
Error 9:11
'myvar' used outside of binding context. (block-scoped-var)
Error 9:11
'myvar' used outside of binding context. (block-scoped-var)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status