Skip to content

Instantly share code, notes, and snippets.

@kara-ryli
Last active April 4, 2017 05:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kara-ryli/e1fb5429b9fea55bed5c356111f3f6c2 to your computer and use it in GitHub Desktop.
Save kara-ryli/e1fb5429b9fea55bed5c356111f3f6c2 to your computer and use it in GitHub Desktop.
{
"extends": [
"eslint:recommended"
],
"rules": {
"valid-jsdoc": [
"warn",
{
"prefer": {
"return": "returns",
"arg": "param",
"argument": "param",
"class": "constructor"
},
"preferType": {
"Boolean": "boolean",
"Number": "number",
"object": "Object",
"String": "string"
}
}
],
"complexity": [
"warn",
7
],
"curly": "error",
"dot-location": [
"error",
"object"
],
"dot-notation": "error",
"eqeqeq": "error",
"no-else-return": "error",
"no-empty-pattern": "error",
"no-eval": "error",
"no-extra-bind": "error",
"no-extra-label": "error",
"no-floating-decimal": "error",
"no-implicit-coercion": "warn",
"no-implicit-globals": "warn",
"no-implied-eval": "error",
"no-lone-blocks": "error",
"no-loop-func": "warn",
"no-magic-numbers": [
"error",
{
"ignoreArrayIndexes": true
}
],
"no-multi-spaces": [
"error",
{
"exceptions": {
"Property": true,
"VariableDeclarator": true,
"ImportDeclaration": true
}
}
],
"no-new-func": "error",
"no-new-wrappers": "error",
"no-param-reassign": "warn",
"no-return-assign": "error",
"no-return-await": "error",
"no-throw-literal": "error",
"no-useless-call": "error",
"no-with": "error",
"prefer-promise-reject-errors": "error",
"radix": "error",
"vars-on-top": "error",
"no-path-concat": "error",
"block-spacing": "error",
"camelcase": [
"error",
{
"properties": "never"
}
],
"comma-spacing": [
"error",
{
"before": false,
"after": true
}
],
"comma-style": "error",
"computed-property-spacing": "error",
"eol-last": "error",
"func-call-spacing": "error",
"func-names": [
"error",
"as-needed"
],
"func-style": [
"error",
"declaration",
{
"allowArrowFunctions": true
}
],
"indent": [
"error",
2
],
"key-spacing": [
"error",
{
"mode": "minimum"
}
],
"keyword-spacing": [
"error"
],
"linebreak-style": "error",
"max-depth": "warn",
"max-nested-callbacks": "warn",
"max-params": "warn",
"max-statements": [
"warn",
{
"max": 20
}
],
"new-cap": "warn",
"new-parens": "error",
"no-array-constructor": "error",
"no-trailing-spaces": "error",
"no-unneeded-ternary": "error",
"no-whitespace-before-property": "error",
"object-curly-spacing": [
"error",
"always"
],
"quote-props": [
"error",
"as-needed",
{
"keywords": true,
"numbers": true
}
],
"quotes": [
"error",
"single",
{
"avoidEscape": true
}
],
"semi": "error",
"semi-spacing": "error",
"space-before-blocks": "error",
"space-before-function-paren": [
"error",
{
"anonymous": "always",
"named": "never"
}
],
"space-in-parens": ["error", "never"],
"unicode-bom": "error",
"arrow-body-style": [
"error",
"as-needed"
],
"arrow-parens": [
"error",
"as-needed"
],
"no-confusing-arrow": "warn",
"no-duplicate-imports": "error",
"object-shorthand": [
"error",
"always",
{
"avoidQuotes": true,
"avoidExplicitReturnArrows": true
}
],
"prefer-const": [
"warn",
{
"destructuring": "all"
}
],
"template-curly-spacing": "error"
}
}
---
extends:
- eslint:recommended
rules:
# Possible Errors - most of these come from eslint:recommended
valid-jsdoc:
- warn
- prefer:
return: returns
arg: param
argument: param
class: constructor
preferType:
Boolean: boolean
Number: number
object: Object
String: string
# Best Practices
complexity:
- warn
- 7
curly: error
dot-location:
- error
- object
dot-notation: error
eqeqeq: error
no-else-return: error
no-empty-pattern: error
no-eval: error
no-extra-bind: error
no-extra-label: error
no-floating-decimal: error
no-implicit-coercion: warn
no-implicit-globals: warn
no-implied-eval: error
no-lone-blocks: error
no-loop-func: warn
no-magic-numbers:
- error
- ignoreArrayIndexes: true
no-multi-spaces:
- error
- exceptions:
Property: true
VariableDeclarator: true
ImportDeclaration: true
no-new-func: error
no-new-wrappers: error
no-param-reassign: warn
no-return-assign: error
no-return-await: error
no-throw-literal: error
no-useless-call: error
no-with: error
prefer-promise-reject-errors: error
radix: error
vars-on-top: error
# Variables - TODO
# Node.js and CommonJS
no-path-concat: error
# Stylistic Issues
block-spacing: error
camelcase:
- error
- properties: never
comma-spacing:
- error
- before: false
after: true
comma-style: error
computed-property-spacing: error
eol-last: error
func-call-spacing: error
func-names:
- error
- as-needed
func-style:
- error
- declaration
- allowArrowFunctions: true
indent:
- error
- 2
key-spacing:
- error
- mode: minimum
keyword-spacing:
- error
linebreak-style: error
max-depth: warn
max-nested-callbacks: warn
max-params: warn
max-statements:
- warn
max: 20
new-cap: warn
new-parens: error
no-array-constructor: error
no-trailing-spaces: error
no-unneeded-ternary: error
no-whitespace-before-property: error
object-curly-spacing:
- error
- always
quote-props:
- error
- as-needed
- keywords: true
numbers: true
quotes:
- error
- single
- avoidEscape: true
semi: error
semi-spacing: error
space-before-blocks: error
space-before-function-paren:
- error
- anonymous: always
named: never
space-in-parens:
- error
- never
unicode-bom: error
# ECMAScript 6
arrow-body-style:
- error
- as-needed
arrow-parens:
- error
- as-needed
no-confusing-arrow: warn
no-duplicate-imports: error
object-shorthand:
- error
- always
- avoidQuotes: true
avoidExplicitReturnArrows: true
prefer-const:
- warn
- destructuring: all
template-curly-spacing: error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment