How do I get Angular to ignore typescript 'errors'

See original GitHub issue

I’m adding functionality to a large and complex Angular 11 application. I have ng build watch running and typically making large changes, testing them, and then iterating.

The biggest waste of my time at the moment is waiting for Angular to build a set of changes, go to test it, finding it’s not working, then finding it’s not working because the browser bundles haven’t been updated and the code is stale because Typescript is pissed because there is an unused variable somewhere in the codebase.

Given the scale of the changes I’m making, time spent polishing the code to conform to every single Typescript rule ever invented, after every single change I make, when my current changes are still highly speculative and liable to change repeatedly just totally kills any productivity. Hunting down and ‘fixing’ the half dozen Typescript ‘errors’ that might occur just because I’ve commented out a line of code can be 10 minutes of my time that could be far better spend continuing with my work.

I would like either the IDE (VsCode) or the compiler to continue to make me aware of any Typescript issues so that I can use intelligence (that the tooling does not possess) to determine which errors to fix and when, but I do not want my builds continually failing for spurious stylistic issues.

Someone please tell me this is possible and how to achieve it.

P.S. There is absolutely no point whatsoever suggesting to people to seek answers to questions on StackOverflow. That site has been a total waste of time for years now. https://stackoverflow.com/questions/66012370/how-do-i-get-angular-to-ignore-typescript-errors

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
thekipcommented, Mar 4, 2021

The fastest way to wean developers to use strict mode in typescript. The development starting from Angular 11 become incredibly annoying. Prior to Angular 11 reported by typescript, errors did not fail the build. Now it fails a build even if it’s completely valid JS code (for example unused import or private var)

Developers are lazy people. If the tools don’t help and get annoying they just switch them off. There is a case, you even suggesting to switch off “strict mode”. What’s a shame.

By the way, both webpack and typescript have a way to solve this. Typescript has “noEmitOnError” flag, and ts-loader has “transpileOnly” flag. Only Angular with its own build system is different.

There isn’t anything actionable from our end here, hence I am closing the issue. Feel free to reply.

Nothing actionable from Angular Team? What about starting respecting “noEmitOnError” flag from tsconfig, or providing an additional option in angular.json for that purpose?

PS

Developers love typescript because of its flexibility and dynamic nature. It’s very fun to prototype, play with code and then solve all errors before commit/going to further task. That favourably distinguishes it from other strict typed languages.

With this “improvement” we completely lose the benefit to be dynamic and agile. Nice job. Thanks.

0reactions
angular-automatic-lock-bot[bot]commented, Apr 4, 2021

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can I ignore typescript error while compiling with Angular 2 ...
In your case the quickest solution is to disable the noImplicitAny setting in tsconfig.json . This fixes 2 and 3. For the other...
Read more >
Ask Typescript to ignore an error - Winsmarts.com
Sometimes, you want Typescript to ignore an error. A good example is referencing a file that gets built at runtime. For instance, in...
Read more >
Ignore Typescript error* - Aishwarya Shrestha - Medium
// @ts-ignore comment enables the Typescript compiler to ignore the line below it, in this way you can ignore errors on specific lines...
Read more >
Force TypeScript Compiler to Ignore Errors - DevX
Use the “@ts-ignore” comment before the code and the compiler will ignore errors. // @ts-ignoreimport mathUnit from 'mathjs/lib/type/unit'.
Read more >
TypeScript configuration - Angular
The Angular CLI generates a tsconfig.app.json file which is used to build an application, in which the types compiler option is set to...
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