Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-27007

JavaScript linter poorly formats generator functions

    XMLWordPrintable

Details

    • Bug
    • Status: Backlog
    • Minor - P4
    • Resolution: Unresolved
    • None
    • None
    • None
    • Fully Compatible
    • ALL

    Description

      Generator functions aren't formatted in a sane manner. Here's an example of how an anonymous generator function would be formatted with the current formatting rules:

      -    docs: function *() {
      -           for (let i = 0; i < 100; i++) {
      -               yield {};
      -           }
      -    },
      +    docs: function *
      +        () {
      +            for (let i = 0; i < 100; i++) {
      +                yield{};
      +            }
      +        },
      

      Specifically, I'm requesting that both the asterisk/newline spacing be fixed to one line, and another space added between the yield keyword and the subsequent expression.

      Attachments

        Activity

          People

            backlog-server-devplatform Backlog - Server Development Platform Team (SDP)
            kyle.suarez@mongodb.com Kyle Suarez
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated: