0

I'm looking for a way to stop self-closing tag like

<link rel='stylesheet' />

to

<link re='stylesheet'></link>.

It's always become self-closing. I tried to remove save action in settting.json and add

"react/self-closing-comp": ["error", {
  "component": false,
  "html": false
}]

into tslint.json, but it still not working.

thienms98
  • 167
  • 1
  • 10
  • 1
    when does it become self closing? Upon running formatting? Upon autocompletion? (if so- at what point- after typing what?) – starball Jun 27 '23 at 07:48
  • 1
    Why? A [``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link) element *is* an empty, void element and has no closing tag, from MDN: "*As it is a void element, the start tag must be present and the end tag must not be present.*" – David Thomas Jun 27 '23 at 07:48
  • The reason is Prettier. Turn it off on settings.json https://stackoverflow.com/questions/65105287/how-to-stop-prettier-from-using-the-old-self-closing-tag-syntax – thienms98 Jun 27 '23 at 07:49

0 Answers0