Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit 8e846e9

Browse files
author
Marlow Payne
committed
✨ Add instructions for linting JS in Atom
1 parent 56cb31c commit 8e846e9

3 files changed

Lines changed: 33 additions & 0 deletions

File tree

assets/atom-linter-settings.png

125 KB
Loading

assets/linting-in-atom.gif

228 KB
Loading

javascript/atom.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# ESLint and Atom Text
2+
3+
![Linting in Atom](../../assets/linting-in-atom.gif "Linting in Atom")
4+
5+
Instead of relying on your project's linting tasks (`grunt lint` or `npm run lint`), wouldn't it be better to have Atom proactively linting your JS as you compose it, using Mobify's code style as a ruleset? Here's how!
6+
7+
## Prerequisites
8+
9+
1. Install Node.js and NPM with [NVM](https://github.com/creationix/nvm)
10+
1. Install eslint and Mobify's code style globally:
11+
```bash
12+
npm install -g eslint
13+
npm install -g mobify-code-style
14+
```
15+
16+
## Instructions for Atom
17+
18+
1. Install the [linter package](https://atom.io/packages/linter)
19+
1. Install the [linter-eslint package](https://atom.io/packages/linter-eslint)
20+
1. Open your Atom package settings for `linter-eslint` and ensure:
21+
* Your `ESLint Path` is set
22+
* Find your ESLint path by running `which eslint` in a terminal
23+
* Your `.eslintrc Path` is set to the ES5 config file from Mobify's code style
24+
* This config is the fallback for when an existing ESLint config does not exist in the current project
25+
* Your `Global Node Installation Path` is set
26+
* Find this by running `npm get prefix` in a terminal
27+
28+
Your Atom settings will look something like this:
29+
![Atom Linter Settings](../../assets/atom-linter-settings.png "Atom Linter Settings")
30+
31+
1. Restart Atom
32+
1. Open a JS file and see if it works!
33+
1. Profit!

0 commit comments

Comments
 (0)