Skip to content

Write consistency JavaScript without losing your brain

License

Notifications You must be signed in to change notification settings

ChtiJS/eslint-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eslint-config

Write consistency JavaScript without losing your brain

npm Build Status

Installation

Install ESLint either locally or globally.

$ npm install eslint --save-dev

If you installed ESLint globally, you have to install eslint-config plugin globally too. Otherwise, install it locally.

$ npm install @chtijs/eslint-config --save-dev

Usage

In your .eslintrc:

{
  "extends": "@chtijs"
}

Overview

Extends the default eslint config, parses with Babel, and adds the import plugin. Includes these hot rules:

  • Two spaces for indentation.
  • Single quotes.
  • More rigit JSDoc enforcement.
  • Allow functions to be defined after they're first referenced. (Yay hoisting!)
  • if/else go on separate lines.
  • Consistent return values optional.
  • Prefer const, then let, but never var.
  • Capitalize the first word in a comment.
  • Put spaces around inline objects.
  • Always use === and !==.
  • Class methods must use this (otherwise they can be static).

Local Development

git clone https://github.com/chtijs/eslint-config
cd eslint-config

License

MIT © Hacked from Geoff Kimball