question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

tsconfig - Ignore errors by ids

See original GitHub issue

I know that all errors in TypeScript are optional, it’d be nice if we could declare which error ids we want to ignore.

I.E. In the tsconfig.json:

{
   "compilerOptions":{
      "ignoreErrors":[2403,2686,...]
   }
}

The reason I say this is because a lot of these errors are just irratating… Like the error:

'L' refers to a UMD global, but the current file is a module. Consider adding an import instead.

This isn’t an actual type error. It’s a code style suggestion, and is entirely subjective unlike invalid type errors. I find many little ‘errors’ like this and they are deeply frustrating, as they just fill the error log with rubbish… Allow us to define which error ids we want to ignore, and this won’t happen.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:100
  • Comments:16 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
pablobirukovcommented, Feb 19, 2019

It would be nice to have this functionality similar to -nowarn in C#. However, I find it useful to specify a paths where certain errors are ignored.

@sancarn, you may consider using https://github.com/evolution-gaming/tsc-silent.

Once installed it supposed to replace tsc

tsc-silent -p tsconfig.json --suppress 7017@src/js/ 2322,2339,2344@/src/legacy/
Read more comments on GitHub >

github_iconTop Results From Across the Web

Possibility of Suppressing any error (e.g. incl. TS7017) within ...
As of TypeScript 2.6 (released on Oct 31, 2017), there is a way to ignore all errors from a specific line using //...
Read more >
How to (temporarily!) ignore errors during a TypeScript migration
Tsc-silent lets you ignore certain TypeScript errors. By ignoring the errors that came from code not yet migrated, I could add TypeScript to...
Read more >
Stats - webpack
Tells stats whether to group modules by their attributes (errors, warnings, assets, optional, orphan, or dependent). module.exports = { //... stats: { ...
Read more >
TypeScript configuration - Angular
At the root tsconfig.json file specifies the base TypeScript and Angular compiler ... it still generates the JavaScript files, but it also reports...
Read more >
Pages - Stickler CI
Stickler CI can automatically fix style errors in several languages. ... Options. ignore A comma separated list of rule ids to ignore.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found