Editor Setup
Last updated
Was this helpful?
Last updated
Was this helpful?
A properly configured editor can make code clearer to read and faster to write. It can even help you catch bugs as your write them! If this is your first time setting up an editor or you’re looking to tune up your current editor, we have a few recommendations.
is one of the most popular editors in use today. It has a large marketplace of extensions and integrates well with popular services like GitHub. Most of the features listed below can be added to VS Code as extensions as well, making it highly configurable!
Other popular text editors used in the React community include:
—an integrated development environment designed specifically for JavaScript.
—has support for JSX and TypeScript, syntax highlighting and autocomplete built in.
—a highly configurable text editor built to make creating and changing any kind of text very efficient. It is included as “vi” with most UNIX systems and with Apple OS X.
Some editors come with these features built in, but others might require adding an extension. Check to see what support your editor of choice provides to be sure!
Code linters find problems in your code as you write, helping you fix them early. is a popular, open source linter for JavaScript.
The last thing you want to do when sharing your code with another contributor is get into an discussion about ! Fortunately, will clean up your code by reformatting it to conform to preset, configurable rules. Run Prettier, and all your tabs will be converted to spaces—and your indentation, quotes, etc will also all be changed to conform to the configuration. In the ideal setup, Prettier will run when you save your file, quickly making these edits for you.
You can install the by following these steps:
Launch VS Code
Use Quick Open (press CTRL/CMD + P
)
Paste in ext install esbenp.prettier-vscode
Press enter
Ideally, you should format your code on every save. VS Code has settings for this!
In VS Code, press CTRL/CMD + SHIFT + P
.
Type “settings”
Hit enter
In the search bar, type “format on save”
Be sure the “format on save” option is ticked!
Prettier can sometimes conflict with other linters. But there’s usually a way to get them to run nicely together. For instance, if you’re using Prettier with ESLint, you can use eslint-prettier plugin to run prettier as an ESLint rule.