DEV Community

Eddy Bobbin
Eddy Bobbin

Posted on

2 3

Atom editor with linter, prettier and all the stuff you need

Finally, my working atom editor setup for javascript

Recently, I setup my atom editor because of a React javascript project. What I knew from work (my fellow teammembers use VSCode there) is there are some nice tools like linter and prettier to keep your code clean, error free and readable. Some of those things remind me of the typical IntelliJ IDEA tools (e.g. Firebug, Checkstyle and so on).
However I didn't find a good instruction or tutorial to make all the stuff work. So I tried a bit around and here is what I got for all those who have the same trouble I had:

Prerequisites

This tutorial is optimized for unix- based clients which have a bash or similar. However, you can use this setup on other machines as well but I did not test it for them.

Required atom packages

  • Install required atom packages with
apm install linter \ 
linter-eslint \
linter-ui-default \
busy-signal \
intentions \
prettier-atom \

Atom settings

  • Open the editor and the settings by pressing CTRL + Comma
  • Go to packages and filter for prettier-atom and click settings
  • Enable the options ESlint integration and Format files on save

Test your setup

To test the setup, I created a new react-app by executing npx create-react-app test-app and imported it into atom editor.
When saving an edited file with obvious errors (unused import, newlines, single vs double quotes), I can see the editor shows me linter warnings and autoformats things on save:

linter and autoformat

The create-react-app setup inherits a default eslint config from the react packages. If you wish to override these with your own settings, you can create a .eslintrc file in your project root.

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (1)

Collapse
 
ibrahimkamal profile image
Ibrahim Kamal

Thank you so much, but How to use single quotes instead of double quotes?

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay