How do I get Angular to ignore typescript 'errors'
See original GitHub issueI’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:
- Created 3 years ago
- Comments:11 (1 by maintainers)
Top Related StackOverflow Question
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.
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.
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.