UNPKG

@goodcastle/eslint-config

Version:

The ESLint config used by Reaction Commerce, following our style guide

627 lines (626 loc) 12.6 kB
{ "parser": "babel-eslint", "extends": [ "plugin:jsx-a11y/recommended", "plugin:node/recommended", "plugin:promise/recommended" ], "env": { "browser": true, "es6": true, "jest": true, "mocha": true, "node": true }, "parserOptions": { "ecmaVersion": 2017, "sourceType": "module", "ecmaFeatures": { "arrowFunctions": true, "blockBindings": true, "classes": true, "defaultParams": true, "destructuring": true, "forOf": true, "generators": false, "modules": true, "objectLiteralComputedProperties": true, "objectLiteralDuplicateProperties": false, "objectLiteralShorthandMethods": true, "objectLiteralShorthandProperties": true, "spread": true, "superInFunctions": true, "templateStrings": true, "jsx": true }, "allowImportExportEverywhere": true }, "plugins": [ "import", "jest", "jsx-a11y", "promise", "react" ], "rules": { "array-bracket-spacing": [ "error", "never" ], "array-callback-return": [ "error", { "allowImplicit": true } ], "arrow-body-style": [ "error", "as-needed", { "requireReturnForObjectLiteral": false } ], "arrow-parens": [ "error", "always", { "requireForBlockBody": true } ], "arrow-spacing": [ "error", { "after": true, "before": true } ], "block-scoped-var": "off", "block-spacing": [ "error", "always" ], "brace-style": [ "error", "1tbs", { "allowSingleLine": true } ], "camelcase": [ "error", { "properties": "always" } ], "comma-dangle": [ "error", "never" ], "comma-spacing": [ "error", { "after": true, "before": false } ], "comma-style": [ "error", "last" ], "computed-property-spacing": [ "error", "never" ], "consistent-return": [ "error", { "treatUndefinedAsUnspecified": true } ], "curly": [ "error", "multi-line" ], "default-case": "error", "dot-location": [ "error", "property" ], "dot-notation": [ "error", { "allowKeywords": true } ], "eol-last": "error", "eqeqeq": "error", "func-names": "off", "func-style": [ "error", "declaration", { "allowArrowFunctions": true } ], "function-paren-newline": [ "error", "multiline" ], "guard-for-in": "error", "id-length": [ "error", { "exceptions": [ "_" ] } ], "import/export": "error", "import/newline-after-import": "error", "import/no-duplicates": "error", "import/no-mutable-exports": "error", "import/no-named-default": "error", "import/order": [ "error", { "groups": [ "builtin", "external", "internal", "parent", "sibling", "index" ] } ], "indent": [ "error", 2, { "SwitchCase": 1 } ], "jsx-a11y/label-has-for": [ "error", { "components": [ "Label" ], "required": { "some": [ "nesting", "id" ] }, "allowChildren": false } ], "jsx-quotes": [ "error", "prefer-double" ], "key-spacing": [ "error", { "afterColon": true, "beforeColon": false } ], "keyword-spacing": "error", "max-len": [ "error", 160, 2, { "ignoreComments": true, "ignoreUrls": true } ], "new-cap": [ "off", { "capIsNewExceptions": [ "Match", "OneOf", "Optional" ], "newIsCap": true } ], "new-parens": "error", "newline-per-chained-call": [ "error", { "ignoreChainWithDepth": 4 } ], "no-alert": "error", "no-array-constructor": "error", "no-await-in-loop": "error", "no-bitwise": "error", "no-caller": "error", "no-case-declarations": "error", "no-cond-assign": [ "error", "always" ], "no-confusing-arrow": [ "error", { "allowParens": true } ], "no-console": "error", "no-const-assign": "error", "no-constant-condition": "error", "no-debugger": "error", "no-dupe-keys": "error", "no-duplicate-case": "error", "no-else-return": "error", "no-empty": "error", "no-empty-pattern": "error", "no-eq-null": "error", "no-eval": "error", "no-ex-assign": "error", "no-extend-native": "error", "no-extra-bind": "error", "no-extra-boolean-cast": "error", "no-extra-parens": [ "error", "functions" ], "no-extra-semi": "error", "no-fallthrough": "error", "no-floating-decimal": "error", "no-func-assign": "error", "no-implicit-globals": "error", "no-implied-eval": "error", "no-inner-declarations": "error", "no-invalid-regexp": "error", "no-irregular-whitespace": "error", "no-lone-blocks": "error", "no-lonely-if": "error", "no-loop-func": "error", "no-mixed-operators": [ "error", { "allowSamePrecedence": false, "groups": [ [ "%", "**" ], [ "%", "+" ], [ "%", "-" ], [ "%", "*" ], [ "%", "/" ], [ "**", "+" ], [ "**", "-" ], [ "**", "*" ], [ "**", "/" ], [ "&", "|", "^", "~", "<<", ">>", ">>>" ], [ "==", "!=", "===", "!==", ">", ">=", "<", "<=" ], [ "&&", "||" ], [ "in", "instanceof" ] ] } ], "no-multi-assign": [ "error" ], "no-multi-spaces": [ "error", { "ignoreEOLComments": false } ], "no-multi-str": "error", "no-multiple-empty-lines": [ "error", { "max": 2 } ], "no-native-reassign": "error", "no-nested-ternary": "error", "no-new": "error", "no-new-func": "error", "no-new-object": "error", "no-new-wrappers": "error", "no-obj-calls": "error", "no-octal": "error", "no-octal-escape": "error", "no-param-reassign": "error", "no-plusplus": "error", "no-proto": "error", "no-prototype-builtins": "error", "no-redeclare": "error", "no-return-assign": [ "error", "always" ], "no-return-await": "error", "no-script-url": "error", "no-self-compare": "error", "no-sequences": "error", "no-shadow": "error", "no-shadow-restricted-names": "error", "no-spaced-func": "error", "no-sparse-arrays": "error", "no-tabs": "error", "no-throw-literal": "error", "no-trailing-spaces": "error", "no-undef": "error", "no-undef-init": "error", "no-underscore-dangle": "off", "no-unneeded-ternary": [ "error", { "defaultAssignment": false } ], "no-unreachable": "error", "no-unsafe-finally": "error", "no-unused-vars": [ "error", { "args": "after-used", "ignoreRestSiblings": true, "vars": "all" } ], "no-use-before-define": [ "error", "nofunc" ], "no-useless-computed-key": "error", "no-useless-concat": "error", "no-useless-constructor": "error", "no-useless-escape": "error", "no-var": "error", "no-void": "error", "no-with": "error", "object-curly-newline": [ "error", { "ObjectExpression": { "consistent": true, "multiline": true }, "ObjectPattern": { "consistent": true, "multiline": true } } ], "object-curly-spacing": [ "error", "always", { "objectsInObjects": true } ], "object-property-newline": [ "error", { "allowAllPropertiesOnSameLine": true } ], "object-shorthand": [ "error", "always" ], "one-var": [ "error", "never" ], "operator-assignment": [ "error", "always" ], "padded-blocks": [ "error", "never" ], "prefer-arrow-callback": [ "error", { "allowNamedFunctions": false, "allowUnboundThis": true } ], "prefer-const": [ "error", { "destructuring": "any", "ignoreReadBeforeAssign": false } ], "prefer-destructuring": [ "error", { "AssignmentExpression": { "array": true, "object": true }, "VariableDeclarator": { "array": false, "object": true } }, { "enforceForRenamedProperties": false } ], "prefer-rest-params": "error", "prefer-spread": "error", "prefer-template": "error", "quote-props": [ "error", "consistent-as-needed" ], "quotes": [ "error", "double", { "avoidEscape": true } ], "radix": "error", "react/boolean-prop-naming": [ "error", { "rule": "^(can|has|is|should)[A-Z]([A-Za-z0-9]?)+" } ], "react/display-name": "error", "react/forbid-prop-types": "off", "react/jsx-boolean-value": "off", "react/jsx-closing-bracket-location": "error", "react/jsx-curly-spacing": "error", "react/jsx-indent-props": [ "error", 2 ], "react/jsx-max-props-per-line": [ "error", { "maximum": 4 } ], "react/jsx-no-bind": "off", "react/jsx-no-duplicate-props": "error", "react/jsx-no-literals": "off", "react/jsx-no-undef": "error", "react/jsx-sort-props": "off", "react/jsx-uses-react": "error", "react/jsx-uses-vars": "error", "react/no-danger": "error", "react/no-deprecated": "error", "react/no-did-mount-set-state": "error", "react/no-did-update-set-state": "error", "react/no-direct-mutation-state": "error", "react/no-multi-comp": "error", "react/no-set-state": "off", "react/no-unknown-property": "error", "react/prefer-es6-class": "error", "react/prop-types": "error", "react/react-in-jsx-scope": "off", "react/require-extension": "off", "react/self-closing-comp": "error", "react/sort-comp": "error", "react/sort-prop-types": "error", "require-jsdoc": [ "error", { "require": { "ArrowFunctionExpression": false, "ClassDeclaration": false, "FunctionDeclaration": true, "MethodDefinition": false } } ], "rest-spread-spacing": [ "error", "never" ], "semi": [ "error", "always" ], "semi-spacing": [ "error", { "after": true, "before": false } ], "space-before-blocks": "error", "space-before-function-paren": [ "error", { "anonymous": "always", "named": "never" } ], "space-in-parens": [ "error", "never" ], "space-infix-ops": "error", "space-unary-ops": [ "error", { "nonwords": false, "overrides": {}, "words": true } ], "spaced-comment": [ "error", "always" ], "strict": "off", "template-curly-spacing": "error", "use-isnan": "error", "valid-jsdoc": [ "error", { "prefer": { "arg": "param", "argument": "param" } } ], "vars-on-top": "error", "wrap-iife": [ "error", "outside", { "functionPrototypeMethods": false } ], "yoda": "error" } }