Skip to content

Commit

Permalink
Simplify ESLint configs
Browse files Browse the repository at this point in the history
  • Loading branch information
th0r committed Feb 1, 2018
1 parent a617281 commit 5b6fb3f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 326 deletions.
184 changes: 2 additions & 182 deletions .eslintrc.json
@@ -1,187 +1,7 @@
{
"root": true,
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 2017,
"sourceType": "module",
"ecmaFeatures": {
"impliedStrict": true,
"experimentalObjectRestSpread": true
}
},
"env": {
"es6": true,
"node": true
},
"extends": "th0r",
"rules": {
"arrow-body-style": [2, "as-needed"],
"array-bracket-newline": [2, "consistent"],
"array-bracket-spacing": [2, "never"],
"array-callback-return": [2, {"allowImplicit": false}],
"arrow-parens": 0,
"arrow-spacing": [2, {"before": true, "after": true}],
"brace-style": [2, "1tbs", {"allowSingleLine": true}],
"camelcase": [2, {"properties": "never"}],
"capitalized-comments": 0,
"class-methods-use-this": 0,
"comma-dangle": [2, "never"],
"comma-spacing": [2, {"before": false, "after": true}],
"comma-style": [2, "last"],
"complexity": [2, 20],
"consistent-return": 0,
"constructor-super": 2,
"curly": [2, "multi-line"],
"dot-notation": [2, {"allowKeywords": true, "allowPattern": "^[a-z]+(_[a-z]+)+$"}],
"eol-last": 0,
"eqeqeq": [2, "allow-null"],
"for-direction": 2,
"function-paren-newline": 0,
"func-call-spacing": [2, "never"],
"generator-star-spacing": [2, "after"],
"getter-return": 2,
"handle-callback-err": 2,
"indent": [2, 2, {
"SwitchCase": 1,
"ignoredNodes": ["TemplateLiteral"]
}],
"jsx-quotes": [2, "prefer-double"],
"keyword-spacing": 2,
"key-spacing": [1, {"beforeColon": false, "afterColon": true}],
"linebreak-style": [2, "unix"],
"lines-between-class-members": [2, "always", {"exceptAfterSingleLine": true}],
"line-comment-position": [2, {"position": "above"}],
"max-len": [2, {"code": 120, "tabWidth": 4}],
"newline-per-chained-call": [2, {"ignoreChainWithDepth": 2}],
"new-cap": [2, {"newIsCap": true, "capIsNew": false}],
"new-parens": 0,
"nonblock-statement-body-position": ["error", "beside"],
"no-alert": 0,
"no-array-constructor": 2,
"no-await-in-loop": 0,
"no-buffer-constructor": 2,
"no-caller": 2,
"no-case-declarations": 2,
"no-catch-shadow": 0,
"no-class-assign": 0,
"no-compare-neg-zero": 2,
"no-cond-assign": [2, "except-parens"],
"no-confusing-arrow": [2, {"allowParens": true}],
"no-console": 0,
"no-control-regex": 2,
"no-constant-condition": 2,
"no-const-assign": 2,
"no-debugger": 2,
"no-delete-var": 2,
"no-dupe-args": 2,
"no-dupe-keys": 2,
"no-duplicate-case": 2,
"no-duplicate-imports": [2, {"includeExports": true}],
"no-empty": 2,
"no-empty-character-class": 2,
"no-empty-pattern": 2,
"no-eval": 2,
"no-extend-native": 2,
"no-extra-bind": 2,
"no-extra-boolean-cast": 2,
"no-extra-parens": 0,
"no-ex-assign": 2,
"no-fallthrough": 2,
"no-floating-decimal": 2,
"no-func-assign": 2,
"no-global-assign": 2,
"no-implied-eval": 2,
"no-inner-declarations": 2,
"no-invalid-regexp": 2,
"no-iterator": 2,
"no-labels": 0,
"no-label-var": 2,
"no-lone-blocks": 0,
"no-loop-func": 0,
"no-mixed-operators": 2,
"no-mixed-spaces-and-tabs": 2,
"no-multiple-empty-lines": [2, {"max": 2}],
"no-multi-assign": 0,
"no-multi-spaces": 2,
"no-multi-str": 0,
"no-new": 0,
"no-new-func": 2,
"no-new-object": 2,
"no-new-wrappers": 2,
"no-obj-calls": 2,
"no-octal": 2,
"no-octal-escape": 2,
"no-process-exit": 0,
"no-proto": 2,
"no-prototype-builtins": 0,
"no-redeclare": 2,
"no-regex-spaces": 2,
"no-restricted-syntax": [2, "WithStatement"],
"no-return-assign": 0,
"no-return-await": 0,
"no-script-url": 2,
"no-self-assign": [2, {"props": true}],
"no-sequences": 2,
"no-shadow": 0,
"no-shadow-restricted-names": 2,
"no-sparse-arrays": 2,
"no-tabs": 2,
"no-template-curly-in-string": 2,
"no-this-before-super": 2,
"no-trailing-spaces": [2, {"skipBlankLines": false}],
"no-undef": 2,
"no-undef-init": 2,
"no-underscore-dangle": 0,
"no-unsafe-finally": 2,
"no-unsafe-negation": 2,
"no-unused-expressions": 0,
// Ignoring unused last "next" argument in Express error handlers
"no-unused-vars": [2, {"argsIgnorePattern": "^next$"}],
"no-useless-computed-key": 2,
"no-useless-escape": 2,
"no-useless-rename": 2,
"no-useless-return": 2,
"no-use-before-define": [1, "nofunc"],
"no-var": 2,
"no-with": 2,
"object-curly-newline": [2, {"consistent": true}],
"object-curly-spacing": [2, "always"],
"object-property-newline": [2, {"allowAllPropertiesOnSameLine": true}],
"object-shorthand": [2, "always"],
"one-var": [2, "never"],
"padding-line-between-statements": [2,
{"blankLine": "always", "prev": "directive", "next": "*"}
],
"prefer-const": [2, {"destructuring": "all"}],
"prefer-destructuring": [2, {
"array": false,
"object": true
}],
"prefer-numeric-literals": 2,
"prefer-promise-reject-errors": [2, {"allowEmptyReject": true}],
"prefer-reflect": 0,
"prefer-spread": 2,
"quotes": [2, "single", "avoid-escape"],
"quote-props": 0,
"require-await": 0,
"require-yield": 2,
"rest-spread-spacing": [2, "never"],
"semi": [2, "always", {"omitLastInOneLineBlock": true}],
"semi-spacing": 0,
"semi-style": [2, "last"],
// Setting "error" won't allow to comment blocks of code with IDE shortcut
"spaced-comment": 0,
"space-before-blocks": [2, "always"],
"space-before-function-paren": [2, {"anonymous": "always", "named": "never"}],
"space-infix-ops": 2,
"space-unary-ops": 0,
"strict": 0,
"symbol-description": 2,
"switch-colon-spacing": 2,
"template-tag-spacing": [2, "never"],
"unicode-bom": 0,
"use-isnan": 2,
"valid-typeof": [2, {"requireStringLiterals": true}],
"wrap-iife": [2, "inside"],
"yoda": [2, "never"]
"object-curly-spacing": ["error", "always"]
}
}
148 changes: 4 additions & 144 deletions client/.eslintrc.json
@@ -1,146 +1,6 @@
{
"extends": "../.eslintrc.json",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
}
},
"env": {
"browser": true,
"node": false
},
"plugins": [
"react"
],
"rules": {
"react/boolean-prop-naming": 0,
"react/button-has-type": 2,
"react/display-name": 1,
"react/default-props-match-prop-types": 2,
"react/destructuring-assignment": 0,
"react/forbid-component-props": 0,
"react/forbid-elements": 0,
"react/forbid-foreign-prop-types": 2,
"react/forbid-prop-types": 0,
"react/no-access-state-in-setstate": 0,
"react/no-array-index-key": 2,
"react/no-children-prop": 2,
"react/no-danger": 0,
"react/no-danger-with-children": 2,
"react/no-deprecated": 2,
"react/no-did-mount-set-state": 1,
"react/no-did-update-set-state": 1,
"react/no-direct-mutation-state": 2,
"react/no-find-dom-node": 2,
"react/no-is-mounted": 2,
"react/no-multi-comp": 2,
"react/no-redundant-should-component-update": 2,
"react/no-render-return-value": 2,
"react/no-set-state": 0,
"react/no-string-refs": 0,
"react/no-this-in-sfc": 2,
"react/no-typos": 2,
"react/no-unescaped-entities": 0,
"react/no-unknown-property": 2,
"react/no-unused-prop-types": 2,
"react/no-unused-state": 2,
"react/no-will-update-set-state": 2,
"react/prefer-es6-class": 2,
"react/prefer-stateless-function": 0,
"react/prop-types": 0,
"react/react-in-jsx-scope": 1,
"react/require-default-props": [2, {"forbidDefaultForRequired": true}],
"react/require-optimization": 0,
"react/require-render-return": 2,
"react/self-closing-comp": 2,
"react/sort-comp": [2, {
"order": [
"static-methods",
"lifecycle",
"render",
"eventHandlers",
"everything-else"
],
"groups": {
"lifecycle": [
"displayName",
"propTypes",
"contextTypes",
"childContextTypes",
"mixins",
"statics",
"defaultProps",
"constructor",
"getDefaultProps",
"getInitialState",
"state",
"getChildContext",
"componentWillMount",
"componentDidMount",
"componentWillReceiveProps",
"shouldComponentUpdate",
"componentWillUpdate",
"componentDidUpdate",
"componentWillUnmount"
],
"eventHandlers": [
"/^handle[A-Z].+$/"
],
"render": [
"render",
"/^render[A-Z].+$/"
]
}
}],
"react/sort-prop-types": 0,
"react/style-prop-object": 2,
"react/void-dom-elements-no-children": 2,
"react/jsx-boolean-value": [2, "never"],
"react/jsx-closing-bracket-location": [2, "after-props"],
"react/jsx-closing-tag-location": 2,
"react/jsx-curly-brace-presence": [2, "never"],
"react/jsx-curly-spacing": [2, "never"],
"react/jsx-equals-spacing": [2, "never"],
"react/jsx-filename-extension": [2, {"extensions": [".jsx"]}],
"react/jsx-first-prop-new-line": [2, "never"],
"react/jsx-handler-names": [2, {
"eventHandlerPrefix": "handle",
"eventHandlerPropPrefix": "on"
}],
"react/jsx-indent-props": [2, 2],
"react/jsx-indent": [2, 2],
"react/jsx-key": 2,
"react/jsx-max-props-per-line": 0,
"react/jsx-no-bind": 1,
"react/jsx-no-comment-textnodes": 2,
"react/jsx-no-duplicate-props": 2,
"react/jsx-no-literals": 0,
"react/jsx-no-target-blank": 2,
"react/jsx-no-undef": 2,
"react/jsx-pascal-case": 2,
"react/jsx-sort-default-props": 0,
"react/jsx-sort-props": [2, {
"callbacksLast": true,
"shorthandLast": true,
"ignoreCase": true,
"noSortAlphabetically": true,
"reservedFirst": true
}],
"react/jsx-tag-spacing": [2, {
"closingSlash": "never",
"beforeSelfClosing": "never",
"afterOpening": "never"
}],
"react/jsx-uses-react": 2,
"react/jsx-uses-vars": 2,
"react/jsx-wrap-multilines": [2, {
"declaration": "parens-new-line",
"assignment": "parens-new-line",
"return": "parens-new-line",
"arrow": "ignore",
"condition": "ignore",
"logical": "ignore",
"prop": "ignore"
}]
}
"extends": [
"th0r-react",
"../.eslintrc.json"
]
}
2 changes: 2 additions & 0 deletions package.json
Expand Up @@ -60,6 +60,8 @@
"css-loader": "0.28.9",
"del": "3.0.0",
"eslint": "4.16.0",
"eslint-config-th0r": "1.0.0",
"eslint-config-th0r-react": "1.0.0",
"eslint-plugin-react": "7.6.1",
"exports-loader": "0.6.4",
"gulp": "4.0.0",
Expand Down
8 changes: 8 additions & 0 deletions yarn.lock
Expand Up @@ -2215,6 +2215,14 @@ escope@^3.6.0:
esrecurse "^4.1.0"
estraverse "^4.1.1"

eslint-config-th0r-react@1.0.0:
version "1.0.0"
resolved "https://registry.npmjs.org/eslint-config-th0r-react/-/eslint-config-th0r-react-1.0.0.tgz#e828657199c1f1516e02f93050e3168c09df34ea"

eslint-config-th0r@1.0.0:
version "1.0.0"
resolved "https://registry.npmjs.org/eslint-config-th0r/-/eslint-config-th0r-1.0.0.tgz#3c7315220bf48c134a52383dd7886a131fbda82d"

eslint-plugin-react@7.6.1:
version "7.6.1"
resolved "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.6.1.tgz#5d0e908be599f0c02fbf4eef0c7ed6f29dff7633"
Expand Down

0 comments on commit 5b6fb3f

Please sign in to comment.