TristonJ / eslint-plugin-prefer-arrow

ESLint plugin to prefer arrow functions
MIT License
54 stars 10 forks source link

function* expression not being detected #30

Closed marekdedic closed 2 years ago

marekdedic commented 3 years ago

Hi, I think the expression

var foo = function*() { return yield "bar"; };

should be an error with the default settings. However, it is not.

dkimmich-onventis commented 2 years ago

It's because you can't use arrow functions with generators, see https://stackoverflow.com/questions/27661306/can-i-use-es6s-arrow-function-syntax-with-generators-arrow-notation.

marekdedic commented 2 years ago

Oh, OK, that explains it, thanks :)