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

Latest commit

 

History

History
34 lines (25 loc) · 1.61 KB

atom.md

File metadata and controls

34 lines (25 loc) · 1.61 KB

ESLint and Atom Text

Linting in Atom

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!

Prerequisites

  1. Install Node.js and NPM with NVM
  2. Install eslint and Mobify's code style globally:
npm install -g eslint
npm install -g mobify-code-style

Instructions for Atom

  1. Install the linter package
  2. Install the linter-eslint package
  3. Open your Atom package settings for linter-eslint and ensure:
    • Your ESLint Path is set
      • Find your ESLint path by running which eslint in a terminal
    • Your .eslintrc Path is set to the ES5 config file from Mobify's code style
      • This config is the fallback for when an existing ESLint config does not exist in the current project
    • Your Global Node Installation Path is set
      • Find this by running npm get prefix in a terminal

Your Atom settings will look something like this: Atom Linter Settings

Now restart Atom and open a JS file to see it in action.

Tip: When working on a project that does not need to conform to this code style, toggle the linter off/on by opening the command palette with shift++p (Mac) or shift+ctrl+p (PC) and type + select Linter: Toggle