Skip to content
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.

generator-star should ignore transpiled async/await functions #78

Closed
jonathanong opened this issue Apr 23, 2015 · 12 comments
Closed

generator-star should ignore transpiled async/await functions #78

jonathanong opened this issue Apr 23, 2015 · 12 comments

Comments

@jonathanong
Copy link

getting this error:

Expected no space before *  generator-star

instead, this rule should somehow be ignored with transpiled async/await functions

@hzoo
Copy link
Member

hzoo commented May 13, 2015

Should babel-eslint patch actual eslint rules?

@sebmck
Copy link
Contributor

sebmck commented May 13, 2015

Certainly not. It's way too risky as they change so much and it'd mostly require replacing the entire rule. I'm not sure if this specific issue can be addressed since you have to turn await expressions/async functions into something and the likely equivalent is a yield/generator.

@hzoo
Copy link
Member

hzoo commented May 13, 2015

Yeah agree. Although I guess people will ask since

I can speak for myself here: we aren't implementing experimental features. If you need such support in ESLint, you can use babel-eslint.

@hzoo hzoo added the question label May 15, 2015
@hzoo
Copy link
Member

hzoo commented Jun 3, 2015

I guess we'll just close for now?

@hzoo hzoo closed this as completed Jun 3, 2015
@jonathanong
Copy link
Author

would be great if there were a "known rule conflicts" list in the readme so i know just to not use this rule when using babel. no biggie.

@hzoo
Copy link
Member

hzoo commented Jun 4, 2015

@jonathanong That sounds like a good idea. I already made a comment about using the react plugin for jsx issues. Would you like to make a PR to start the list?

@matthewwithanm
Copy link

Instead of patching eslint rules, what about a babel plugin that adds comments to disable the rule for that expression (/*eslint-disable generator-star*/)?

@vslinko
Copy link

vslinko commented Jun 14, 2015

👍 for @matthewwithanm comment

@hzoo
Copy link
Member

hzoo commented Jun 14, 2015

@jonathanong Ok I added the rule to the Known Issues section of the readme.

Unless I'm misunderstanding how it would work, I don't get how the plugin would help with the errors? The babel plugin would transform your generated file to have the comments while the source file wouldn't have them - and eslint is usually run on the source file itself?

@hzoo
Copy link
Member

hzoo commented Jun 19, 2015

Just notifying people here that there's now a https://github.com/babel/eslint-plugin-babel - will try to reimplement rules as a plugin (similar to eslint-plugin-react). I will add a note in the readme about it.

@matthewwithanm
Copy link

@hzoo Awesome, thanks!

@mathieumg
Copy link

Apparently, this still happens even with babel/generator-star-spacing when you do static async myFunc() { for example. Will investigate and follow-up in the appropriate repo.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants