Search code examples
javascriptreactjseslintprettier

React Prettier auto fix of self-closing


React JSX

<Hello><Hello/>

to

<Hello/>

How can I fix code with prettier when I save code on VS code? Which setting should I edit?


Solution

  • install eslint-plugin-react. For reference please check below link

    https://github.com/yannickcr/eslint-plugin-react

    Hope this will help you.