---
title: Avoid @ts- comments
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Datadog Security > Code Security > Static Code Analysis (SAST) > SAST
  Rules > Avoid @ts-<directive> comments
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Avoid @ts-<directive> comments

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com, us2.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site.md). ({% placeholder "user-datadog-site-name" /%}).
{% /alert %}

{% /callout %}

## Metadata{% #metadata %}

**ID:** `typescript-code-style/ban-ts-comment`

**Language:** TypeScript

**Severity:** Notice

**Category:** Best Practices

## Description{% #description %}

Correct your types instead of disabling TypeScript.

## Non-Compliant Code Examples{% #non-compliant-code-examples %}

```typescript
// @ts-expect-error
// @ts-ignore
// @ts-nocheck
// @ts-check
```

## Compliant Code Examples{% #compliant-code-examples %}

```typescript
// just a comment containing @ts-expect-error somewhere
// just a comment containing @ts-ignore somewhere
// just a comment containing @ts-nocheck somewhere
// just a comment containing @ts-check somewhere
```
  Seamless integrations. Try Datadog Code SecurityDatadog Code Security 
{% icon name="icon-external-link" /%}
 