Skip to content

Instantly share code, notes, and snippets.

@derekclair
Created June 21, 2017 21:28
Show Gist options
  • Save derekclair/dc9e8e43e988525e908391c9e2e62cac to your computer and use it in GitHub Desktop.
Save derekclair/dc9e8e43e988525e908391c9e2e62cac to your computer and use it in GitHub Desktop.
Test Drive: ESLint Config
{
"env": {
"browser": true,
"es6": true,
"mocha": true,
"node": true
},
"sourceType": "module",
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"sourceType": "module"
},
"plugins": [
"lodash",
"babel",
"react",
"import",
"jsx-a11y",
"flowtype",
"security"
],
"extends": [
"eslint:recommended",
"plugin:flowtype/recommended",
"plugin:react/recommended",
"airbnb"
],
"rules": {
"arrow-parens": [
2,
"as-needed",
{
"requireForBlockBody": true
}
],
"brace-style": [
2,
"stroustrup",
{
"allowSingleLine": true
}
],
"camelcase": [
1,
{
"properties": "never"
}
],
"comma-dangle": [
1,
{
"arrays": "always-multiline",
"exports": "always-multiline",
"functions": "ignore",
"imports": "always-multiline",
"objects": "always-multiline"
}
],
"consistent-return": [
2,
{
"treatUndefinedAsUnspecified": true
}
],
// __________________________________________________________________ import
"import/extensions": 0,
"import/no-absolute-path": 0,
"import/no-extraneous-dependencies": 0,
"import/no-unresolved": [
2,
{
"ignore": [
"^components/",
"^flow/",
"^images/",
"^services/",
"^stores/",
"^styles/",
"^utils/",
"^/"
]
}
],
// ________________________________________________________________ jsx-a11y
"jsx-a11y/img-has-alt": 0, // Issue with 'jsx-a11y'
"jsx-a11y/label-has-for": 0, // Issue with 'jsx-a11y'
"jsx-a11y/no-autofocus": 1,
"jsx-a11y/no-static-element-interactions": 0,
"no-confusing-arrow": [
2,
{
"allowParens": true
}
],
"no-multi-spaces": 1,
"no-plusplus": 0,
"no-underscore-dangle": 0,
// ___________________________________________________________________ react
"react/jsx-closing-bracket-location": [
1,
"line-aligned"
],
"react/jsx-indent": [
2,
2
],
"react/jsx-indent-props": [
2,
2
],
"react/jsx-max-props-per-line": [
1,
{
"maximum": 2,
"when": "multiline"
}
],
"react/jsx-no-bind": [
1,
{
"allowBind": false,
"allowArrowFunctions": true,
"ignoreRefs": true
}
],
"react/jsx-uses-react": 1,
"react/jsx-wrap-multilines": 0, // Issue with 'config-airbnb'
"react/no-array-index-key": 1,
"react/no-string-refs": 1,
"react/prefer-stateless-function": 1,
"react/require-default-props": 0,
"react/sort-comp": [
1,
{
"order": [
"type-annotations",
"static-methods",
"lifecycle",
"handlers",
"rendering",
"everything-else"
],
"groups": {
"handlers": [
"/^on.+$/",
"/^handle.+$/"
],
"rendering": [
"/^render.+$/",
"render"
]
}
}
],
"spaced-comment": 0
},
"settings": {
"flowtype": {
"onlyFilesWithFlowAnnotation": true
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment