Code Monkey home page Code Monkey logo

eslint-config-hackreactor's Introduction

Enforcing Hack Reactor's Style Guide

This is an installable ESLint configuration file that enforces Hack Reactor's style guide.

ESLint is a tool for identifying and reporting on patterns found in JavaScript code, with the goal of making code more consistent and avoiding bugs. It's an invaluable tool when working with other engineers.

System Requirements

A working version of Node.js

Installation

Install ESLint globally by running the following command in your terminal:

npm install -g eslint

Install the Hack Reactor style guide configuration:

npm install -g reactorcore/eslint-config-hackreactor

Enforce the style guide in a project

Create an .eslintrc.js file in the root directory of your repository:

module.exports = {
  extend: 'hackreactor',
  rules: {
    // Rules here will override the 'hackreactor' configuration
    // http://eslint.org/docs/rules/
  }
};

Now, you can run ESLint from the command line:

eslint [options] [file|dir|glob]*

For example:

eslint someFile.js someOtherFile.js
eslint client/**

If you don't see any output, your files have passed all the linting rules. In addition to the command line interface, ESLint can be integrated into various build systems like Gulp, Grunt, or a pre-commit hook.

Enforce the style guide in Sublime Text

By downloading and configuring a couple of plugins for Sublime Text, you can receive live feedback about your code's syntax and style, much like spelling errors in a word document. This is a very useful practice to build muscle memory around good style habits.

Install SublimeLinter

The easiest way to download plugins for Sublime Text is through Package Control. With Package Control, you can install SublimeLinter and its ESLint plugin from the Command Palette (cmd + shift + p):

  • Package Control: Install Package -> SublimeLinter
  • Package Control: Install Package -> SublimeLinter-contrib-eslint

Configure SublimeLinter

Without any configuration, SublimeLinter will only enforce rules from a .eslintrc file. If no .eslintrc file exists among the open files, SublimeLinter will fall back to the default behavior the eslint command, and only enforce syntax errors.

You can configure SublimeLinter to enforce the Hack Reactor style guide on files/projects without an .eslintrc file.

Navigate to Preferences -> Package Settings -> SublimeLinter -> Settings - User and update the linters section to the following:

"eslint": {
  "@disable": false,
  "args": [
    "--config",
    "hackreactor"
  ],
  "excludes": []
}

eslint-config-hackreactor's People

Contributors

danthareja avatar erikdbrown avatar fredx avatar fswiecki avatar joshwyatt avatar nickdoane avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.