{ "env": { "browser": true, "es6": true }, "extends": "eslint:recommended", "parserOptions": { "sourceType": "module" }, "globals": { "require": false, "module": false }, "rules": { // These rules relate to possible syntax or logic errors in JavaScript code: // disallow assignment operators in conditional expressions. "no-cond-assign": "error", // disallow the use of console. "no-console": "warn", // disallow constant expressions in conditions. "no-constant-condition": "error", // disallow control characters in regular expressions. "no-control-regex": "error", // disallow the use of debugger. "no-debugger": "warn", // disallow duplicate arguments in function definitions. "no-dupe-args": "error", // disallow duplicate keys in object literals. "no-dupe-keys": "error", // disallow duplicate case labels. "no-duplicate-case": "error", // disallow empty block statements. "no-empty": "error", // disallow empty character classes in regular expressions. "no-empty-character-class": "error", // disallow reassigning exceptions in catch clauses. "no-ex-assign": "error", // disallow unnecessary boolean casts. "no-extra-boolean-cast": "error", // disallow unnecessary parentheses. "no-extra-parens": "error", // disallow unnecessary semicolons. "no-extra-semi": "error", // disallow reassigning function declarations. "no-func-assign": "error", // disallow function or var declarations in nested blocks. "no-inner-declarations": "error", // disallow invalid regular expression strings in RegExp constructors. "no-invalid-regexp": "error", // disallow irregular whitespace outside of strings and comments. "no-irregular-whitespace": "error", // disallow negating the left operand in in expressions. "no-negated-in-lhs": "error", // disallow calling global object properties as functions. "no-obj-calls": "error", // disallow use of Object.prototypes builtins directly. "no-prototype-builtins": "error", // disallow multiple spaces in regular expression literals. "no-regex-spaces": "error", // disallow sparse arrays. "no-sparse-arrays": "error", // disallow confusing multiline expressions. "no-unexpected-multiline": "error", // disallow unreachable code after return, throw, continue, and break statements. "no-unreachable": "error", // disallow control flow statements in finally blocks. "no-unsafe-finally": "error", // require calls to isNaN() when checking for NaN. "use-isnan": "error", // enforce valid JSDoc comments. "valid-jsdoc": "error", // enforce comparing typeof expressions against valid strings. "valid-typeof": "error", // These rules relate to better ways of doing things to help you avoid problems: // enforce getter and setter pairs in objects. "accessor-pairs": "error", // enforce return statements in callbacks of array methods. "array-callback-return": "error", // enforce the use of variables within the scope they are defined. "block-scoped-var": "error", // enforce a maximum cyclomatic complexity allowed in a program. "complexity": "off", // require return statements to either always or never specify values. "consistent-return": "error", // enforce consistent brace style for all control statements. "curly": "error", // require default cases in switch statements. "default-case": "error", // enforce consistent newlines before and after dots. "dot-location": [ "error", "property" ], // enforce dot notation whenever possible. "dot-notation": "error", // require the use of === and !==. "eqeqeq": "error", // require for-in loops to include an if statement. "guard-for-in": "error", // disallow the use of alert, confirm, and prompt. "no-alert": "error", // disallow the use of arguments.caller or arguments.callee. "no-caller": "error", // disallow lexical declarations in case clauses. "no-case-declarations": "error", // disallow division operators explicitly at the beginning of regular expressions. "no-div-regex": "error", // disallow else blocks after return statements in if statements. "no-else-return": "off", // disallow empty functions. "no-empty-function": "error", // disallow empty destructuring patterns. "no-empty-pattern": "error", // disallow null comparisons without type-checking operators. "no-eq-null": "error", // disallow the use of eval(). "no-eval": "error", // disallow extending native types. "no-extend-native": "error", // disallow unnecessary calls to .bind(). "no-extra-bind": "error", // disallow unnecessary labels. "no-extra-label": "error", // disallow fallthrough of case statements. "no-fallthrough": "error", // disallow leading or trailing decimal points in numeric literals. "no-floating-decimal": "error", // disallow shorthand type conversions. "no-implicit-coercion": "error", // disallow var and named function declarations in the global scope. "no-implicit-globals": "error", // disallow the use of eval()-like methods. "no-implied-eval": "error", // disallow this keywords outside of classes or class-like objects. "no-invalid-this": "off", // disallow the use of the __iterator__ property. "no-iterator": "error", // disallow labeled statements. "no-labels": "error", // disallow unnecessary nested blocks. "no-lone-blocks": "error", // disallow function declarations and expressions inside loop statements. "no-loop-func": "error", // disallow magic numbers. "no-magic-numbers": [ "error", { "ignore": [1] } ], // disallow multiple spaces. "no-multi-spaces": [ "error", { "exceptions": { "Property": true, "VariableDeclarator": true, "ImportDeclaration": true } } ], // disallow multiline strings. "no-multi-str": "error", // disallow assignments to native objects or read-only global variables. "no-native-reassign": "error", // disallow new operators outside of assignments or comparisons. "no-new": "error", // disallow new operators with the Function object. "no-new-func": "error", // disallow new operators with the String, Number, and Boolean objects. "no-new-wrappers": "error", // disallow octal literals. "no-octal": "error", // disallow octal escape sequences in string literals. "no-octal-escape": "error", // disallow reassigning function parameters. "no-param-reassign": [ "error", { "props": false } ], // disallow the use of the __proto__ property. "no-proto": "error", // disallow var redeclaration. "no-redeclare": "error", // disallow assignment operators in return statements. "no-return-assign": "error", // disallow javascript: urls. "no-script-url": "error", // disallow assignments where both sides are exactly the same. "no-self-assign": "error", // disallow comparisons where both sides are exactly the same. "no-self-compare": "error", // disallow comma operators. "no-sequences": "error", // disallow throwing literals as exceptions. "no-throw-literal": "off", // disallow unmodified loop conditions. "no-unmodified-loop-condition": "error", // disallow unused expressions. "no-unused-expressions": "error", // disallow unused labels. "no-unused-labels": "error", // disallow unnecessary calls to .call() and .apply(). "no-useless-call": "error", // disallow unnecessary concatenation of literals or template literals. "no-useless-concat": "error", // disallow unnecessary escape characters. "no-useless-escape": "error", // disallow void operators. "no-void": "error", // disallow specified warning terms in comments. "no-warning-comments": "error", // disallow with statements. "no-with": "error", // enforce the consistent use of the radix argument when using parseInt(). "radix": "error", // require var declarations be placed at the top of their containing scope. "vars-on-top": "error", // require parentheses around immediate function invocations. "wrap-iife": "error", // require or disallow “Yoda” conditions. "yoda": [ "error", "never" ], // These rules relate to strict mode directives: // require or disallow strict mode directives. "strict": "error", // These rules relate to variable declarations: // require or disallow initialization in var declarations. "init-declarations": "error", // disallow catch clause parameters from shadowing variables in the outer scope. "no-catch-shadow": "off", // disallow deleting variables. "no-delete-var": "error", // disallow labels that share a name with a variable. "no-label-var": "error", // disallow specified global variables. "no-restricted-globals": "error", // disallow var declarations from shadowing variables in the outer scope. "no-shadow": [ "error", { "hoist": "all", "allow": [ "index", "event", "error" ] } ], // disallow identifiers from shadowing restricted names. "no-shadow-restricted-names": "error", // disallow the use of undeclared variables unless mentioned in /*global */ comments. "no-undef": "error", // disallow initializing variables to undefined. "no-undef-init": "error", // disallow the use of undefined as an identifier. "no-undefined": "off", // disallow unused variables. "no-unused-vars": "warn", // disallow the use of variables before they are defined. "no-use-before-define": "error", // These rules relate to code running in Node.js, or in browsers with CommonJS: // require return statements after callbacks. "callback-return": "error", // require require() calls to be placed at top-level module scope. "global-require": "off", // require error handling in callbacks. "handle-callback-err": "error", // disallow require calls to be mixed with regular var declarations. "no-mixed-requires": "error", // disallow new operators with calls to require. "no-new-require": "error", // disallow string concatenation with __dirname and __filename. "no-path-concat": "error", // disallow the use of process.env. "no-process-env": "error", // disallow the use of process.exit(). "no-process-exit": "error", // disallow specified modules when loaded by require. "no-restricted-modules": "error", // disallow synchronous methods. "no-sync": "off", // These rules relate to style guidelines, and are therefore quite subjective: // enforce consistent spacing inside array brackets. "array-bracket-spacing": [ "error", "never" ], // enforce consistent spacing inside single-line blocks. "block-spacing": "error", // enforce consistent brace style for blocks. "brace-style": [ "error", "1tbs" ], // enforce camelcase naming convention. "camelcase": "off", // require or disallow trailing commas. "comma-dangle": "error", // enforce consistent spacing before and after commas. "comma-spacing": [ "error", { "after": true, "before": false } ], // enforce consistent comma style. "comma-style": [ "error", "last" ], // enforce consistent spacing inside computed property brackets. "computed-property-spacing": [ "error", "never" ], // enforce consistent naming when capturing the current execution context. "consistent-this": "off", // enforce at least one newline at the end of files. "eol-last": "error", // require or disallow named function expressions. "func-names": "error", // enforce the consistent use of either function declarations or expressions. "func-style": "off", // disallow specified identifiers. "id-blacklist": "error", // enforce minimum and maximum identifier lengths. "id-length": "off", // require identifiers to match a specified regular expression. "id-match": "error", // enforce consistent indentation. "indent": [ "error", 2, { "VariableDeclarator": { "var": 2, "let": 2, "const": 3 } } ], // enforce the consistent use of either double or single quotes in JSX attributes. "jsx-quotes": "error", // enforce consistent spacing between keys and values in object literal properties. "key-spacing": "error", // enforce consistent spacing before and after keywords. "keyword-spacing": [ "error", { "after": true, "before": true } ], // enforce consistent linebreak style. "linebreak-style": [ "error", "unix" ], // require empty lines around comments. "lines-around-comment": "error", // enforce a maximum depth that blocks can be nested. "max-depth": "error", // enforce a maximum line length. "max-len": "off", // enforce a maximum file length. "max-lines": "off", // enforce a maximum depth that callbacks can be nested. "max-nested-callbacks": "error", // enforce a maximum number of parameters in function definitions. "max-params": "warn", // enforce a maximum number of statements allowed in function blocks. "max-statements": "warn", // enforce a maximum number of statements allowed per line. "max-statements-per-line": "error", // require constructor function names to begin with a capital letter. "new-cap": "error", // require parentheses when invoking a constructor with no arguments. "new-parens": "error", // require or disallow an empty line after var declarations. "newline-after-var": "error", // require an empty line before return statements. "newline-before-return": "error", // require a newline after each call in a method chain. "newline-per-chained-call": "error", // disallow Array constructors. "no-array-constructor": "error", // disallow bitwise operators. "no-bitwise": "error", // disallow continue statements. "no-continue": "off", // disallow inline comments after code. "no-inline-comments": "warn", // disallow if statements as the only statement in else blocks. "no-lonely-if": "off", // disallow mixes of different operators. "no-mixed-operators": "error", // disallow mixed spaces and tabs for indentation. "no-mixed-spaces-and-tabs": "error", // disallow multiple empty lines. "no-multiple-empty-lines": [ "error", { "max": 3 } ], // disallow negated conditions. "no-negated-condition": "off", // disallow nested ternary expressions. "no-nested-ternary": "error", // disallow Object constructors. "no-new-object": "error", // disallow the unary operators ++ and --. "no-plusplus": "off", // disallow specified syntax. "no-restricted-syntax": "error", // disallow spacing between function identifiers and their applications. "no-spaced-func": "error", // disallow ternary operators. "no-ternary": "off", // disallow trailing whitespace at the end of lines. "no-trailing-spaces": [ "error", { "skipBlankLines": true } ], // disallow dangling underscores in identifiers. "no-underscore-dangle": "off", // disallow ternary operators when simpler alternatives exist. "no-unneeded-ternary": "error", // disallow whitespace before properties. "no-whitespace-before-property": "error", // enforce consistent line breaks inside braces. "object-curly-newline": "error", // enforce consistent spacing inside braces. "object-curly-spacing": [ "error", "always" ], // enforce placing object properties on separate lines. "object-property-newline": [ "error", { "allowMultiplePropertiesPerLine": true } ], // enforce variables to be declared either together or separately in functions. "one-var": "off", // require or disallow newlines around var declarations. "one-var-declaration-per-line": "error", // require or disallow assignment operator shorthand where possible. "operator-assignment": "error", // enforce consistent linebreak style for operators. "operator-linebreak": "error", // require or disallow padding within blocks. "padded-blocks": "error", // require quotes around object literal property names. "quote-props": "off", // enforce the consistent use of either backticks, double, or single quotes. "quotes": "off", // require JSDoc comments. "require-jsdoc": "error", // require or disallow semicolons instead of ASI. "semi": "error", // enforce consistent spacing before and after semicolons. "semi-spacing": [ "error", { "after": true, "before": false } ], // require variables within the same declaration block to be sorted. "sort-vars": "off", // enforce consistent spacing before blocks. "space-before-blocks": "error", // enforce consistent spacing before function definition opening parenthesis. "space-before-function-paren": "error", // enforce consistent spacing inside parentheses. "space-in-parens": [ "error", "never" ], // require spacing around operators. "space-infix-ops": "error", // enforce consistent spacing before or after unary operators. "space-unary-ops": "error", // enforce consistent spacing after the // or /* in a comment "spaced-comment": "off", // require or disallow the Unicode BOM. "unicode-bom": "error", // require parenthesis around regex literals. "wrap-regex": "error", // These rules relate to ES6, also known as ES2015: // require braces around arrow function bodies. "arrow-body-style": "off", // require parentheses around arrow function arguments. "arrow-parens": [ "error", "always" ], // enforce consistent spacing before and after the arrow in arrow functions. "arrow-spacing": [ "error", { "after": true, "before": true } ], // require super() calls in constructors. "constructor-super": "error", // enforce consistent spacing around * operators in generator functions. "generator-star-spacing": "error", // disallow reassigning class members. "no-class-assign": "error", // disallow arrow functions where they could be confused with comparisons. "no-confusing-arrow": "off", // disallow reassigning const variables. "no-const-assign": "error", // disallow duplicate class members. "no-dupe-class-members": "error", // disallow duplicate module imports. "no-duplicate-imports": "error", // disallow new operators with the Symbol object. "no-new-symbol": "error", // disallow specified modules when loaded by import. "no-restricted-imports": "error", // disallow this/super before calling super() in constructors. "no-this-before-super": "error", // disallow unnecessary computed property keys in object literals. "no-useless-computed-key": "error", // disallow unnecessary constructors. "no-useless-constructor": "error", // disallow renaming import, export, and destructured assignments to the same name. "no-useless-rename": "error", // require let or const instead of var. "no-var": "error", // require or disallow method and property shorthand syntax for object literals. "object-shorthand": "error", // require arrow functions as callbacks. "prefer-arrow-callback": "error", // require const declarations for variables that are never reassigned after declared. "prefer-const": "error", // require Reflect methods where applicable. "prefer-reflect": "off", // require rest parameters instead of arguments. "prefer-rest-params": "error", // require spread operators instead of .apply(). "prefer-spread": "error", // require template literals instead of string concatenation. "prefer-template": "error", // require generator functions to contain yield. "require-yield": "error", // enforce spacing between rest and spread operators and their expressions. "rest-spread-spacing": "error", // enforce sorted import declarations within modules. "sort-imports": "off", // require or disallow spacing around embedded expressions of template strings. "template-curly-spacing": [ "error", "never" ], // require or disallow spacing around the * in yield* expressions. "yield-star-spacing": "error" } }