• Don’t use generators for now.

  • If you must use generators, or if you disregard our advice, make sure their function signature is spaced properly. eslint:

    1. // bad
    2. function * foo() {
    3. // ...
    4. // bad
    5. const bar = function * () {
    6. // ...
    7. };
    8. // bad
    9. const baz = function *() {
    10. // ...
    11. };
    12. const quux = function*() {
    13. // ...
    14. };
    15. // bad
    16. function*foo() {
    17. // ...
    18. }
    19. // bad
    20. function *foo() {
    21. }
    22. // very bad
    23. function
    24. *
    25. // ...
    26. }
    27. // very bad
    28. const wat = function
    29. *
    30. () {
    31. // ...
    32. };
    33. // good
    34. function* foo() {
    35. // ...
    36. }
    37. // good
    38. const foo = function* () {
    39. };