JavaScript

JavaScript

Made by DeepSource

Found // @ts-<directive> comments JS-0295

Anti-pattern
Major

TypeScript provides several directive comments that can be used to alter how it processes files. Using these to suppress TypeScript Compiler Errors reduces the effectiveness of TypeScript overall.

However, if you must keep them, you can add an explanation next to your directives.

The directive comments supported by TypeScript are:

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

Bad Practice

// @ts-ignore
user.login()

Recommended

// @ts-ignore - this is ok because <reason>
user.login()