setPost" /> setPost" /> setPost"/>

How can I make prettier put HTML/JSX attributes on the same line up to a specific length?

70 views Asked by At

prettier do this auto newline

<TextField
  name="message"
  variant="outlined"
  label="Message"
  fullWidth
  value={postData.message}
  onChange={(e) => setPostData({ ...postData, message: e.target.value })}
/>

what, i want like this can prettier do this?

<TextField
  name="message" variant="outlined" label="Message" fullWidth value={postData.message}
  onChange={(e) => setPostData({ ...postData, message: e.target.value })}
/>
1

There are 1 answers

0
Behemoth On

The closest you can get is

That way everything will be placed in one line. Anything that exceeds these requirements is not configurable with Prettier alone.