facebook pixelCodiga Analysis TypeScript Rules, severity error , category best practice
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
Error

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
Error

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
Error

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

@next/next/no-img-element

Best practice
Error

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

@no-var-requires

Best practice
Error

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

@typescript-eslint/adjacent-overload-signatures

Best practice
Error

Require that member overloads be consecutive.

@typescript-eslint/ban-types

Best practice
Error

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

@typescript-eslint/no-empty-function

Best practice
Error

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

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

Best practice
Error

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

@typescript-eslint/no-inferrable-types

Best practice
Error

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

@typescript-eslint/no-misused-new

Best practice
Error

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

@typescript-eslint/no-namespace

Best practice
Error

Disallow the use of custom TypeScript modules and namespaces

@typescript-eslint/no-this-alias

Best practice
Error

Disallow aliasing this

fp/no-mutating-assign

Best practice
Error

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

fp/no-mutation

Best practice
Error

Forbid the use of mutating operators

fp/no-rest-parameters

Best practice
Error

Forbid the use of rest parameters

fp/no-throw

Best practice
Error

Forbid the use of throw

import/dynamic-import-chunkname

Best practice
Error

Detect missing webpackChunkName in any dynamic imports

import/export

Best practice
Error

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

import/first

Best practice
Error

Detect non-import statements before an import statement

import/no-named-as-default

Best practice
Error

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

import/no-named-default

Best practice
Error

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

jest/no-disabled-tests

Best practice
Error

Disallow disabled tests

jest/no-done-callback

Best practice
Error

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

jest/no-restricted-matchers

Best practice
Error

Disallow specific matchers & modifiers.

jest/prefer-called-with

Best practice
Error

Suggest using toBeCalledWith() or toHaveBeenCalledWith()

jest/require-top-level-describe

Best practice
Error

Require test cases and hooks to be inside a describe block

jsx-a11y/aria-proptypes

Best practice
Error

ARIA state and property values must be valid.

jsx-a11y/no-autofocus

Best practice
Error

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
Error

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

no-case-declarations

Best practice
Error

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

no-empty-pattern

Best practice
Error

Disallow empty destructuring patterns

no-self-assign

Best practice
Error

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

no-useless-catch

Best practice
Error

Reports catch clauses that only throw the caught error.

no-useless-escape

Best practice
Error

Disallow unnecessary escape usage

react-hooks/exhaustive-deps

Best practice
Error

Incorrect use of hooks

react-native/no-raw-text

Best practice
Error

Detect raw text outside of Text component

react/display-name

Best practice
Error

Component definition is missing display name

react/forbid-component-props

Best practice
Error

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

react/jsx-boolean-value

Best practice
Error

Enforce boolean attributes notation in JSX

react/jsx-no-literals

Best practice
Error

Disallow the usage of string literals inside JSX components

react/jsx-props-no-spreading

Best practice
Error

Disallow JSX props spreading

react/no-children-prop

Best practice
Error

Prevent passing of children as props

react/no-multi-comp

Best practice
Error

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

react/prop-types

Best practice
Error

Prevent missing props validation in a React component definition

unicorn/no-null

Best practice
Error

Disallow the use of the null literal.

vue/no-deprecated-data-object-declaration

Best practice
Error

Disallow using deprecated object declaration on data

jsx-a11y/alt-text

Best practice
Error

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

@next/next/inline-script-id

Best practice
Error

`next/script` components with inline content must specify an `id` attribute.

vue/require-default-prop

Best practice
Error

This rule requires default value to be set for each props that are not marked as required.

vue/require-prop-types

Best practice
Error

This rule enforces that a props statement contains type definition.