I've recently started coding with React, and I noticed immediately that VS Code is formatting my react files as follows, which is causing all kinds of warnings from the linter.
Index.js
class App extends Component {
render() {
return ( <
div className = "App" >
<
header className = "App-header" >
<
img src = {
logo
}
className = "App-logo"
alt = "logo" / >
<
p >
Edit < code > src / App.js < /code> and save to reload. < /
p > <
a className = "App-link"
href = "https://reactjs.org"
target = "_blank"
rel = "noopener noreferrer" >
Learn React <
/a> < /
header > <
/div>
);
}
}
I'm having trouble finding the Prettier setting or whatever other setting is causing this in the app, any suggestions?
Extensions (Note WSL Ubuntu Windows)
You need to choose the default formatter.
Ctrl+Shift+P(Win) or Cmd+Shift+P(Mac)
Just Install Preitter Extensions On VS CODE it will reformat all your file

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With