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

Unexpected token * on generator methods #1990

Closed
steadicat opened this issue Mar 9, 2015 · 8 comments
Closed

Unexpected token * on generator methods #1990

steadicat opened this issue Mar 9, 2015 · 8 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 core Relates to ESLint's core APIs and features

Comments

@steadicat
Copy link

Lint on the following fails with Unexpected token *:

class Foo {
  *bar() {
  }
}

This is the .eslintrc:

{
  "ecmaFeatures": {
    "classes": true,
    "generators": true
  }
}

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@nzakas
Copy link
Member

nzakas commented Mar 9, 2015

You need to also enable objectLiteralShorthandMethods

@nzakas nzakas closed this as completed Mar 9, 2015
@nzakas nzakas reopened this Mar 9, 2015
@nzakas
Copy link
Member

nzakas commented Mar 9, 2015

Oops, sorry, hit the wrong button. :) That should work, but I'm wondering if for some reason it's not getting past objectLiteralShorthandMethods. Can you try enabling that and see what happens? (This would actually be a parser bug rather than an ESLint one.)

@nzakas nzakas added the triage An ESLint team member will look at this issue soon label Mar 9, 2015
@steadicat
Copy link
Author

It still doesn't work (I had it in my .eslintrc, I mistakenly removed too much from my bug report).

@nzakas
Copy link
Member

nzakas commented Mar 9, 2015

Okay, can you file an Espree bug? https://github.com/eslint/espree.

@xjamundx
Copy link
Contributor

In eslint 0.17 I now see:

2:2  error  "bar" used outside of binding context  block-scoped-var

@nzakas
Copy link
Member

nzakas commented Mar 16, 2015

Yup, seems fixed so closing.

@nzakas nzakas closed this as completed Mar 16, 2015
@nzakas nzakas added bug ESLint is working incorrectly core Relates to ESLint's core APIs and features accepted There is consensus among the team that this change meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Mar 16, 2015
@xjamundx
Copy link
Contributor

Should I file a new bug for 2:2 error "bar" used outside of binding context block-scoped-var ?

@nzakas
Copy link
Member

nzakas commented Mar 16, 2015

I think that's already covered by an issue, but of not, yes.

@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 core Relates to ESLint's core APIs and features
Projects
None yet
Development

No branches or pull requests

3 participants