facebook pixelJavaScript Static Analysis Rules
BACK TO LIST

JavaScript rules

The Codiga Static Analysis engine checks JavaScript code and supports many popular libraries. If you are using React, NextJS, Vue or Angular: the engine will flag any issue in your codebase. Automate your code reviews with Codiga and merge with confidence.

      for-direction

      Error prone
      High

      Enforce "for" loop update clause moving the counter in the right direction.

      Learn more

      getter-return

      Error prone
      High

      Enforces that a return statement is present in property getters

      no-compare-neg-zero

      Error prone
      High

      Detect the use of operator (e.g <=, <, ===, etc) to compare against -0.

      no-control-regex

      Error prone
      High

      Control characters are special, invisible characters in the ASCII range 0-31. These characters are rarely used in JavaScript strings so a regular expression containing these characters is most likely a mistake.

      no-dupe-else-if

      Error prone
      High

      Disallow duplicate conditions in if-else-if chains

      no-dupe-keys

      Error prone
      High

      Disallow duplicate keys in object literals

      no-duplicate-case

      Error prone
      High

      If a switch statement has duplicate test expressions in case clauses, it is likely that a programmer copied a case clause but forgot to change the test expression.

      no-func-assign

      Error prone
      High

      Disallow reassigning function declarations

      no-inner-declarations

      Error prone
      High

      Disallow variable or function declarations in nested blocks

      no-irregular-whitespace

      Error prone
      High

      Irregular whitespace not allowed.

      no-misleading-character-class

      Error prone
      High

      Disallow characters which are made with multiple code points in character class syntax

      no-prototype-builtins

      Error prone
      High

      Disallow use of Object.prototypes builtins directly

      no-regex-spaces

      Error prone
      High

      Disallow multiple spaces in regular expression literals

      no-setter-return

      Error prone
      High

      Setter cannot return a value.

      no-unexpected-multiline

      Error prone
      High

      Disallow confusing multiline expressions

      no-unreachable

      Error prone
      High

      Disallow unreachable code after return, throw, continue, and break statements

      no-unsafe-finally

      Error prone
      High

      Disallow control flow statements in finally blocks

      no-unsafe-negation

      Error prone
      High

      Disallow negating the left operand of relational operators

      node/no-missing-require

      Error prone
      High

      Disallow require() expressions which import non-existence modules

      react/jsx-key

      Error prone
      High

      React: Warn if an element that likely requires a key prop--namely, one present in an array literal or an arrow function expression.

      react/jsx-no-duplicate-props

      Error prone
      High

      React: No duplicate props allowed

      react/jsx-no-undef

      Error prone
      High

      React: Detects potential ReferenceErrors resulting from misspellings or missing components.

      react/no-direct-mutation-state

      Error prone
      High

      React: NEVER mutate this.state directly, as calling setState() afterwards may replace the mutation you made. Treat this.state as if it were immutable.

      react/no-unescaped-entities

      Error prone
      High

      React: Prevent invalid characters from appearing in markup

      react/no-unknown-property

      Error prone
      High

      React: Prevent usage of unknown DOM property

      valid-typeof

      Error prone
      High

      Enforce comparing typeof expressions against valid strings