Skip to content

Disabling ignoring unused vars for _ prefix #1719

Description

@gaearon

We currently ignore unused vars with _ prefix, mainly as a workaround for deleting extra properties in ...rest destructuring. However #1705 is a proper fix for this, so I think we should remove the _ rule in the next major bump. This would fix #1387.

Activity

  1. added this to the milestone on Mar 5, 2017
  2. gaearon commented on Mar 6, 2017

    @gaearon
    ContributorAuthor

    Also, why do we have vars: 'local' rather than the default 'global' setting?

  3. sidoshi commented on Mar 7, 2017

    @sidoshi
    Contributor

    I can submit a PR.
    Though I am not sure about the vars setting. Can't find a use case of having an unused global variable.

  4. gaearon commented on Mar 7, 2017

    @gaearon
    ContributorAuthor

    If you could go through the git blame history for who added it and why, that could help. Or maybe there was no good reason at all.

  5. sidoshi commented on Mar 7, 2017

    @sidoshi
    Contributor

    Seems like there was no good reason.
    It was there since custom eslint rules were added in the begining. See #27

  6. gaearon commented on Mar 7, 2017

    @gaearon
    ContributorAuthor

    We probably took it here then. Would be nice to learn why Airbnb config specifies this.

  7. gaearon commented on Mar 7, 2017

    @gaearon
    ContributorAuthor

    Maybe @ljharb could say!

  8. jamesblight commented on Mar 8, 2017

    @jamesblight
    Contributor

    The default setting in eslint was local at the time Airbnb set their config. Eslint later changed the default to all (global) and I'm guessing Airbnb never updated.

    Edit: For context this is why it changed from local to all

  9. sidoshi commented on Mar 8, 2017

    @sidoshi
    Contributor

    @gaearon should the vars setting be set to default?

  10. gaearon commented on Mar 8, 2017

    @gaearon
    ContributorAuthor

    Yea.

  11. sidoshi commented on Mar 8, 2017

    @sidoshi
    Contributor

    see #1763

  12. ljharb commented on Mar 15, 2017

    @ljharb

    This setting certainly predates my involvement with the Airbnb config. I can't see any reason not to change it to "all" - can someone file an issue, or better, send a PR explaining the rationale?

  13. gaearon commented on May 11, 2017

    @gaearon
    ContributorAuthor

    @doshisid Do you mind following up with @ljharb and raising an issue in Airbnb ESLint config repo too?

  14. gaearon commented on May 11, 2017

    @gaearon
    ContributorAuthor

    Fixed by #1763.

  15. sidoshi commented on May 11, 2017

    @sidoshi
    Contributor

    Sure, I'll do it.

  16. locked and limited conversation to collaborators on Jan 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions