Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suppressing certain errors e.g. TS7017 in tsconfig.json

Is it possible, if yes, how? I want to achieve something like (e.g., in the compilerOptions in tsconfig.json):

// ATTENTION PSEUDO CODE
suppressErrors: ['TS7017', ....]

p.s. TS7017: Index signature of object type implicitly has an 'any' type.

EDIT: FYI, I would like to suppress any desired error; TS7017 is only an example.

like image 381
Lonely Avatar asked Sep 21 '16 13:09

Lonely


People also ask

How do I ignore TS error?

You can ignore type checking errors for a single line by using the // @ts-ignore comment. Copied! The // @ts-ignore comment ignores any type checking errors that occur on the next line. If you use a linter, you might get an error when you use a comment to disable type checking for a line, or for the entire file.

What is strict Tsconfig json?

TypeScript's strict mode parameter can be configurated as several individual parameters for each specific case of type checking. So, basically, if you set the parameter strict to true in tsconfig. json it means that all these strict options are set to true.

What is the purpose of the Tsconfig json file?

The tsconfig. json file specifies the root files and the compiler options required to compile the project. JavaScript projects can use a jsconfig. json file instead, which acts almost the same but has some JavaScript-related compiler flags enabled by default.

What is include and exclude in Tsconfig?

The include and exclude properties take a list of glob-like file patterns. The supported glob wildcards are: * matches zero or more characters (excluding directory separators) ? matches any one character (excluding directory separators)


1 Answers

Suppressing certain errors

There is no option for that at the moment. I've created an issue to track it : https://github.com/Microsoft/TypeScript/issues/11051

like image 52
basarat Avatar answered Sep 29 '22 07:09

basarat