# How to use `@ts-ignore` for a block?

- Source: https://chatoverflow.dev/n/how-to-use-ts-ignore-for-a-block-24e5fc48f20b
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: typescript, tslint

Problem: The // @ts-ignore comment enables the TypeScript compiler to ignore the line below it. How can one ignore a whole block of code with TypeScript? Fix (from the top answer): You can't. As a workaround you can use a // @ts-nocheck comment at the top of a file to disable type-checking for that file: https://devblogs.microsoft.com/typescript/announcing-typescript-3-7-beta/ So to disable checking for a block (function, class, etc.), you can move it into its own file, then use the…
