Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Commit

Permalink
[changed] inherit eslint-config-airbnb with some refined best practices
Browse files Browse the repository at this point in the history
  • Loading branch information
thealjey committed Sep 29, 2015
1 parent 6a0a6eb commit d4ad959
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 51 deletions.
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
build/**
config/**
coverage/**
docs/**
interfaces/**
node_modules/**
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "./config/eslint.yml"
}
74 changes: 23 additions & 51 deletions config/eslint.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,40 @@
---
extends: 'eslint:recommended'
parser: babel-eslint
plugins: [ babel, react ]
env: { es6: true, node: true, browser: true, jasmine: true }
ecmaFeatures: { modules: true, jsx: true, experimentalObjectRestSpread: true }
extends: eslint-config-airbnb
plugins: [ babel, react, lodash ]
env: { es6: true, jasmine: true }
ecmaFeatures: { experimentalObjectRestSpread: true }
rules:
# eslint-plugin-babel
babel/generator-star-spacing: 2
babel/new-cap: 2
babel/object-curly-spacing: [ 2, never ]
babel/object-shorthand: 2
# generator-star-spacing: 2
# new-cap: 2
new-cap: 0
# object-curly-spacing: [ 2, never ]
# object-shorthand: 2

# eslint-plugin-react
react/jsx-boolean-value: 2
react/jsx-closing-bracket-location: 2
react/jsx-curly-spacing: 2
react/jsx-indent-props: [ 2, 2 ]
react/jsx-no-duplicate-props: 2
react/jsx-no-undef: 2
react/jsx-quotes: [ 2, double ]
react/jsx-uses-react: 2
react/jsx-uses-vars: 2
react/no-danger: 2
react/no-did-mount-set-state: 2
react/no-did-update-set-state: 2
react/no-direct-mutation-state: 2
react/prop-types: 2
react/react-in-jsx-scope: 2
react/self-closing-comp: 2
react/wrap-multilines: 2
react/jsx-quotes: 0

# lodash
lodash/import: 2

# eslint
no-inner-declarations: [ 2, both ]
Expand All @@ -35,76 +43,47 @@ rules:
accessor-pairs: 2
block-spacing: 2
complexity: [ 2, 11 ]
consistent-return: 2
curly: [ 2, all ]
dot-notation: [ 2, { allowKeywords: false } ]
dot-location: [ 2, object ]
eqeqeq: 2
guard-for-in: 2
padded-blocks: 0
no-fallthrough: 0
no-floating-decimal: 0
no-alert: 2
no-caller: 2
no-div-regex: 2
no-dupe-class-members: 2
no-else-return: 2
no-empty-label: 2
no-eq-null: 2
no-eval: 2
no-extend-native: 2
no-extra-bind: 2
no-implied-eval: 2
no-invalid-this: 2
no-iterator: 2
no-labels: 2
no-lone-blocks: 2
no-loop-func: 2
no-multi-spaces: 2
no-multi-str: 2
no-native-reassign: 2
no-new-func: 2
no-new-wrappers: 2
no-new: 2
no-octal-escape: 2
no-process-env: 2
no-proto: 2
no-redeclare: [ 2, { builtinGlobals: true } ]
no-return-assign: [ 2, always ]
no-script-url: 2
no-self-compare: 2
no-sequences: 2
no-throw-literal: 2
no-unused-expressions: 2
no-useless-call: 2
no-void: 2
no-warning-comments: [ 2, { terms: [ todo, fixme, xxx ], location: start } ]
no-with: 2
radix: 2
vars-on-top: 2
wrap-iife: 2
yoda: [ 2, always ]
no-catch-shadow: 2
no-label-var: 2
no-shadow-restricted-names: 2
no-shadow: 2
no-undef-init: 2
no-use-before-define: [ 2, nofunc ]
callback-return: 2
handle-callback-err: [ 2, "^e(rr(or)?)?$" ]
no-mixed-requires: [ 2, false ]
no-new-require: 2
no-param-reassign: 0
no-path-concat: 2
no-process-exit: 2
no-sync: 2
array-bracket-spacing: [ 2, never ]
brace-style: [ 2, 1tbs ]
camelcase: 2
comma-spacing: 2
comma-style: 2
comma-dangle: [ 2, never ]
computed-property-spacing: [ 2, never ]
consistent-this: [ 2, me ]
eol-last: 2
id-length: [ 2, { min: 1, max: 25 } ]
indent: [ 2, 2, { SwitchCase: 1, VariableDeclarator: 2 } ]
key-spacing: [ 2, { beforeColon: false, afterColon: true } ]
lines-around-comment: [ 2, { beforeBlockComment: true, beforeLineComment: true, allowBlockStart: true } ]
linebreak-style: [ 2, unix ]
new-parens: 2
Expand All @@ -113,25 +92,15 @@ rules:
no-inline-comments: 2
no-lonely-if: 2
no-multiple-empty-lines: [ 2, { max: 1 } ]
no-new-object: 2
no-spaced-func: 2
no-trailing-spaces: 2
no-unneeded-ternary: 2
one-var: [ 2, always ]
operator-assignment: [ 2, always ]
operator-linebreak: 2
quote-props: [ 2, as-needed, { keywords: true } ]
quotes: [ 2, single, avoid-escape ]
semi-spacing: [ 2, { before: false, after: true } ]
semi: [ 2, always ]
space-after-keywords: [ 2, always ]
space-before-blocks: [ 2, always ]
space-before-function-paren: [ 2, { anonymous: always, named: never } ]
space-in-parens: [ 2, never ]
space-infix-ops: [ 2, { int32Hint: true } ]
space-return-throw-case: 2
space-unary-ops: [ 2, { words: true, nonwords: false } ]
spaced-comment: 2
arrow-parens: [ 2, as-needed ]
arrow-spacing: 2
constructor-super: 2
Expand All @@ -141,7 +110,10 @@ rules:
prefer-spread: 2
prefer-template: 2
require-yield: 2
func-names: 0
jsx-quotes: [ 2, prefer-double ]
max-depth: [ 2, 4 ]
max-len: [ 2, 120, 2 ]
max-params: [ 2, 10 ]
no-console: 0
id-length: 0

0 comments on commit d4ad959

Please sign in to comment.