# es/no-generators

disallow generator function declarations

  • ✅ The following configurations enable this rule: plugin:es/no-new-in-es2015, plugin:es/restrict-to-es3, and plugin:es/restrict-to-es5

This rule reports ES2015 generator function declarations as errors.

# Examples

⛔ Examples of incorrect code for this rule:

/*eslint es/no-generators: error */ function* f1() {} const f2 = function*() {} const obj = { *f3() {} } class A { *f4() {} }
Now loading...

# 📚 References