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

error in the generator-star-spacing rule #6528

Closed
romeovs opened this issue Jun 24, 2016 · 9 comments
Closed

error in the generator-star-spacing rule #6528

romeovs opened this issue Jun 24, 2016 · 9 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion triage An ESLint team member will look at this issue soon

Comments

@romeovs
Copy link

romeovs commented Jun 24, 2016

What version of ESLint are you using?

$ node_modules/.bin/eslint -v                                                                                                                                     
v2.13.1

What parser (default, Babel-ESLint, etc.) are you using?
babel-eslint
Please show your full configuration:

parser: babel-eslint
extends: standard
plugins:
  - flowtype

env:
  node: true
  mocha: true

rules:
  # allow dangling comma
  no-comma-dangle: off
  comma-dangle:
    - error
    - always-multiline

  flowtype/space-after-type-colon:
    - error
    - always

  flowtype/space-before-type-colon:
    - error
    - always

  no-var:
    - error

  no-console:
    - error

What did you do? Please include the actual source code causing the issue.
$ eslint src/
What did you expect to happen?
No error to happen, just lint.

What actually happened? Please include the actual, raw output from ESLint.

Got the error

/Users/romeo/code/go/foo/node_modules/eslint/lib/rules/generator-star-spacing.js:69
            while (token.value !== "*") {
                        ^

TypeError: Cannot read property 'value' of undefined
    at getStarToken (/Users/romeo/code/go/foo/node_modules/eslint/lib/rules/generator-star-spacing.js:69:25)
    at EventEmitter.checkFunction (/Users/romeo/code/go/foo/node_modules/eslint/lib/rules/generator-star-spacing.js:125:29)
    at emitOne (events.js:82:20)
    at EventEmitter.emit (events.js:169:7)
    at NodeEventGenerator.enterNode (/Users/romeo/code/go/foo/node_modules/eslint/lib/util/node-event-generator.js:40:22)
    at CodePathAnalyzer.enterNode (/Users/romeo/code/go/foo/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:607:23)
    at CommentEventGenerator.enterNode (/Users/romeo/code/go/foo/node_modules/eslint/lib/util/comment-event-generator.js:97:23)
    at Controller.traverser.traverse.enter (/Users/romeo/code/go/foo/node_modules/eslint/lib/eslint.js:905:36)
    at Controller.__execute (/Users/romeo/code/go/foo/node_modules/eslint/node_modules/estraverse/estraverse.js:397:31)
    at Controller.traverse (/Users/romeo/code/go/foo/node_modules/eslint/node_modules/estraverse/estraverse.js:501:28)
@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Jun 24, 2016
@romeovs romeovs changed the title error in the generator-star-spacing rule error in the generator-star-spacing rule Jun 24, 2016
@vitorbal
Copy link
Member

vitorbal commented Jun 24, 2016

Thanks, @romeovs! ESLint core rules don't support experimental features (async function is still stage 3). You should use the generator-star-spacing that is provided by the eslint-plugin-babel.

Let me know if that fixes the problem, and If you have any other questions feel free to drop by our Gitter chatroom and we will be happy to help with anything!

@romeovs
Copy link
Author

romeovs commented Jun 24, 2016

that fixes it!

@vitorbal
Copy link
Member

Glad to hear! :)

@michaelficarra
Copy link
Member

@vitorbal What made you think @romeovs was using an async function?

@romeovs Please post the actual source code, as requested in the template that you partially filled out.

@romeovs
Copy link
Author

romeovs commented Jun 24, 2016

I was using async functions to be clear.
The actual codebase I'm running this on so it's hard to tell where the problem originates from.

I can reproduce the bug on this snippet:

async function derp () {
  console.log('never gonna give you up')
}

but it does not occur on this one:

function derp () {
  console.log('never gonna let you down')
}

@vitorbal
Copy link
Member

@michaelficarra you're totally right, I just assumed it was since we've had a couple of similar issues these past weeks. Thanks for double-checking!

@ljharb
Copy link
Sponsor Contributor

ljharb commented Aug 6, 2016

Since async/await is now stage 4, should this be reopened?

@ilyavolodin
Copy link
Member

@ljharb It's still not implemented in Acorn/Espree, so I think we should hold off till we can actually implant this change.

@ljharb
Copy link
Sponsor Contributor

ljharb commented Aug 6, 2016

Sounds good! Linking to acornjs/acorn#441 and eslint/espree#287

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 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 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion triage An ESLint team member will look at this issue soon
Projects
None yet
Development

No branches or pull requests

6 participants