-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Closed
Labels
acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussionautofixThis change is related to ESLint's autofixing capabilitiesThis change is related to ESLint's autofixing capabilitiesbugESLint is working incorrectlyESLint is working incorrectlyruleRelates to ESLint's core rulesRelates to ESLint's core rules
Description
Tell us about your environment
Node version: v10.16.3
npm version: v6.12.0
Local ESLint version: v6.6.0
Global ESLint version: v6.6.0
What did you expect to happen?
rule of prefer-const
mess up in multiple function.
the config is:
"prefer-const": [
"warn",
{
"destructuring": "all",
"ignoreReadBeforeAssign": true
}
],
file a.js
function a (){
let foo =0;
foo = 1;
}
function b (){
let foo =0;
foo = 1;
}
function c (){
let foo =0;
foo = 1;
}
will eslint --fix
output as
function a (){
let foo =0;
foo = 1;
}
function b (){
const foo =0;
foo = 1;
}
function c (){
const foo =0;
foo = 1;
}
Are you willing to submit a pull request to fix this bug?
Can't help with resolution.
Metadata
Metadata
Assignees
Labels
acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussionautofixThis change is related to ESLint's autofixing capabilitiesThis change is related to ESLint's autofixing capabilitiesbugESLint is working incorrectlyESLint is working incorrectlyruleRelates to ESLint's core rulesRelates to ESLint's core rules