module.exports = { globals: {}, extends: 'eslint:recommended', rules: { // Possible Errors https://eslint.org/docs/rules/#possible-errors 'no-await-in-loop': 'warn', 'no-console': 'warn', 'no-constant-condition': ['error', { checkLoops: false }], 'no-dupe-else-if': 'error', 'no-extra-parens': ['error', { conditionalAssign: false }], 'no-import-assign': 'error', 'no-setter-return': 'error', 'no-template-curly-in-string': 'error', 'valid-typeof': ['error', { requireStringLiterals: true }], // Best Practices https://eslint.org/docs/rules/#best-practices 'accessor-pairs': 'off', 'array-callback-return': ['error', { allowImplicit: false }], 'block-scoped-var': 'error', 'class-methods-use-this': 'error', complexity: ['warn', { max: 5 }], 'consistent-return': ['error', { treatUndefinedAsUnspecified: false }], curly: ['error', 'multi'], 'default-case': ['error', { commentPattern: '^no\\sdefault' }], 'default-param-last': 'error', 'dot-location': ['error', 'property'], 'dot-notation': ['error', { allowKeywords: true }], eqeqeq: ['error', 'always'], 'grouped-accessor-pairs': ['error', 'getBeforeSet'], 'guard-for-in': 'error', 'max-classes-per-file': ['error', 1], 'no-alert': 'error', 'no-caller': 'error', 'no-constructor-return': 'error', 'no-div-regex': 'error', 'no-else-return': ['error', { allowElseIf: false }], 'no-empty-function': 'error', 'no-eq-null': 'error', 'no-eval': ['error', { allowIndirect: false }], 'no-extend-native': 'error', 'no-extra-bind': 'error', 'no-extra-label': 'error', 'no-fallthrough': ['error', { commentPattern: 'break[\\s\\w]*omitted' }], 'no-floating-decimal': 'error', 'no-implicit-coercion': 'error', 'no-implicit-globals': 'error', 'no-implied-eval': 'error', 'no-invalid-this': 'error', 'no-iterator': 'error', 'no-labels': 'off', 'no-lone-blocks': 'error', 'no-loop-func': 'error', 'no-magic-numbers': ['error', { enforceConst: true, ignoreArrayIndexes: true, detectObjects: false }], 'no-multi-spaces': 'error', 'no-multi-str': 'error', 'no-new': 'error', 'no-new-func': '', // disallow `new` operators with the `Function` object 'no-new-wrappers': '', // disallow `new` operators with the `String`, `Number`, and `Boolean` objects 'no-octal-escape': '', // disallow octal escape sequences in string literals 'no-param-reassign': '', // disallow reassigning `function` parameters 'no-proto': 'error', 'no-restricted-properties': '', // disallow certain properties on certain objects 'no-return-assign': '', // disallow assignment operators in `return` statements 'no-return-await': 'error', 'no-script-url': '', // disallow `javascript:` urls 'no-self-compare': 'error', 'no-sequences': '', // disallow comma operators 'no-throw-literal': '', // disallow throwing literals as exceptions 'no-unmodified-loop-condition': '', // disallow unmodified loop conditions 'no-unused-expressions': 'error', 'no-useless-call': '', // disallow unnecessary calls to `.call()` and `.apply()` 'no-useless-concat': 'error', 'no-useless-return': 'error', 'no-void': '', // disallow `void` operators 'no-warning-comments': '', // disallow specified warning terms in comments 'prefer-named-capture-group': '', // enforce using named capture group in regular expression 'prefer-promise-reject-errors': '', // require using Error objects as Promise rejection reasons 'prefer-regex-literals': '', // disallow use of the `RegExp` constructor in favor of regular expression literals radix: '', // enforce the consistent use of the radix argument when using `parseInt()` 'require-await': 'error', 'require-unicode-regexp': '', // enforce the use of `u` flag on RegExp 'vars-on-top': 'error', 'wrap-iife': '', // require parentheses around immediate `function` invocations yoda: '', // require or disallow "Yoda" conditions // ## Strict Mode // These rules relate to strict mode directives: strict: ['error', 'safe'], // ## Variables // These rules relate to variable declarations: 'init-declarations': '', // require or disallow initialization in variable declarations 'no-label-var': '', // disallow labels that share a name with a variable 'no-restricted-globals': '', // disallow specified global variables 'no-shadow': '', // disallow variable declarations from shadowing variables declared in the outer scope 'no-undef-init': '', // disallow initializing variables to `undefined` 'no-undefined': '', // disallow the use of `undefined` as an identifier 'no-use-before-define': '', // disallow the use of variables before they are defined // ## Node.js and CommonJS // These rules relate to code running in Node.js, or in browsers with CommonJS: 'callback-return': '', // require `return` statements after callbacks 'global-require': '', // require `require()` calls to be placed at top-level module scope 'handle-callback-err': '', // require error handling in callbacks 'no-buffer-constructor': '', // disallow use of the `Buffer()` constructor 'no-mixed-requires': '', // disallow `require` calls to be mixed with regular variable declarations 'no-new-require': '', // disallow `new` operators with calls to `require` 'no-path-concat': '', // disallow string concatenation with `__dirname` and `__filename` 'no-process-env': '', // disallow the use of `process.env` 'no-process-exit': '', // disallow the use of `process.exit()` 'no-restricted-modules': '', // disallow specified modules when loaded by `require` 'no-sync': '', // disallow synchronous methods // ## Stylistic Issues // These rules relate to style guidelines, and are therefore quite subjective: 'array-bracket-newline': '', // enforce linebreaks after opening and before closing array brackets 'array-bracket-spacing': '', // enforce consistent spacing inside array brackets 'array-element-newline': '', // enforce line breaks after each array element 'block-spacing': '', // disallow or enforce spaces inside of blocks after opening block and before closing block 'brace-style': '', // enforce consistent brace style for blocks camelcase: '', // enforce camelcase naming convention 'capitalized-comments': '', // enforce or disallow capitalization of the first letter of a comment 'comma-dangle': '', // require or disallow trailing commas 'comma-spacing': '', // enforce consistent spacing before and after commas 'comma-style': '', // enforce consistent comma style 'computed-property-spacing': '', // enforce consistent spacing inside computed property brackets 'consistent-this': '', // enforce consistent naming when capturing the current execution context 'eol-last': '', // require or disallow newline at the end of files 'func-call-spacing': '', // require or disallow spacing between function identifiers and their invocations 'func-name-matching': '', // require function names to match the name of the variable or property to which they are assigned 'func-names': '', // require or disallow named `function` expressions 'func-style': '', // enforce the consistent use of either `function` declarations or expressions 'function-call-argument-newline': '', // enforce line breaks between arguments of a function call 'function-paren-newline': '', // enforce consistent line breaks inside function parentheses 'id-blacklist': '', // disallow specified identifiers 'id-length': '', // enforce minimum and maximum identifier lengths 'id-match': '', // require identifiers to match a specified regular expression 'implicit-arrow-linebreak': '', // enforce the location of arrow function bodies indent: ['error', 2], 'jsx-quotes': '', // enforce the consistent use of either double or single quotes in JSX attributes 'key-spacing': '', // enforce consistent spacing between keys and values in object literal properties 'keyword-spacing': '', // enforce consistent spacing before and after keywords 'line-comment-position': '', // enforce position of line comments 'linebreak-style': '', // enforce consistent linebreak style 'lines-around-comment': '', // require empty lines around comments 'lines-between-class-members': '', // require or disallow an empty line between class members 'max-depth': '', // enforce a maximum depth that blocks can be nested 'max-len': '', // enforce a maximum line length 'max-lines': '', // enforce a maximum number of lines per file 'max-lines-per-function': '', // enforce a maximum number of line of code in a function 'max-nested-callbacks': '', // enforce a maximum depth that callbacks can be nested 'max-params': '', // enforce a maximum number of parameters in function definitions 'max-statements': '', // enforce a maximum number of statements allowed in function blocks 'max-statements-per-line': '', // enforce a maximum number of statements allowed per line 'multiline-comment-style': '', // enforce a particular style for multiline comments 'multiline-ternary': '', // enforce newlines between operands of ternary expressions 'new-cap': '', // require constructor names to begin with a capital letter 'new-parens': '', // enforce or disallow parentheses when invoking a constructor with no arguments 'newline-per-chained-call': '', // require a newline after each call in a method chain 'no-array-constructor': '', // disallow `Array` constructors 'no-bitwise': '', // disallow bitwise operators 'no-continue': '', // disallow `continue` statements 'no-inline-comments': '', // disallow inline comments after code 'no-lonely-if': '', // disallow `if` statements as the only statement in `else` blocks 'no-mixed-operators': '', // disallow mixed binary operators 'no-multi-assign': '', // disallow use of chained assignment expressions 'no-multiple-empty-lines': '', // disallow multiple empty lines 'no-negated-condition': '', // disallow negated conditions 'no-nested-ternary': '', // disallow nested ternary expressions 'no-new-object': '', // disallow `Object` constructors 'no-plusplus': '', // disallow the unary operators `++` and `--` 'no-restricted-syntax': '', // disallow specified syntax 'no-tabs': '', // disallow all tabs 'no-ternary': '', // disallow ternary operators 'no-trailing-spaces': '', // disallow trailing whitespace at the end of lines 'no-underscore-dangle': '', // disallow dangling underscores in identifiers 'no-unneeded-ternary': '', // disallow ternary operators when simpler alternatives exist 'no-whitespace-before-property': '', // disallow whitespace before properties 'nonblock-statement-body-position': '', // enforce the location of single-line statements 'object-curly-newline': '', // enforce consistent line breaks inside braces 'object-curly-spacing': '', // enforce consistent spacing inside braces 'object-property-newline': '', // enforce placing object properties on separate lines 'one-var': '', // enforce variables to be declared either together or separately in functions 'one-var-declaration-per-line': '', // require or disallow newlines around variable declarations 'operator-assignment': '', // require or disallow assignment operator shorthand where possible 'operator-linebreak': '', // enforce consistent linebreak style for operators 'padded-blocks': '', // require or disallow padding within blocks 'padding-line-between-statements': '', // require or disallow padding lines between statements 'prefer-exponentiation-operator': '', // disallow the use of `Math.pow` in favor of the `**` operator 'prefer-object-spread': '', // disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead. 'quote-props': '', // require quotes around object literal property names quotes: ['error', 'single'], semi: ['error', 'always'], 'semi-spacing': '', // enforce consistent spacing before and after semicolons 'semi-style': '', // enforce location of semicolons 'sort-keys': '', // require object keys to be sorted 'sort-vars': '', // require variables within the same declaration block to be sorted 'space-before-blocks': '', // enforce consistent spacing before blocks 'space-before-function-paren': '', // enforce consistent spacing before `function` definition opening parenthesis 'space-in-parens': '', // enforce consistent spacing inside parentheses 'space-infix-ops': '', // require spacing around infix operators 'space-unary-ops': '', // enforce consistent spacing before or after unary operators 'spaced-comment': '', // enforce consistent spacing after the `//` or `/*` in a comment 'switch-colon-spacing': '', // enforce spacing around colons of switch statements 'template-tag-spacing': '', // require or disallow spacing between template tags and their literals 'unicode-bom': '', // require or disallow Unicode byte order mark (BOM) 'wrap-regex': '', // require parenthesis around regex literals // ## ECMAScript 6 // These rules relate to ES6, also known as ES2015: 'arrow-body-style': '', // require braces around arrow function bodies 'arrow-parens': '', // require parentheses around arrow function arguments 'arrow-spacing': '', // enforce consistent spacing before and after the arrow in arrow functions 'generator-star-spacing': '', // enforce consistent spacing around `*` operators in generator functions 'no-confusing-arrow': '', // disallow arrow functions where they could be confused with comparisons 'no-duplicate-imports': '', // disallow duplicate module imports 'no-restricted-imports': '', // disallow specified modules when loaded by `import` 'no-useless-computed-key': '', // disallow unnecessary computed property keys in objects and classes 'no-useless-constructor': '', // disallow unnecessary constructors 'no-useless-rename': '', // disallow renaming import, export, and destructured assignments to the same name 'no-var': '', // require `let` or `const` instead of `var` 'object-shorthand': '', // require or disallow method and property shorthand syntax for object literals 'prefer-arrow-callback': '', // require using arrow functions for callbacks 'prefer-const': '', // require `const` declarations for variables that are never reassigned after declared 'prefer-destructuring': '', // require destructuring from arrays and/or objects 'prefer-numeric-literals': '', // disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals 'prefer-rest-params': '', // require rest parameters instead of `arguments` 'prefer-spread': '', // require spread operators instead of `.apply()` 'prefer-template': '', // require template literals instead of string concatenation 'rest-spread-spacing': '', // enforce spacing between rest and spread operators and their expressions 'sort-imports': '', // enforce sorted import declarations within modules 'symbol-description': '', // require symbol descriptions 'template-curly-spacing': '', // require or disallow spacing around embedded expressions of template strings 'yield-star-spacing': '' // require or disallow spacing around the `*` in `yield*` expressions } }