Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no-duplicate-param fails on function with two es6-destructured params and no named params #2148

Closed
hawkrives opened this issue Mar 27, 2015 · 5 comments
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly rule Relates to ESLint's core rules

Comments

@hawkrives
Copy link

This code:

function organizeValues([key, values], {words=false, profWords=false}={}) {
    let organizedValues = values.map(val => {
        if (val.startsWith('$')) {
            return val.toUpperCase()
        }
        // there's more stuff here
    })

    return [key, organizedValues]
}

produces this warning (among others):

<text>
  1:0   error    Duplicate param 'undefined'                    no-dupe-args

It shouldn't be producing any duplicate parameter warnings.


eslint -v: v0.17.1

@nzakas nzakas added bug ESLint is working incorrectly rule Relates to ESLint's core rules accepted There is consensus among the team that this change meets the criteria for inclusion labels Mar 27, 2015
@nzakas
Copy link
Member

nzakas commented Mar 27, 2015

Oops, looks like the rule is confused by destructed params. We will get this fixed.

@hawkrives
Copy link
Author

Thanks!

@nzakas
Copy link
Member

nzakas commented Mar 27, 2015

Working on this.

@nzakas nzakas closed this as completed in f9b0724 Mar 28, 2015
nzakas added a commit that referenced this issue Mar 28, 2015
Fix: no-dupe-args to work with destructuring (fixes #2148)
@rdy
Copy link

rdy commented Apr 20, 2015

This still fails if there are two levels of destructuring in the functions arguments.

function foo([{a}, {b}]) {
  return a + b;
}

Eslint fails with:

Message:
    Duplicate param 'undefined'.

eslint -v: v0.19.0

@nzakas
Copy link
Member

nzakas commented Apr 21, 2015

Please file a new issue

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 7, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly rule Relates to ESLint's core rules
Projects
None yet
Development

No branches or pull requests

3 participants