0.14.0 • Published 4 years ago

@sadorlovsky/eslint-config v0.14.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Sad Orlovsky Codestyle - ESLint Shareable Config

An ESLint Shareable Config for my preferable code style.

THE RULES OF FIGHT CLUB

  • Two spaces
  • Single quotes
  • No semicolons

See all rules here.

Nice code example

// only ES2015
import fetch from 'fetch' // empty line after import

// space after function's name
export function hello (name = 'world') { // single quotes
  return `Hello, ${name}!` // two spaces for indent
} // no semicolons

// consts everywhere
export const fetchData = uri => { // no parens if single argument
  return fetch(uri)
    .then(res => res.json()) // arrow callback
    .then(data => ({ a: data.a, b: data.b }))
    // spacing inside single-line blocks
}
// empty line at the end of code

Usage

You need ESLint

yarn add --dev eslint

Also you need babel-parser and some plugins

yarn add --dev babel-eslint eslint-plugin-import eslint-plugin-fp

Finally, install this shareable config

yarn add --dev @sadorlovsky/eslint-config

Add this to your .eslintrc file:

{
  "extends": "@sadorlovsky"
}

Use with AVA

yarn add --dev eslint-plugin-ava
{
  "extends": [
    "@sadorlovsky",
    "@sadorlovsky/eslint-config/ava"
  ]
}

Use with React

yarn add --dev eslint-plugin-react
{
  "extends": [
    "@sadorlovsky",
    "@sadorlovsky/eslint-config/react"
  ]
}

Use with both

{
  "extends": [
    "@sadorlovsky",
    "@sadorlovsky/eslint-config/ava",
    "@sadorlovsky/eslint-config/react"
  ]
}

You can override any option

{
  "extends": [
    "@sadorlovsky",
    "@sadorlovsky/eslint-config/ava",
    "@sadorlovsky/eslint-config/react"
  ],

  "rules": {
    "semi": ["error", "always"]
  }
}
0.14.0

4 years ago

0.13.0

8 years ago

0.12.0

8 years ago

0.11.0

8 years ago

0.10.0

8 years ago

0.9.0

8 years ago

0.8.1

8 years ago

0.8.0

8 years ago

0.7.0

8 years ago

0.6.0

8 years ago

0.5.0

8 years ago

0.4.0

8 years ago

0.3.0

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago