https://github.com/sadorlovsky/codestyle
:yellow_heart: ESLint shareable config
https://github.com/sadorlovsky/codestyle
config eslint shareable
Last synced: about 2 months ago
JSON representation
:yellow_heart: ESLint shareable config
- Host: GitHub
- URL: https://github.com/sadorlovsky/codestyle
- Owner: sadorlovsky
- License: mit
- Created: 2016-03-23T00:47:01.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T06:50:48.000Z (over 3 years ago)
- Last Synced: 2025-11-02T01:16:02.634Z (7 months ago)
- Topics: config, eslint, shareable
- Language: JavaScript
- Homepage:
- Size: 2.39 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Sad Orlovsky Codestyle - ESLint Shareable Config
An ESLint [Shareable Config](http://eslint.org/docs/developer-guide/shareable-configs) for my preferable code style.
## THE RULES OF FIGHT CLUB
- **Two spaces**
- **Single quotes**
- **No semicolons**
See all rules [here](index.js#L23).
## Nice code example
```javascript
// 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`
```bash
yarn add --dev eslint
```
Also you need `babel-parser` and some plugins
```bash
yarn add --dev babel-eslint eslint-plugin-import eslint-plugin-fp
```
Finally, install this shareable config
```bash
yarn add --dev @sadorlovsky/eslint-config
```
Add this to your .eslintrc file:
```json
{
"extends": "@sadorlovsky"
}
```
### Use with AVA
```bash
yarn add --dev eslint-plugin-ava
```
```json
{
"extends": [
"@sadorlovsky",
"@sadorlovsky/eslint-config/ava"
]
}
```
### Use with React
```bash
yarn add --dev eslint-plugin-react
```
```json
{
"extends": [
"@sadorlovsky",
"@sadorlovsky/eslint-config/react"
]
}
```
### Use with both
```json
{
"extends": [
"@sadorlovsky",
"@sadorlovsky/eslint-config/ava",
"@sadorlovsky/eslint-config/react"
]
}
```
### You can override any option
```json
{
"extends": [
"@sadorlovsky",
"@sadorlovsky/eslint-config/ava",
"@sadorlovsky/eslint-config/react"
],
"rules": {
"semi": ["error", "always"]
}
}
```