Skip to content

Empty lines added between JSdoc and following arrow function definition #14563

@matthieusieben

Description

@matthieusieben

Prettier 2.8.6
Playground link

Input:

const createIdFilter =
  /** @param {string} id */
  (id) =>
  /** @param {any} s */
  (s) => s.id === id

Output:

const createIdFilter =
  /** @param {string} id */

    (id) =>
    /** @param {any} s */
    (s) =>
      s.id === id

Expected behavior:

No new line should be added between an inline jsdoc block and the following arrow function. In my local env (custom eslint config + prettier/prettier) there are actually two new lines:

const createIdFilter =
  /** @param {string} id */


    (id) =>
    /** @param {any} s */
    (s) =>
      s.id === id

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:commentsIssues with how Prettier prints commentslang:javascriptIssues affecting JS

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions