Next.js Discord

Discord Forum

Prettier keeps breaking chained calls to new lines

Unanswered
Egyptian Mau posted this in #help-forum
Open in Discord
Egyptian MauOP
Prettier keeps breaking chained calls to new lines

How can I prevent it from doing so?
const fieldErrors = _.chain(errors).groupBy('param').mapValues((i) => i.map((i) => i.message)).value()


turns into

const fieldErrors = _.chain(errors)
  .groupBy('param')
  .mapValues((i) => i.map((i) => i.message))
  .value()


{
  "printWidth": 120,
  "semi": false,
  "singleQuote": true,
  "trailingComma": "es5",
  "plugins": ["@trivago/prettier-plugin-sort-imports"],
  "importOrder": [
    ".*\\.css$",
    "^~(?:\/.*)?$",
    "^next(?:\/.*)?$",
    "^react(?:\/.*)?$",
    "^lucide-react(?:\/.*)?$",
    "^lodash(?:\/.*)?$",
    "^@sentry(?:\/.*)?$",
    "^@radix-ui(?:\/.*)?$",
    "^@/components(?:\/.*)?$",
    "^@(?:\/.*)?$",
    "<THIRD_PARTY_MODULES>"
  ],
  "importOrderSeparation": true,
  "importOrderSortSpecifiers": true
}

0 Replies