facebook pixelCodiga Analysis TypeScript Rules
BACK TO LIST

TypeScript rules

The Codiga Static Analysis engine checks TypeScript 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.

      @angular-eslint/directive-selector

      Best practice
      High

      Detect if directive selector isn't a hyphenated, lowercase value or doesn't have a descriptive prefix to represent the feature area or the application itself.

      Learn more

      @angular-eslint/no-output-on-prefix

      Best practice
      High

      Prevent any Output values with prefix 'on' as this prefix should be used only for event handler methods to follow web conventions

      @next/next/link-passhref

      Best practice
      High

      Detect any <Link> without an <a> child, they should have passHref=true parameter

      @next/next/no-img-element

      Best practice
      High

      Detect any native <img> element, it should be replaced by the <Image /> component

      @no-var-requires

      Best practice
      High

      Detect the assignation of a require import to a var such as 'var module = require("module")'.

      @typescript-eslint/adjacent-overload-signatures

      Best practice
      High

      Require that member overloads be consecutive.

      @typescript-eslint/ban-types

      Best practice
      High

      Detect any types that are banned (such as String).

      @typescript-eslint/no-empty-function

      Best practice
      High

      Detect any empty methods, as in methods that do not have any logic

      @typescript-eslint/no-extra-non-null-assertion

      Best practice
      High

      Detect extra null assertions, there should be just a single null assertion in a expression

      @typescript-eslint/no-inferrable-types

      Best practice
      High

      Detect any explicit types that can easily be inferred by the compiler

      @typescript-eslint/no-misused-new

      Best practice
      High

      Detect any interfaces that are being initialized with "new", as only classes should be initialized with "new"

      @typescript-eslint/no-namespace

      Best practice
      High

      Disallow the use of custom TypeScript modules and namespaces

      @typescript-eslint/no-this-alias

      Best practice
      High

      Disallow aliasing this

      fp/no-mutating-assign

      Best practice
      High

      Forbid the use of Object.assign() with a variable as first argument

      fp/no-mutation

      Best practice
      High

      Forbid the use of mutating operators

      fp/no-rest-parameters

      Best practice
      High

      Forbid the use of rest parameters

      fp/no-throw

      Best practice
      High

      Forbid the use of throw

      import/dynamic-import-chunkname

      Best practice
      High

      Detect missing webpackChunkName in any dynamic imports

      import/export

      Best practice
      High

      Detect any error with your imports and exports, like more than one default export or redundant imports.

      import/first

      Best practice
      High

      Detect non-import statements before an import statement

      import/no-named-as-default

      Best practice
      High

      Reports use of an exported name as the locally imported name of a default export.

      import/no-named-default

      Best practice
      High

      Reports use of a default export as a locally named import.

      jest/no-disabled-tests

      Best practice
      High

      Disallow disabled tests

      jest/no-done-callback

      Best practice
      High

      Avoid using a callback in asynchronous tests and hooks (no-done-callback)

      jest/no-restricted-matchers

      Best practice
      High

      Disallow specific matchers & modifiers.

      jest/prefer-called-with

      Best practice
      High

      Suggest using toBeCalledWith() or toHaveBeenCalledWith()

      jest/require-top-level-describe

      Best practice
      High

      Require test cases and hooks to be inside a describe block

      jsx-a11y/aria-proptypes

      Best practice
      High

      ARIA state and property values must be valid.

      jsx-a11y/no-autofocus

      Best practice
      High

      Enforce that autoFocus prop is not used on elements. Autofocusing elements can cause usability issues for sighted and non-sighted users, alike.

      jsx-a11y/role-supports-aria-props

      Best practice
      High

      Enforce that elements with explicit or implicit roles defined contain only aria-* properties supported by that role.

      no-case-declarations

      Best practice
      High

      Disallows lexical declarations (let, const, function and class) in case/default clauses.

      no-empty-pattern

      Best practice
      High

      Disallow empty destructuring patterns

      no-self-assign

      Best practice
      High

      Detects self assignments as they have no effect, so probably those are an error due to incomplete refactoring.

      no-useless-catch

      Best practice
      High

      Reports catch clauses that only throw the caught error.

      no-useless-escape

      Best practice
      High

      Disallow unnecessary escape usage

      react-hooks/exhaustive-deps

      Best practice
      High

      Incorrect use of hooks

      react-native/no-raw-text

      Best practice
      High

      Detect raw text outside of Text component

      react/display-name

      Best practice
      High

      Component definition is missing display name

      react/forbid-component-props

      Best practice
      High

      By default this rule prevents passing of props that add lots of complexity (className, style) to Components.

      react/jsx-boolean-value

      Best practice
      High

      Enforce boolean attributes notation in JSX

      react/jsx-no-literals

      Best practice
      High

      Disallow the usage of string literals inside JSX components

      react/jsx-props-no-spreading

      Best practice
      High

      Disallow JSX props spreading

      react/no-children-prop

      Best practice
      High

      Prevent passing of children as props

      react/no-multi-comp

      Best practice
      High

      Prevent multiple component definition per file. Declaring only one component per file improves readability and reusability of components.

      react/prop-types

      Best practice
      High

      Prevent missing props validation in a React component definition

      unicorn/no-null

      Best practice
      High

      Disallow the use of the null literal.

      vue/no-deprecated-data-object-declaration

      Best practice
      High

      Disallow using deprecated object declaration on data

      jsx-a11y/alt-text

      Best practice
      High

      Image elements must have an alt prop, either with meaningful text, or an empty string for decorative images.