0

How can I turn my code on save

 return (
    <div>
      <h2>{counter}</h2>
      <button className="btn" onClick={handleClick} type="button" style={{ marginTop: '20px' }}
      >
        increase
      </button>
    </div>
  )

into this format in vscode I use prettier but it didnt work.

return (
    <div>
      <h2>{counter}</h2>
      <button
        className="btn"
        onClick={handleClick}
        type="button"
        style={{ marginTop: '20px' }}
      >
        increase
      </button>
    </div>
  )

1 Answers1

0

You should be able to do it with prettier. Go to the prettier extension settings and look for the "Single Attribute Per Line" setting and make sure that it is enabled. By default, it is turned off.