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

JavaScript linter poorly formats generator functions

    • Server Development Platform
    • ALL

      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:

      Unable to find source-code formatter for language: diff. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      -    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.

            Assignee:
            backlog-server-devplatform [DO NOT ASSIGN] Backlog - Server Development Platform Team (SDP) (Inactive)
            Reporter:
            kyle.suarez@mongodb.com Kyle Suarez
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: