UNPKG

@groww-tech/eslint-config

Version:

Standard Eslint config adopted in Groww. Customized as per requirement and preferences of devs in Groww.

417 lines (416 loc) 7.86 kB
{ "parser": "@typescript-eslint/parser", "extends": [ "plugin:import/errors", "plugin:react-hooks/recommended" ], "plugins": [ "react", "react-hooks", "@typescript-eslint", "@groww-tech/eslint-plugin-internal", "import-newlines" ], "parserOptions": { "ecmaVersion": 10, "ecmaFeatures": { "jsx": true, "modules": true } }, "env": { "browser": true, "node": true, "jest": true, "es6": true }, "rules": { "import/no-duplicates": "warn", "import-newlines/enforce": [ "warn", { "items": 3, "semi": true } ], "react-hooks/exhaustive-deps": "warn", "@groww-tech/internal/padded-blocks-bottom-if-else-try-catch": "warn", "@groww-tech/internal/prefer-type-alias": "warn", "@groww-tech/internal/two-line-above-function": "warn", "@groww-tech/internal/two-line-between-class-members": "warn", "@groww-tech/internal/no-gcs-bucket-url": "error", "quotes": [ "warn", "single" ], "semi": "warn", "react/jsx-uses-react": "warn", "react/jsx-uses-vars": "warn", "react/jsx-key": 1, "@typescript-eslint/no-use-before-define": [ "warn", { "functions": false, "classes": false, "variables": false } ], "indent": "off", "@typescript-eslint/indent": [ "error", 2, { "SwitchCase": 1, "VariableDeclarator": 1, "MemberExpression": 1, "FunctionDeclaration": { "parameters": 1, "body": 1 }, "FunctionExpression": { "parameters": 1, "body": 1 }, "CallExpression": { "arguments": 1 }, "ArrayExpression": 1, "ObjectExpression": 1, "ImportDeclaration": 1, "ignoreComments": true, "flatTernaryExpressions": true, "offsetTernaryExpressions": false } ], "keyword-spacing": [ "warn", { "before": true, "after": true } ], "space-before-function-paren": [ "warn", { "anonymous": "never", "named": "never", "asyncArrow": "always" } ], "object-curly-spacing": [ "warn", "always" ], "eqeqeq": [ "warn", "always", { "null": "ignore" } ], "space-infix-ops": "error", "comma-spacing": [ "error", { "before": false, "after": true } ], "brace-style": [ "warn", "1tbs", { "allowSingleLine": true } ], "curly": [ "error", "multi-line" ], "block-spacing": [ "warn", "always" ], "comma-dangle": [ "warn", { "arrays": "never", "objects": "never", "imports": "never", "exports": "never", "functions": "never" } ], "comma-style": [ "warn", "last" ], "dot-location": [ "warn", "property" ], "dot-notation": [ "error", { "allowKeywords": true } ], "eol-last": "error", "func-call-spacing": [ "warn", "never" ], "key-spacing": [ "warn", { "beforeColon": false, "afterColon": true } ], "object-property-newline": [ "error", { "allowMultiplePropertiesPerLine": true } ], "semi-spacing": [ "error", { "before": false, "after": true } ], "semi-style": "warn", "space-before-blocks": [ "error", "always" ], "space-in-parens": [ "error", "never" ], "space-unary-ops": [ "error", { "words": true, "nonwords": false } ], "template-curly-spacing": [ "error", "never" ], "template-tag-spacing": [ "error", "never" ], "arrow-spacing": [ "warn", { "before": true, "after": true } ], "array-bracket-spacing": [ "warn", "always" ], "lines-between-class-members": [ "warn", "always", { "exceptAfterSingleLine": true } ], "valid-typeof": [ "warn", { "requireStringLiterals": true } ], "prefer-const": [ "warn", { "destructuring": "all" } ], "rest-spread-spacing": [ "error", "never" ], "no-var": "warn", "no-use-before-define": "off", "no-unused-vars": [ "warn", { "args": "none", "caughtErrors": "none", "ignoreRestSiblings": true, "vars": "all" } ], "no-unreachable": "warn", "no-unreachable-loop": "warn", "no-unused-expressions": [ "warn", { "allowShortCircuit": true, "allowTernary": true, "allowTaggedTemplates": true } ], "no-console": [ "warn", { "allow": [ "error", "warn" ] } ], "no-func-assign": "error", "no-global-assign": "error", "no-import-assign": "error", "no-irregular-whitespace": "error", "no-mixed-operators": [ "warn", { "groups": [ [ "==", "!=", "===", "!==", ">", ">=", "<", "<=" ], [ "&&", "||" ], [ "in", "instanceof" ] ], "allowSamePrecedence": true } ], "no-mixed-spaces-and-tabs": "error", "no-multi-spaces": [ "warn", { "ignoreEOLComments": true } ], "no-multiple-empty-lines": [ "warn", { "max": 2, "maxEOF": 0 } ], "no-self-assign": [ "error", { "props": true } ], "no-self-compare": "error", "no-sequences": "error", "no-shadow-restricted-names": "error", "no-tabs": "error", "no-template-curly-in-string": "warn", "no-trailing-spaces": "warn", "no-undef": "warn", "no-unexpected-multiline": "warn", "no-unmodified-loop-condition": "warn", "max-len": [ "warn", { "code": 180, "ignoreComments": true, "ignoreTrailingComments": true } ], "react/jsx-closing-bracket-location": [ 1, "line-aligned" ], "react/jsx-max-props-per-line": [ "error", { "maximum": 1, "when": "always" } ], "react/jsx-curly-newline": [ "error", { "multiline": "require" } ], "operator-linebreak": "error", "yoda": "warn", "react/no-deprecated": "warn", "@typescript-eslint/member-delimiter-style": "warn", "padding-line-between-statements": [ "warn", { "blankLine": "always", "prev": [ "const", "let", "var" ], "next": "*" }, { "blankLine": "any", "prev": [ "const", "let", "var" ], "next": [ "const", "let", "var" ] }, { "blankLine": "always", "prev": [ "case", "default" ], "next": "*" }, { "blankLine": "always", "prev": [ "block-like" ], "next": "*" } ] }, "overrides": [ { "files": [ "*.ts", "*.tsx" ], "plugins": [ "import" ], "rules": { "import/named": "off", "no-unused-vars": "off", "no-undef": "off" } } ] }