Skip to content
This repository was archived by the owner on Jan 8, 2026. It is now read-only.

Latest commit

 

History

History
367 lines (293 loc) · 13.7 KB

File metadata and controls

367 lines (293 loc) · 13.7 KB

Javascript Linter Rules

Below is a list of rules we use for our eslint.
this is adapted from documentation here
note: we use "extends": "eslint:recommended" property in our configuration file (read more)

no-compare-neg-zero

no-cond-assign

  • disallow assignment operators in conditional expressions read more

no-console

no-constant-condition

  • disallow constant expressions in conditions read more

no-control-regex

  • disallow control characters in regular expressions read more

no-debugger

no-dupe-args

  • disallow duplicate arguments in function definitions read more

no-dupe-keys

  • disallow duplicate keys in object literals read more

no-duplicate-case

no-empty

no-empty-character-class

  • disallow empty character classes in regular expressions read more

no-ex-assign

  • disallow reassigning exceptions in catch clauses read more

no-extra-boolean-cast

  • disallow unnecessary boolean casts read more

no-extra-semi

no-func-assign

  • disallow reassigning function declarations read more

no-inner-declarations

  • disallow variable or function declarations in nested blocks read more

no-invalid-regexp

  • disallow invalid regular expression strings in RegExp constructors read more

no-irregular-whitespace

  • disallow irregular whitespace outside of strings and comments read more

no-obj-calls

  • disallow calling global object properties as functions read more

no-regex-spaces

  • disallow multiple spaces in regular expressions read more

no-sparse-arrays

no-unexpected-multiline

  • disallow confusing multiline expressions read more

no-unreachable

  • disallow unreachable code after return, throw, continue, and break statements read more

no-unsafe-finally

  • disallow control flow statements infinallyblocks read more

no-unsafe-negation

  • disallow negating the left operand of relational operators read more

use-isnan

  • require calls toisNaN() when checking for NaN read more

valid-typeof

  • enforce comparing typeof expressions against valid strings read more

no-case-declarations

  • disallow lexical declarations in case clauses read more

no-empty-pattern

  • disallow empty destructuring patterns read more

no-fallthrough

  • disallow fallthrough of case statements read more

no-global-assign

  • disallow assignments to native objects or read-only global variables read more

no-octal

no-redeclare

no-self-assign

  • disallow assignments where both sides are exactly the same read more

no-unused-labels

no-useless-escape

  • disallow unnecessary escape characters read more

no-delete-var

no-undef

  • disallow the use of undeclared variables unless mentioned in /*global*/ comments read more

no-unused-vars

no-mixed-spaces-and-tabs

  • disallow mixed spaces and tabs for indentation read more

constructor-super

  • require super() calls in constructors read more

no-class-assign

  • disallow reassigning class members read more

no-const-assign

  • disallow reassigning const variables read more

no-dupe-class-members

no-new-symbol

  • disallow new operators with the Symbol object read more

no-this-before-super

  • disallow this/super before calling super() in constructors read more

require-yield

  • require generator functions to contain yield read more

no-var

  • require let or const instead of var read more

semi

jsx-quotes

  • enforce the consistent use of double quotes in JSX attributes read more

max-len

max-statements

  • enforce a maximum number of statements allowed in function blocks read more

react/display-name

  • prevent missing displayName in a React component definition read more

react/forbid-prop-types

  • checks all JSX components and verifies that no forbidden propsTypes are used. read more

react/jsx-curly-spacing

  • aims to maintain consistency around the spacing inside of JSX attributes and expressions inside element children. read more

react/jsx-key

  • warn if an element that likely requires a key prop--namely, one present in an array literal or an arrow function expression. read more

react/jsx-no-duplicate-props

  • prevent duplicate properties in JSX read more

react/jsx-no-undef

  • disallows undeclared variables in JSX read more

react/jsx-pascal-case

  • enforces coding style that user-defined JSX components are defined and referenced in PascalCase. read more

react/jsx-uses-react

  • prevent React being incorrectly marked as unused read more

react/jsx-uses-vars

  • prevent variables used in JSX to be incorrectly marked as unused read more

react/no-danger

  • prevent usage of dangerous JSX properties read more

react/no-did-mount-set-state

  • prevent usage of setState in componentDidMount read more

react/no-did-update-set-state

  • prevent usage of setState in componentDidUpdate read more

react/no-direct-mutation-state

  • prevent direct mutation of this.state read more

react/no-multi-comp

  • prevent multiple component definition per file read more

react/no-unknown-property

  • prevent usage of unknown DOM property read more

react/prefer-es6-class

  • enforce ES6 class for React Components read more

react/prop-types

  • prevent missing props validation in a React component definition read more

react/react-in-jsx-scope

  • Prevent missing React when using JSX read more

react/self-closing-comp

  • prevent extra closing tags for components without children read more

react/sort-comp