简体   繁体   中英

How to config Prettier to line break className attribute in React

This is the original code with Prettier applied:

<div
  role="menubar"
  className="absolute top-0 left-0 z-50 h-0 mt-10 grid grid-cols-3 gap-x-3 gap-y-5 "
>
</div>

This is my expected code result:

<div
  role="menubar"
  className="absolute top-0 left-0 z-50 
             h-0 mt-10 grid grid-cols-3 
             gap-x-3 gap-y-5 "
>
</div>

Could anyone recommend the solution?

Check out the Print Width attribute in prettier.

It allows you to specify after how many letters the line should wrap.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM