Linting (Development Environment Part 2) & Bonus: Other Fun Atom Packages!
Tags: javascript, webdev, linters
Published: 2017-10-24 15:57:40

---
title: "Linting (Development Environment Part 2) & Bonus: Other Fun Atom Packages!"
published: true
tags: JavaScript, Web Dev, Linters
---

Wouldn’t it be awesome if there was something that helped enforce styles to help avoid pitfalls in a language? There is! It’s called a linter. Today we are going to add a linter to our project.

[In our last episode we installed Atom, and set up a basic ‘hello world’ app](https://www.dailydrip.com/blog/hello-world-with-js-and-setting-up-your-development-environment). Today, we going to dive into Atom a little bit more, and use Atom to add a linter to our project.

First, go to ‘Preferences’ in Atom.

![image alt text](https://dailydrip-assets.s3.amazonaws.com/DailyDrip/blog_posts/linting-dev-env/image_0.png)

Now, the settings/preferences screen will pop up, and click the ‘Install’ tab. Then, type ‘linter’ into the search bar, and click install on it. ![image alt text](https://dailydrip-assets.s3.amazonaws.com/DailyDrip/blog_posts/linting-dev-env/image_1.png)

You have now installed the base Linter for Atom. Read more about the [Linter package on Atom’s website.](https://atom.io/packages/linter) Now that we have the base installed we need to install the linter package specific to the language we wanted linited, which is Javascript. So, for today we will try out the [‘prettier-atom’](https://atom.io/packages/prettier-atom) package for our javascript linting needs. Search, and install ‘prettier-atom’.

The ‘prettier-atom’ package is based on [Prettier](https://prettier.io/), an opinionated code formatter. Using a Linter will help enforce styles, either for aesthetic reasons or (more commonly) to help avoid pitfalls in a language, and help you be a more efficient programmer.

Now that you have the linter packages installed, let’s test them out. Make a new file called test.js.

```sh

touch test.js

```

Then, put this JavaScript code in the file:

```javascript

matrix(

  1, 2, 3,

)

```

Now, if you press ‘CRTL’ + ‘ALT’ + ‘F’ Prettier will work its magic.

![image alt text](https://dailydrip-assets.s3.amazonaws.com/DailyDrip/blog_posts/linting-dev-env/image_2.png)

As you can see Prettier has made the code more aesthetically pleasing, and added a semicolon. Prettier adds a semicolon to the end of every statement when the semicolon option is set to True. Prettier also enforces that no class gets too big. You can see all the ways Prettier will format your code on the [Prettier GitHub Repository](http://aesthetic).

If you want a certain part of your code to not be formatted with Prettier simply add ‘// prettier-ignore’ on the line above the code you would like to not be formatted.

```javascript

// prettier-ignore

matrix(

  1, 2, 3,

)

```

Now, if you try ‘CRTL’ + ‘ALT’ + ‘F’ the prettier formatter will know to not edit the statement below the comment ‘// prettier-ignore

If you want to learn more about linters read [A Case for Linters]([https://www.dailydrip.com/blog/a-case-for-linters](https://www.dailydrip.com/blog/a-case-for-linters)) in the DailyDrip blog, or try using [coala](https://www.dailydrip.com/topics/coala).

# Bonus: Other Fun Atom Packages!

I couldn't help but include my other three favorite atom plugins.

1. [Activate Power Mode](https://atom.io/packages/activate-power-mode) - Next time you get bored coding activate power mode! This is a fun plugin that adds firework animations while you type. I personally don’t like the screen shaking part, so I have it deactivated.

2. [Pigments](https://atom.io/packages/pigments) - If you are messing around with a lot of CSS, Pigments is a must. This plugin shows you the color of any rgb color in your code.

3. [Atom-Clock](https://atom.io/packages/atom-clock) - A handy customizable clock to help remind you what month it is.

The previous post in the [JavaScript Zero Series](https://www.dailydrip.com/blog?tag=JavaScriptZero) is [Hello World with JS and Setting up your Development Environment](https://www.dailydrip.com/blog/hello-world-with-js-and-setting-up-your-development-environment)

The previous post in the [JavaScript Zero Series](https://www.dailydrip.com/blog?tag=JavaScriptZero) is [Hello World with JS and Setting up your Development Environment](https://www.dailydrip.com/blog/hello-world-with-js-and-setting-up-your-development-environment) [Join me in learning JavaScript on DailyDrip's Community Slack on the JavaScript channel.](http://join-community.dailydrip.com/)

This was originally posted on [dailydrip.com](https://www.dailydrip.com/admin/posts/linting-development-environment-part-2-bonus-other-fun-atom-packages).