Last active
May 22, 2019 18:16
-
-
Save victornpb/5bedf3fe048fa45e9e9fb9f24fe9560d to your computer and use it in GitHub Desktop.
eslintrc containing all rules with description
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// All rules | |
// (R=Recommended,F=Fixable) | |
// Use .json5 highlighting | |
{ | |
// Possible Errors | |
// These rules relate to possible syntax or logic errors in JavaScript code: | |
"for-direction": "error", // (R,) enforce “for” loop update clause moving the counter in the right direction. | |
"getter-return": "error", // (R,) enforce return statements in getters | |
"no-async-promise-executor": "error", // (R,) disallow using an async function as a Promise executor | |
"no-await-in-loop": "off", // (,) disallow await inside of loops | |
"no-compare-neg-zero": "error", // (R,) disallow comparing against -0 | |
"no-cond-assign": "error", // (R,) disallow assignment operators in conditional expressions | |
"no-console": "off", // (,) disallow the use of console | |
"no-constant-condition": "error", // (R,) disallow constant expressions in conditions | |
"no-control-regex": "error", // (R,) disallow control characters in regular expressions | |
"no-debugger": "error", // (R,) disallow the use of debugger | |
"no-dupe-args": "error", // (R,) disallow duplicate arguments in function definitions | |
"no-dupe-keys": "error", // (R,) disallow duplicate keys in object literals | |
"no-duplicate-case": "error", // (R,) disallow duplicate case labels | |
"no-empty": "error", // (R,) disallow empty block statements | |
"no-empty-character-class": "error", // (R,) disallow empty character classes in regular expressions | |
"no-ex-assign": "error", // (R,) disallow reassigning exceptions in catch clauses | |
"no-extra-boolean-cast": "error", // (R,F) disallow unnecessary boolean casts | |
"no-extra-parens": "off", // (,F) disallow unnecessary parentheses | |
"no-extra-semi": "error", // (R,F) disallow unnecessary semicolons | |
"no-func-assign": "error", // (R,) disallow reassigning function declarations | |
"no-inner-declarations": "error", // (R,) disallow variable or function declarations in nested blocks | |
"no-invalid-regexp": "error", // (R,) disallow invalid regular expression strings in RegExp constructors | |
"no-irregular-whitespace": "error", // (R,) disallow irregular whitespace | |
"no-misleading-character-class": "error", // (R,) disallow characters which are made with multiple code points in character class syntax | |
"no-obj-calls": "error", // (R,) disallow calling global object properties as functions | |
"no-prototype-builtins": "error", // (R,) disallow calling some Object.prototype methods directly on objects | |
"no-regex-spaces": "error", // (R,F) disallow multiple spaces in regular expressions | |
"no-sparse-arrays": "error", // (R,) disallow sparse arrays | |
"no-template-curly-in-string": "off", // (,) disallow template literal placeholder syntax in regular strings | |
"no-unexpected-multiline": "error", // (R,) disallow confusing multiline expressions | |
"no-unreachable": "error", // (R,) disallow unreachable code after return, throw, continue, and breakstatements | |
"no-unsafe-finally": "error", // (R,) disallow control flow statements in finally blocks | |
"no-unsafe-negation": "error", // (R,F) disallow negating the left operand of relational operators | |
"require-atomic-updates": "error", // (R,) disallow assignments that can lead to race conditions due to usage of awaitor yield | |
"use-isnan": "error", // (R,) require calls to isNaN() when checking for NaN | |
"valid-typeof": "error", // (R,) enforce comparing typeof expressions against valid strings | |
// Best Practices | |
// These rules relate to better ways of doing things to help you avoid problems: | |
"accessor-pairs": "off", // (,) enforce getter and setter pairs in objects | |
"array-callback-return": "off", // (,) enforce return statements in callbacks of array methods | |
"block-scoped-var": "off", // (,) enforce the use of variables within the scope they are defined | |
"class-methods-use-this": "off", // (,) enforce that class methods utilize this | |
"complexity": "off", // (,) enforce a maximum cyclomatic complexity allowed in a program | |
"consistent-return": "off", // (,) require return statements to either always or never specify values | |
"curly": "off", // (,F) enforce consistent brace style for all control statements | |
"default-case": "off", // (,) require default cases in switch statements | |
"dot-location": "off", // (,F) enforce consistent newlines before and after dots | |
"dot-notation": "off", // (,F) enforce dot notation whenever possible | |
"eqeqeq": "off", // (,F) require the use of === and !== | |
"guard-for-in": "off", // (,) require for-in loops to include an if statement | |
"max-classes-per-file": "off", // (,) enforce a maximum number of classes per file | |
"no-alert": "off", // (,) disallow the use of alert, confirm, and prompt | |
"no-caller": "off", // (,) disallow the use of arguments.caller or arguments.callee | |
"no-case-declarations": "error", // (R,) disallow lexical declarations in case clauses | |
"no-div-regex": "off", // (,) disallow division operators explicitly at the beginning of regular expressions | |
"no-else-return": "off", // (,F) disallow else blocks after return statements in if statements | |
"no-empty-function": "off", // (,) disallow empty functions | |
"no-empty-pattern": "error", // (R,) disallow empty destructuring patterns | |
"no-eq-null": "off", // (,) disallow null comparisons without type-checking operators | |
"no-eval": "off", // (,) disallow the use of eval() | |
"no-extend-native": "off", // (,) disallow extending native types | |
"no-extra-bind": "off", // (,F) disallow unnecessary calls to .bind() | |
"no-extra-label": "off", // (,F) disallow unnecessary labels | |
"no-fallthrough": "error", // (R,) disallow fallthrough of case statements | |
"no-floating-decimal": "off", // (,F) disallow leading or trailing decimal points in numeric literals | |
"no-global-assign": "error", // (R,) disallow assignments to native objects or read-only global variables | |
"no-implicit-coercion": "off", // (,F) disallow shorthand type conversions | |
"no-implicit-globals": "off", // (,) disallow variable and function declarations in the global scope | |
"no-implied-eval": "off", // (,) disallow the use of eval()-like methods | |
"no-invalid-this": "off", // (,) disallow this keywords outside of classes or class-like objects | |
"no-iterator": "off", // (,) disallow the use of the __iterator__ property | |
"no-labels": "off", // (,) disallow labeled statements | |
"no-lone-blocks": "off", // (,) disallow unnecessary nested blocks | |
"no-loop-func": "off", // (,) disallow function declarations that contain unsafe references inside loop statements | |
"no-magic-numbers": "off", // (,) disallow magic numbers | |
"no-multi-spaces": "off", // (,F) disallow multiple spaces | |
"no-multi-str": "off", // (,) disallow multiline strings | |
"no-new": "off", // (,) disallow new operators outside of assignments or comparisons | |
"no-new-func": "off", // (,) disallow new operators with the Function object | |
"no-new-wrappers": "off", // (,) disallow new operators with the String, Number, and Boolean objects | |
"no-octal": "error", // (R,) disallow octal literals | |
"no-octal-escape": "off", // (,) disallow octal escape sequences in string literals | |
"no-param-reassign": "off", // (,) disallow reassigning function parameters | |
"no-proto": "off", // (,) disallow the use of the __proto__ property | |
"no-redeclare": "error", // (R,) disallow variable redeclaration | |
"no-restricted-properties": "off", // (,) disallow certain properties on certain objects | |
"no-return-assign": "off", // (,) disallow assignment operators in return statements | |
"no-return-await": "off", // (,) disallow unnecessary return await | |
"no-script-url": "off", // (,) disallow javascript: urls | |
"no-self-assign": "error", // (R,) disallow assignments where both sides are exactly the same | |
"no-self-compare": "off", // (,) disallow comparisons where both sides are exactly the same | |
"no-sequences": "off", // (,) disallow comma operators | |
"no-throw-literal": "off", // (,) disallow throwing literals as exceptions | |
"no-unmodified-loop-condition": "off", // (,) disallow unmodified loop conditions | |
"no-unused-expressions": "off", // (,) disallow unused expressions | |
"no-unused-labels": "error", // (R,F) disallow unused labels | |
"no-useless-call": "off", // (,) disallow unnecessary calls to .call() and .apply() | |
"no-useless-catch": "error", // (R,) disallow unnecessary catch clauses | |
"no-useless-concat": "off", // (,) disallow unnecessary concatenation of literals or template literals | |
"no-useless-escape": "error", // (R,) disallow unnecessary escape characters | |
"no-useless-return": "off", // (,F) disallow redundant return statements | |
"no-void": "off", // (,) disallow void operators | |
"no-warning-comments": "off", // (,) disallow specified warning terms in comments | |
"no-with": "error", // (R,) disallow with statements | |
"prefer-named-capture-group": "off", // (,) enforce using named capture group in regular expression | |
"prefer-promise-reject-errors": "off", // (,) require using Error objects as Promise rejection reasons | |
"radix": "off", // (,) enforce the consistent use of the radix argument when using parseInt() | |
"require-await": "off", // (,) disallow async functions which have no await expression | |
"require-unicode-regexp": "off", // (,) enforce the use of u flag on RegExp | |
"vars-on-top": "off", // (,) require var declarations be placed at the top of their containing scope | |
"wrap-iife": "off", // (,F) require parentheses around immediate function invocations | |
"yoda": "off", // (,F) require or disallow “Yoda” conditions | |
// Strict Mode | |
// These rules relate to strict mode directives: | |
"strict": "off", // (,F) require or disallow strict mode directives | |
// Variables | |
// These rules relate to variable declarations: | |
"init-declarations": "off", // (,) require or disallow initialization in variable declarations | |
"no-delete-var": "error", // (R,) disallow deleting variables | |
"no-label-var": "off", // (,) disallow labels that share a name with a variable | |
"no-restricted-globals": "off", // (,) disallow specified global variables | |
"no-shadow": "off", // (,) disallow variable declarations from shadowing variables declared in the outer scope | |
"no-shadow-restricted-names": "error", // (R,) disallow identifiers from shadowing restricted names | |
"no-undef": "error", // (R,) disallow the use of undeclared variables unless mentioned in /*global */comments | |
"no-undef-init": "off", // (,F) disallow initializing variables to undefined | |
"no-undefined": "off", // (,) disallow the use of undefined as an identifier | |
"no-unused-vars": "error", // (R,) disallow unused variables | |
"no-use-before-define": "off", // (,) 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": "off", // (,) require return statements after callbacks | |
"global-require": "off", // (,) require require() calls to be placed at top-level module scope | |
"handle-callback-err": "off", // (,) require error handling in callbacks | |
"no-buffer-constructor": "off", // (,) disallow use of the Buffer() constructor | |
"no-mixed-requires": "off", // (,) disallow require calls to be mixed with regular variable declarations | |
"no-new-require": "off", // (,) disallow new operators with calls to require | |
"no-path-concat": "off", // (,) disallow string concatenation with __dirname and __filename | |
"no-process-env": "off", // (,) disallow the use of process.env | |
"no-process-exit": "off", // (,) disallow the use of process.exit() | |
"no-restricted-modules": "off", // (,) disallow specified modules when loaded by require | |
"no-sync": "off", // (,) disallow synchronous methods | |
// Stylistic Issues | |
// These rules relate to style guidelines, and are therefore quite subjective: | |
"array-bracket-newline": "off", // (,F) enforce linebreaks after opening and before closing array brackets | |
"array-bracket-spacing": "off", // (,F) enforce consistent spacing inside array brackets | |
"array-element-newline": "off", // (,F) enforce line breaks after each array element | |
"block-spacing": "off", // (,F) disallow or enforce spaces inside of blocks after opening block and before closing block | |
"brace-style": "off", // (,F) enforce consistent brace style for blocks | |
"camelcase": "off", // (,) enforce camelcase naming convention | |
"capitalized-comments": "off", // (,F) enforce or disallow capitalization of the first letter of a comment | |
"comma-dangle": "off", // (,F) require or disallow trailing commas | |
"comma-spacing": "off", // (,F) enforce consistent spacing before and after commas | |
"comma-style": "off", // (,F) enforce consistent comma style | |
"computed-property-spacing": "off", // (,F) enforce consistent spacing inside computed property brackets | |
"consistent-this": "off", // (,) enforce consistent naming when capturing the current execution context | |
"eol-last": "off", // (,F) require or disallow newline at the end of files | |
"func-call-spacing": "off", // (,F) require or disallow spacing between function identifiers and their invocations | |
"func-name-matching": "off", // (,) require function names to match the name of the variable or property to which they are assigned | |
"func-names": "off", // (,) require or disallow named function expressions | |
"func-style": "off", // (,) enforce the consistent use of either function declarations or expressions | |
"function-paren-newline": "off", // (,F) enforce consistent line breaks inside function parentheses | |
"id-blacklist": "off", // (,) disallow specified identifiers | |
"id-length": "off", // (,) enforce minimum and maximum identifier lengths | |
"id-match": "off", // (,) require identifiers to match a specified regular expression | |
"implicit-arrow-linebreak": "off", // (,F) enforce the location of arrow function bodies | |
"indent": "off", // (,F) enforce consistent indentation | |
"jsx-quotes": "off", // (,F) enforce the consistent use of either double or single quotes in JSX attributes | |
"key-spacing": "off", // (,F) enforce consistent spacing between keys and values in object literal properties | |
"keyword-spacing": "off", // (,F) enforce consistent spacing before and after keywords | |
"line-comment-position": "off", // (,) enforce position of line comments | |
"linebreak-style": "off", // (,F) enforce consistent linebreak style | |
"lines-around-comment": "off", // (,F) require empty lines around comments | |
"lines-between-class-members": "off", // (,F) require or disallow an empty line between class members | |
"max-depth": "off", // (,) enforce a maximum depth that blocks can be nested | |
"max-len": "off", // (,) enforce a maximum line length | |
"max-lines": "off", // (,) enforce a maximum number of lines per file | |
"max-lines-per-function": "off", // (,) enforce a maximum number of line of code in a function | |
"max-nested-callbacks": "off", // (,) enforce a maximum depth that callbacks can be nested | |
"max-params": "off", // (,) enforce a maximum number of parameters in function definitions | |
"max-statements": "off", // (,) enforce a maximum number of statements allowed in function blocks | |
"max-statements-per-line": "off", // (,) enforce a maximum number of statements allowed per line | |
"multiline-comment-style": "off", // (,F) enforce a particular style for multiline comments | |
"multiline-ternary": "off", // (,) enforce newlines between operands of ternary expressions | |
"new-cap": "off", // (,) require constructor names to begin with a capital letter | |
"new-parens": "off", // (,F) require parentheses when invoking a constructor with no arguments | |
"newline-per-chained-call": "off", // (,F) require a newline after each call in a method chain | |
"no-array-constructor": "off", // (,) disallow Array constructors | |
"no-bitwise": "off", // (,) disallow bitwise operators | |
"no-continue": "off", // (,) disallow continue statements | |
"no-inline-comments": "off", // (,) disallow inline comments after code | |
"no-lonely-if": "off", // (,F) disallow if statements as the only statement in else blocks | |
"no-mixed-operators": "off", // (,) disallow mixed binary operators | |
"no-mixed-spaces-and-tabs": "error", // (R,) disallow mixed spaces and tabs for indentation | |
"no-multi-assign": "off", // (,) disallow use of chained assignment expressions | |
"no-multiple-empty-lines": "off", // (,F) disallow multiple empty lines | |
"no-negated-condition": "off", // (,) disallow negated conditions | |
"no-nested-ternary": "off", // (,) disallow nested ternary expressions | |
"no-new-object": "off", // (,) disallow Object constructors | |
"no-plusplus": "off", // (,) disallow the unary operators ++ and -- | |
"no-restricted-syntax": "off", // (,) disallow specified syntax | |
"no-tabs": "off", // (,) disallow all tabs | |
"no-ternary": "off", // (,) disallow ternary operators | |
"no-trailing-spaces": "off", // (,F) disallow trailing whitespace at the end of lines | |
"no-underscore-dangle": "off", // (,) disallow dangling underscores in identifiers | |
"no-unneeded-ternary": "off", // (,F) disallow ternary operators when simpler alternatives exist | |
"no-whitespace-before-property": "off", // (,F) disallow whitespace before properties | |
"nonblock-statement-body-position": "off", // (,F) enforce the location of single-line statements | |
"object-curly-newline": "off", // (,F) enforce consistent line breaks inside braces | |
"object-curly-spacing": "off", // (,F) enforce consistent spacing inside braces | |
"object-property-newline": "off", // (,F) enforce placing object properties on separate lines | |
"one-var": "off", // (,F) enforce variables to be declared either together or separately in functions | |
"one-var-declaration-per-line": "off", // (,F) require or disallow newlines around variable declarations | |
"operator-assignment": "off", // (,F) require or disallow assignment operator shorthand where possible | |
"operator-linebreak": "off", // (,F) enforce consistent linebreak style for operators | |
"padded-blocks": "off", // (,F) require or disallow padding within blocks | |
"padding-line-between-statements": "off", // (,F) require or disallow padding lines between statements | |
"prefer-object-spread": "off", // (,F) disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead. | |
"quote-props": "off", // (,F) require quotes around object literal property names | |
"quotes": "off", // (,F) enforce the consistent use of either backticks, double, or single quotes | |
"semi": "off", // (,F) require or disallow semicolons instead of ASI | |
"semi-spacing": "off", // (,F) enforce consistent spacing before and after semicolons | |
"semi-style": "off", // (,F) enforce location of semicolons | |
"sort-keys": "off", // (,) require object keys to be sorted | |
"sort-vars": "off", // (,F) require variables within the same declaration block to be sorted | |
"space-before-blocks": "off", // (,F) enforce consistent spacing before blocks | |
"space-before-function-paren": "off", // (,F) enforce consistent spacing before function definition opening parenthesis | |
"space-in-parens": "off", // (,F) enforce consistent spacing inside parentheses | |
"space-infix-ops": "off", // (,F) require spacing around infix operators | |
"space-unary-ops": "off", // (,F) enforce consistent spacing before or after unary operators | |
"spaced-comment": "off", // (,F) enforce consistent spacing after the // or /* in a comment | |
"switch-colon-spacing": "off", // (,F) enforce spacing around colons of switch statements | |
"template-tag-spacing": "off", // (,F) require or disallow spacing between template tags and their literals | |
"unicode-bom": "off", // (,F) require or disallow Unicode byte order mark (BOM) | |
"wrap-regex": "off", // (,F) require parenthesis around regex literals | |
// ECMAScript 6 | |
// These rules relate to ES6, also known as ES2015: | |
"arrow-body-style": "off", // (,F) require braces around arrow function bodies | |
"arrow-parens": "off", // (,F) require parentheses around arrow function arguments | |
"arrow-spacing": "off", // (,F) enforce consistent spacing before and after the arrow in arrow functions | |
"constructor-super": "error", // (R,) require super() calls in constructors | |
"generator-star-spacing": "off", // (,F) enforce consistent spacing around * operators in generator functions | |
"no-class-assign": "error", // (R,) disallow reassigning class members | |
"no-confusing-arrow": "off", // (,F) disallow arrow functions where they could be confused with comparisons | |
"no-const-assign": "error", // (R,) disallow reassigning const variables | |
"no-dupe-class-members": "error", // (R,) disallow duplicate class members | |
"no-duplicate-imports": "off", // (,) disallow duplicate module imports | |
"no-new-symbol": "error", // (R,) disallow new operators with the Symbol object | |
"no-restricted-imports": "off", // (,) disallow specified modules when loaded by import | |
"no-this-before-super": "error", // (R,) disallow this/super before calling super() in constructors | |
"no-useless-computed-key": "off", // (,F) disallow unnecessary computed property keys in object literals | |
"no-useless-constructor": "off", // (,) disallow unnecessary constructors | |
"no-useless-rename": "off", // (,F) disallow renaming import, export, and destructured assignments to the same name | |
"no-var": "off", // (,F) require let or const instead of var | |
"object-shorthand": "off", // (,F) require or disallow method and property shorthand syntax for object literals | |
"prefer-arrow-callback": "off", // (,F) require using arrow functions for callbacks | |
"prefer-const": "off", // (,F) require const declarations for variables that are never reassigned after declared | |
"prefer-destructuring": "off", // (,F) require destructuring from arrays and/or objects | |
"prefer-numeric-literals": "off", // (,F) disallow parseInt() and Number.parseInt() in favor of binary, octal, and hexadecimal literals | |
"prefer-rest-params": "off", // (,) require rest parameters instead of arguments | |
"prefer-spread": "off", // (,) require spread operators instead of .apply() | |
"prefer-template": "off", // (,F) require template literals instead of string concatenation | |
"require-yield": "error", // (R,) require generator functions to contain yield | |
"rest-spread-spacing": "off", // (,F) enforce spacing between rest and spread operators and their expressions | |
"sort-imports": "off", // (,F) enforce sorted import declarations within modules | |
"symbol-description": "off", // (,) require symbol descriptions | |
"template-curly-spacing": "off", // (,F) require or disallow spacing around embedded expressions of template strings | |
"yield-star-spacing": "off", // (,F) require or disallow spacing around the * in yield* expressions | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment