TristonJ / eslint-plugin-prefer-arrow

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

prefer-arrow-functions rule autofix breaks generators #8

Closed DmitriySpirit closed 5 years ago

DmitriySpirit commented 5 years ago

Try adding the following to the invalid section of unit tests: ['function generatorFunction() { return yield 1; }', 'function generatorFunction() { return yield 1; }'] The test will fail because produced code will look like this: const* test = () => yield 1; The generator function can not be translated to the const like definition. So all generator functions must be skipped.