| Summary: | Update no-redeclare quickfix to handle duplicated arguments | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Michael Rennie <Michael_Rennie> |
| Component: | JS Tools | Assignee: | Olivier Thomann <Olivier_Thomann> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | Olivier_Thomann |
| Version: | unspecified | ||
| Target Milestone: | 13.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Michael Rennie
This rule collides with the "no-redeclare" rule.
So for the examples given in the documentation,
/*eslint-env browser */
function foo(a, b, a) {
console.log("value of the second a:", a);
}
var bar = function(a, b, a) {
console.log("value of the second a:", a);
};
the second 'a' is reported as being already declared which is good enough. I think I will just update the quickfix to be able to rename the variable.
The page http://eslint.org/demo/ shows that 'a' is reported as a no-redeclare error and a no-dup-args error. I don't mind keeping both, but I think one of them is enough as long as the quickfix can also handle function arguments which is not the case now. (In reply to Olivier Thomann from comment #2) > The page http://eslint.org/demo/ shows that 'a' is reported as a > no-redeclare error and a no-dup-args error. I don't mind keeping both, but I > think one of them is enough as long as the quickfix can also handle function > arguments which is not the case now. I agree, two rules that mark the same thing seems excessive. Updating title accordingly. For the duplicate arguments issue, the quickfix will only rename the argument without trying to rename all identifiers that match the duplicate argument name as it is not clear which ones match to the first argument or the duplicated one. |