0

My jsx looks like this:

 div className = "App" >
        <
        Navbar / >
        <
        main className = "main-content position-relative max-height-vh-100 h-100 mt-1 border-radius-lg " >

        {
            /* nav show */ } <
        nav className = "navbar navbar-main navbar-expand-lg px-0 mx-4 shadow-none border-radius-xl"
        id = "navbarBlur"
        navbar - scroll = "true" >
        <
        div className = "container-fluid py-1 px-3" >
        <
        nav aria - label = "breadcrumb" >
        <
        ol className = "breadcrumb bg-transparent mb-0 pb-0 pt-1 px-0 me-sm-6 me-5" >
        <
        li className = "breadcrumb-item text-sm" >
        <
        a className = "opacity-5 text-dark"
        href = "javascript:;" >
        Pages <
        /a> < /

I've uninstalled all formatters. I'm using vscode. How do I get back to normal code? All online formatters don't work.

ouflak
  • 2,458
  • 10
  • 44
  • 49
whatever
  • 31
  • 1
  • Ctrl + Z doesnt work? – Suraj Rao Oct 02 '21 at 06:35
  • Is the file a `.js` or `.jsx`? Really should avoid `.js`, it's harder for tools to detect that's what you're using. It's also not valid JS, so it shouldn't be in a `.js` file. That's probably your issue. – rschristian Oct 02 '21 at 09:24

2 Answers2

1

1. Install Prettier

here is the link: https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode

2. Set the formatter

Press Ctrl + Shift + P and select Format Document With.... And then select Prettier.

enter image description here

3. Change the language mode

At the bottom change, the format to Javascript React.

enter image description here

Amini
  • 1,620
  • 1
  • 8
  • 26
0

Just simply add this line to your vscode:

setting.json    
{
 "editor.formatOnSave": true
}
ouflak
  • 2,458
  • 10
  • 44
  • 49
nltbao
  • 1
  • 1