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

Commit 44f55d5

Browse files
author
Jeremy Wiebe
committed
Merge branch 'develop' into add-markdown-linting
2 parents 549e750 + b506c43 commit 44f55d5

File tree

9 files changed

+176
-47
lines changed

9 files changed

+176
-47
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Pending Release
22
- Remove `variable-for-property` rule from sass-lint
33
- Adds markdown linting via `lint-md` script
4+
- Add ESLint and Atom Text integration how-to doc
45

56
2.6.0
67
- Remove `variable-for-property` rule from sass-lint [#126](https://github.com/mobify/mobify-code-style/pull/126)

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ Make sure to install the following NPM modules:
8989
- `eslint-import-resolver-webpack`
9090
- `eslint-plugin-react` (for React/JSX linting only)
9191

92+
## ESLint and Atom
93+
94+
Find out how to integrate [ESLint and Atom Text](./javascript/atom.md).
95+
9296
## CSS
9397
Our Client Services team's [CSS Style Guide](/css/Readme.md). Written with a lot of tender care by @kpeatt and @jeffkamo.
9498

assets/atom-linter-settings.png

125 KB
Loading

assets/linting-in-atom.gif

228 KB
Loading

css/class-naming-conventions/readme.md

Lines changed: 120 additions & 47 deletions
Large diffs are not rendered by default.

es5/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ This folder includes a default ESLint configuration, `mobify-es5.yml`, compatibl
44

55
# General
66

7+
## ESLint and Atom
8+
9+
Find out how to integrate [ESLint and Atom Text](../javascript/atom.md).
10+
711
##Comments
812

913
Please comment code extensively. More comments are always better than fewer comments. Comments should describe the why of your code - not what the code is doing:

es6/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ JSX accessibility linting is available with the `mobify-es6-react-a11y.yml` conf
1414
- `eslint-plugin-react`
1515
- `eslint-plugin-jsx-a11y`
1616

17+
## ESLint and Atom
18+
19+
Find out how to integrate [ESLint and Atom Text](../javascript/atom.md).
20+
21+
*NOTE*: While these instructions use the code style's ES5 config file, an ES6 file may be alternatively
22+
substituted. Mobify's ES6-compatible projects will have their own `.eslintrc.yml` config file, which
23+
will be enforced by Atom and `linter-eslint`.
24+
1725
## Global Names and Environments
1826

1927
By default, the lint configuration only assumes the standard set of

javascript/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ with ESLint 1.x or lower.**
66
**For new projects or ESLint 2.x and up, use the contents of the `mobify-code-style/es5` directory**
77

88
# General
9+
10+
## ESLint and Atom
11+
12+
Find out how to integrate [ESLint and Atom Text](./atom.md).
13+
914
##Comments
1015

1116
Please comment code extensively. More comments are always better than fewer comments. Comments should describe the why of your code - not what the code is doing:

javascript/atom.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
Now restart Atom and open a JS file to see it in action.
32+
33+
*Tip*: When working on a project that does not need to conform to this code style,
34+
toggle the linter off/on by opening the command palette with <kbd>shift</kbd>+<kbd>⌘</kbd>+<kbd>p</kbd> (Mac) or <kbd>shift</kbd>+<kbd>ctrl</kbd>+<kbd>p</kbd> (PC) and type + select `Linter: Toggle`

0 commit comments

Comments
 (0)