8

I use ESLint with prettier (running eslint with --fix formats the code according to ESLint rules).

I want to have have exports always multiline. I have tried every combination I can think of, but the result doesn't add up.

Related ESLint rule: https://eslint.org/docs/rules/object-curly-newline

What I want is this:

Before formatting:

export { a, b, c, d } 

After formatting:

export {
  a,
  b,
  c,
  d
}

If it's a single export, either would be fine:

export { a }
// Or
export {
  a
}

Is it possible to have --fix do this? The closest I can get is:

export {
  a, b, c, d
}

0

Browse other questions tagged or ask your own question.