Our code style is based on Crockford's, with a few modifications.
- Indent with tabs, not spaces
- Always end statements with semicolons
- Conditionals and loops ("if", "while", "for") always use curly braces
- Never use var. Useconstwherever possible andletonly if necessary.
- Always use "strict equal" (===and!==, not==or!=)
- Define variables in scope, never global.
| Rule | Value | Description | 
|---|---|---|
| array-bracket-spacing | enforce consistent spacing inside array brackets | |
| brace-style | enforce consistent brace style for blocks | |
| camelcase | enforce camelcase naming convention | |
| comma-dangle | require or disallow trailing commas | |
| comma-spacing | enforce consistent spacing before and after commas | |
| comma-style | enforce consistent comma style | |
| indent | tab | enforce consistent indentation | 
| key-spacing | enforce consistent spacing between keys and values in object literal properties | |
| keyword-spacing | enforce consistent spacing before and after keywords | |
| linebreak-style | unix | enforce consistent linebreak style | 
| max-params | 5 | enforce a maximum number of parameters in function definitions | 
| new-cap | require constructor names to begin with a capital letter | |
| no-array-constructor | disallow Arrayconstructors | |
| no-bitwise | disallow bitwise operators | |
| no-continue | disallow continuestatements | |
| no-mixed-spaces-and-tabs | disallow mixed spaces and tabs for indentation | |
| no-trailing-spaces | disallow trailing whitespace at the end of lines | |
| no-underscore-dangle | disallow dangling underscores in identifiers | |
| one-var | never | enforce variables to be declared either together or separately in functions | 
| one-var-declaration-per-line | require or disallow newlines around variable declarations | |
| quote-props | as-needed | require quotes around object literal property names | 
| quotes | single | enforce the consistent use of either backticks, double, or single quotes | 
| semi | require or disallow semicolons instead of ASI | |
| semi-spacing | enforce consistent spacing before and after semicolons | |
| space-before-blocks | enforce consistent spacing before blocks | |
| space-before-function-paren | enforce consistent spacing before functiondefinition 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 | 
| Rule | Value | Description | 
|---|---|---|
| babel/no-invalid-this | disallow thiskeywords outside of classes or class-like objects | |
| block-scoped-var | enforce the use of variables within the scope they are defined | |
| consistent-return | require returnstatements to either always or never specify values | |
| curly | enforce consistent brace style for all control statements | |
| dot-notation | enforce dot notation whenever possible | |
| eqeqeq | require the use of ===and!== | |
| guard-for-in | require for-inloops to include anifstatement | |
| no-caller | disallow the use of arguments.callerorarguments.callee | |
| no-case-declarations | disallow lexical declarations in case clauses | |
| no-empty-pattern | disallow empty destructuring patterns | |
| no-eval | disallow the use of eval() | |
| no-extend-native | disallow extending native types | |
| no-fallthrough | disallow fallthrough of casestatements | |
| no-global-assign | disallow assignments to native objects or read-only global variables | |
| no-implicit-globals | disallow declarations in the global scope | |
| no-implied-eval | disallow the use of eval()-like methods | |
| no-iterator | disallow the use of the __iterator__property | |
| no-loop-func | disallow function declarations that contain unsafe references inside loop statements | |
| no-multi-str | disallow multiline strings | |
| no-new | disallow newoperators outside of assignments or comparisons | |
| no-new-func | disallow newoperators with theFunctionobject | |
| no-octal | disallow octal literals | |
| no-redeclare | disallow variable redeclaration | |
| no-self-assign | disallow assignments where both sides are exactly the same | |
| no-sequences | disallow comma operators | |
| no-unused-labels | disallow unused labels | |
| no-useless-catch | disallow unnecessary catchclauses | |
| no-useless-escape | disallow unnecessary escape characters | |
| no-with | disallow withstatements | |
| radix | enforce the consistent use of the radix argument when using parseInt() | |
| require-await | disallow async functions which have no awaitexpression | |
| vars-on-top | require vardeclarations be placed at the top of their containing scope | |
| wrap-iife | any | require parentheses around immediate functioninvocations | 
| Rule | Value | Description | 
|---|---|---|
| constructor-super | require super()calls in constructors | |
| no-class-assign | disallow reassigning class members | |
| no-const-assign | disallow reassigning constvariables | |
| no-dupe-class-members | disallow duplicate class members | |
| no-new-symbol | disallow newoperators with theSymbolobject | |
| no-this-before-super | disallow this/superbefore callingsuper()in constructors | |
| no-useless-computed-key | disallow unnecessary computed property keys in objects and classes | |
| no-var | require letorconstinstead ofvar | |
| prefer-const | require constdeclarations for variables that are never reassigned after declared | |
| require-yield | require generator functions to contain yield | 
| Rule | Value | Description | 
|---|---|---|
| for-direction | enforce "for" loop update clause moving the counter in the right direction. | |
| getter-return | enforce returnstatements in getters | |
| no-async-promise-executor | disallow using an async function as a Promise executor | |
| no-compare-neg-zero | disallow comparing against -0 | |
| no-cond-assign | disallow assignment operators in conditional expressions | |
| no-constant-condition | disallow constant expressions in conditions | |
| no-control-regex | disallow control characters in regular expressions | |
| no-debugger | disallow the use of debugger | |
| no-dupe-args | disallow duplicate arguments in functiondefinitions | |
| no-dupe-else-if | disallow duplicate conditions in if-else-if chains | |
| no-dupe-keys | disallow duplicate keys in object literals | |
| no-duplicate-case | disallow duplicate case labels | |
| no-empty | disallow empty block statements | |
| no-empty-character-class | disallow empty character classes in regular expressions | |
| no-ex-assign | disallow reassigning exceptions in catchclauses | |
| no-extra-boolean-cast | disallow unnecessary boolean casts | |
| no-extra-parens | disallow unnecessary parentheses | |
| no-extra-semi | disallow unnecessary semicolons | |
| no-func-assign | disallow reassigning functiondeclarations | |
| no-import-assign | disallow assigning to imported bindings | |
| no-inner-declarations | disallow variable or functiondeclarations in nested blocks | |
| no-invalid-regexp | disallow invalid regular expression strings in RegExpconstructors | |
| no-irregular-whitespace | disallow irregular whitespace | |
| no-misleading-character-class | disallow characters which are made with multiple code points in character class syntax | |
| no-obj-calls | disallow calling global object properties as functions | |
| no-prototype-builtins | disallow calling some Object.prototypemethods directly on objects | |
| no-regex-spaces | disallow multiple spaces in regular expressions | |
| no-setter-return | disallow returning values from setters | |
| no-sparse-arrays | disallow sparse arrays | |
| no-unexpected-multiline | disallow confusing multiline expressions | |
| no-unreachable | disallow unreachable code after return,throw,continue, andbreakstatements | |
| no-unsafe-finally | disallow control flow statements in finallyblocks | |
| no-unsafe-negation | disallow negating the left operand of relational operators | |
| require-atomic-updates | disallow assignments that can lead to race conditions due to usage of awaitoryield | |
| use-isnan | require calls to isNaN()when checking forNaN | |
| valid-typeof | enforce comparing typeofexpressions against valid strings | 
| Rule | Value | Description | 
|---|---|---|
| no-delete-var | disallow deleting variables | |
| no-restricted-globals | event | disallow specified global variables | 
| no-shadow-restricted-names | disallow identifiers from shadowing restricted names | |
| no-undef | disallow the use of undeclared variables unless mentioned in /*global */comments | |
| no-unused-vars | disallow unused variables | |
| no-use-before-define | disallow the use of variables before they are defined | 
| Rule | Value | Description | 
|---|---|---|
| strict | require or disallow strict mode directives |