env: browser: true node: true jest: true extends: - eslint:recommended globals: require: true describe: true expect: true it: true Promise: true Symbol: true parserOptions: sourceType: module ecmaVersion: 8 ecmaFeatures: jsx: true modules: true experimentalObjectRestSpread: true rules: array-callback-return: 2 # enforces return statements in callbacks of array’s methods array-bracket-newline: [2, consistent] # enforces line breaks after opening and before closing array brackets arrow-body-style: [2, as-needed] # require braces in arrow function body arrow-parens: [2, as-needed] # require parens in arrow function arguments arrow-spacing: 2 # require space before/after arrow function’s arrow block-scoped-var: 2 # treat var as block scoped block-spacing: [2, always] # enforce spaces inside of blocks brace-style: [2, allman] # enforce brace style camelcase: 2 # require camel case names comma-dangle: 1 # disallow trailing commas in object literals comma-spacing: # enforce spacing before and after comma - 2 - before: false after: true comma-style: [2, last] # enforce one true comma style complexity: [1, 15] # specify the maximum cyclomatic complexity allowed in a program consistent-return: 2 # require return statements to either always or never specify values consistent-this: [2, "self"] # enforces consistent naming when capturing the current execution context curly: 2 # specify curly brace conventions for all control statements default-case: 2 # require default cases in switch statements dot-notation: 2 # encourages use of dot notation whenever possible eol-last: 2 # enforce newline at the end of file, with no multiple empty lines eqeqeq: 2 # require the use of === and !== for-direction: 2 # enforce “for” loop update clause moving the counter in the right direction. func-name-matching: # require function names to match the name of the variable or property to which they are assigned - 2 - always - includeCommonJSModuleExports: true generator-star-spacing: [2, after] # enforce spacing around the * in generator functions getter-return: 2 # enforce that a return statement is present in property getters global-require: 2 # enforce require() on the top-level module scope guard-for-in: 2 # make sure for-in loops have an if statement indent: # set a specific tab width - 2 - 4 - SwitchCase: 1 key-spacing: # enforces spacing between keys and values in object literal properties - 2 - align: colon afterColon: true beforeColon: true mode: minimum keyword-spacing: 2 # require a space after certain keywords linebreak-style: [2, unix] # enforce consistent linebreak style lines-between-class-members: 2 # require or disallow an empty line between class members max-depth: [2, 4] # enforce a maximum depth that blocks can be nested max-nested-callbacks: [2, 4] # specify the maximum depth callbacks can be nested max-len: # enforce a maximum line length - 2 - code: 120 ignoreRegExpLiterals: true ignoreStrings: true ignoreTemplateLiterals: true ignoreUrls: true max-lines: # enforce a maximum file length - 2 - max: 400 skipBlankLines: true skipComments: true max-params: [2, 5] # enforce a maximum number of parameters in function definitions max-statements: [2, 50] # enforce a maximum number of statements allowed in function blocks max-statements-per-line: # enforce a maximum number of statements allowed per line - 2 - max: 1 multiline-ternary: [2, always-multiline] # enforce or disallow newlines between operands of ternary expressions new-cap: # require a capital letter for constructors - 2 - newIsCapExceptionPattern: ^jf new-parens: 2 # disallow the omission of parentheses when invoking a constructor with no arguments newline-per-chained-call: 2 # require a newline after each call in a method chain no-alert: 1 # disallow the use of alert, confirm, and prompt no-array-constructor: 2 # disallow use of the Array constructor no-await-in-loop: 2 # disallow await inside of loops no-buffer-constructor: 2 # disallow use of the Buffer() constructor no-caller: 2 # disallow use of arguments.caller or arguments.callee no-catch-shadow: 2 # disallow the catch clause parameter name being the same as a variable in the outer scope no-console: 0 no-continue: 2 # disallow continue statements no-confusing-arrow: # disallow arrow functions where they could be confused with comparisons - 2 - allowParens: true no-duplicate-imports: 2 # disallow duplicate imports no-eval: 2 # disallow use of eval() no-extend-native: 2 # disallow adding to native types no-extra-bind: 2 # disallow unnecessary function binding no-floating-decimal: 2 # disallow the use of leading or trailing decimal points in numeric literals no-func-assign: 0 # disallow overwriting functions written as function declarations no-implied-eval: 2 # disallow use of eval()-like methods no-inner-declarations: 1 # disallow function or variable declarations in nested blocks no-invalid-this: 2 # disallow this keywords outside of classes or class-like objects no-iterator: 2 # disallow usage of __iterator__ property no-label-var: 2 # disallow labels that share a name with a variable no-labels: 2 # disallow use of labeled statements no-lone-blocks: 2 # disallow unnecessary nested blocks no-lonely-if: 2 # disallow if as the only statement in an else block no-loop-func: 2 # disallow function declarations and expressions inside loop statements no-multi-str: 2 # disallow use of multiline strings no-multiple-empty-lines: 2 # disallow multiple empty lines no-native-reassign: 2 # disallow reassignments of native objects no-negated-condition: 2 # disallow negated conditions no-negated-in-lhs: 2 # disallow negation of the left operand of an in expression no-new: 2 # disallow use of new operator when not part of the assignment or comparison no-new-object: 2 # disallow use of the Object constructor no-new-require: 2 # disallow use of new operator with the require function no-new-wrappers: 2 # disallows creating new instances of String,Number, and Boolean no-octal: 0 # disallow use of octal literals no-path-concat: 2 # disallow string concatenation with __dirname and __filename no-proto: 2 # disallow usage of __proto__ property no-redeclare: 1 # disallow declaring the same variable more then once no-regex-spaces: 1 # disallow multiple spaces in a regular expression literal no-reserved-keys: 0 # disallow reserved words being used as object literal keys no-return-await: 2 # disallow unnecessary return await no-script-url: 2 # disallow use of javascript urls. no-self-compare: 2 # disallow comparisons where both sides are exactly the same no-sequences: 2 # disallow use of comma operator no-shadow-restricted-names: 2 # disallow shadowing of names such as arguments no-shadow: 1 # disallow declaration of variables already declared in the outer scope no-spaced-func: 2 # disallow space between function identifier and application no-tabs: 2 # disallow all tabs no-template-curly-in-string: 2 # disallow template literal placeholder syntax in regular strings no-trailing-spaces: 2 # disallow trailing whitespace at the end of lines no-throw-literal: 2 # restrict what can be thrown as an exception no-undef-init: 2 # disallow use of undefined when initializing variables no-unmodified-loop-condition: 2 # disallow unmodified conditions of loops no-unneeded-ternary: 2 # disallow ternary operators when simpler alternatives exist no-unused-expressions: 2 # disallow unused expressions no-unused-vars: # disallow declaration of variables that are not used in the code - 2 - args: after-used ignoreRestSiblings: true no-use-before-define: 2 # disallow early use no-useless-call: 2 # disallow unnecessary .call() and .apply() no-useless-computed-key: 2 # disallow unnecessary computed property keys on objects no-useless-concat: 2 # disallow unnecessary concatenation of strings no-useless-constructor: 2 # disallow unnecessary constructor no-useless-rename: # disallow renaming import, export, and destructured assignments to the same name - 2 - ignoreDestructuring: false ignoreExport: false ignoreImport: false no-useless-return: 2 # disallow redundant return statements no-var: 2 # require let or const instead of var no-void: 2 # disallow use of void operator no-whitespace-before-property: 2 # disallow whitespace before properties no-with: 2 # disallow use of the with statement object-curly-newline: # enforce consistent line breaks inside braces - 2 - ObjectExpression: consistent: true multiline: true ObjectPattern: minProperties: 5 multiline: true object-curly-spacing: # enforce consistent spacing inside braces - 2 - always - arraysInObjects: true objectsInObjects: true object-shorthand: 2 # require Object Literal Shorthand Syntax one-var: [2, never] # enforce variables to be declared either together or separately in functions padding-line-between-statements: # require or disallow padding lines between statements - 2 - blankLine: always prev: class next: '*' - blankLine: always prev: '*' next: class - blankLine: always prev: '*' next: function - blankLine: always prev: function next: '*' - blankLine: always prev: '*' next: return prefer-arrow-callback: 2 # require using arrow functions for callbacks prefer-const: 2 # suggest using const prefer-numeric-literals: 2 # disallow parseInt() and Number.parseInt() in favor of binary, octal, and hexadecimal literals prefer-promise-reject-errors: 2 # require using Error objects as Promise rejection reasons prefer-rest-params: 2 # suggest using the rest parameters instead of arguments prefer-spread: 2 # suggest using the spread operator instead of .apply() prefer-template: 2 # suggest using template literals instead of string concatenation quotes: # specify whether double or single quotes should be used - 1 - single - allowTemplateLiterals: true avoidEscape: true radix: 2 # require use of the second argument for parseInt() require-await: 2 # disallow async functions which have no await expression require-jsdoc: # require JSDoc comments - 2 - require: ArrowFunctionExpression: false ClassDeclaration: true FunctionDeclaration: true FunctionExpression: true MethodDefinition: true rest-spread-spacing: 2 # enforce spacing between rest and spread operators and their expressions semi: 2 # require or disallow use of semicolons instead of ASI semi-spacing: - 2 - before: false after: true semi-style: [2, last] # enforce location of semicolons sort-imports: # import sorting - 2 - ignoreCase: true sort-vars: 0 # sort variables within the same declaration block space-before-blocks: 2 # disallow space before blocks space-before-function-paren: # disallow a space before function parenthesis - 2 - anonymous: always asyncArrow: always named: never space-in-brackets: 0 # disallow spaces inside brackets space-infix-ops: 2 # require spacing around infix operators space-unary-ops: # require spacing around unary operators - 2 - words: true nonwords: false spaced-comment: 2 # disallow a whitespace (space or tab) beginning a comment strict: [2, never] # require that all functions are run in strict mode symbol-description: 2 # require symbol description template-curly-spacing: 2 # enforce usage of spacing in template strings template-tag-spacing: 2 # disallow spacing between template tags and their literals unicode-bom: 2 # disallow the Unicode Byte Order Mark (BOM) valid-jsdoc: # ensure JSDoc comments are valid - 2 - prefer: returns: return preferType: array: Array boolean: Boolean number: Number object: Object string: String requireReturn: false requireReturnType: true wrap-iife: [2, inside] # require immediate function invocation to be wrapped in parentheses yield-star-spacing: [2, after] # enforce spacing around the * in yield* expressions yoda: 2 # disallow yoda conditions