-
Notifications
You must be signed in to change notification settings - Fork 12k
Provide an option to ignore TypeScript compiler errors #11652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You'll also have red in your editor. I think ignoring the errors is the wrong approach. What we do at Google for this is to use or build automated fixers for the various I think we should write up a blog post about how we do this for our giant monorepo. It's not Angular-specific of course, the whole TS ecosystem needs a way to enable options (starting with |
@alexeagle , I wonder if you could share the code for your automated fixers? |
This isn't a feature we're looking at adding at the moment, for the reasons outlined in the comment above. I recently saw a similar post to what Alex was proposing to make, but for ionic updated: https://blog.ionicframework.com/guest-post-ionic-4-0-migration-using-tslint-fixers/. There is also a repository for rxjs fixers that follows the same idea: https://github.com/ReactiveX/rxjs-tslint. |
@alexeagle, I appreciate what you're saying, but I think that being able to see the errors, be aware of them and address them incrementally is a better approach than to have to use loose compiler settings that mask those errors, or to have a bot attach :any to everything. I just started working on a typescript project that, to date, has not been using
It already does; it is |
In a very big project (with about 300 developers) you have to be able to ignore errors of modules, that will be lazy loaded somehow someday. Maybe this part of work has nothing to do with your work. It is terrible that you cannot start your project until they remove their conflicts (e.g. because of API-changes, somewhere, somehow). Did you ever think about this use-case? Angular is a great project, but to my mind: I find it a pity that Silva constantly closes important open issues. (Excuse me, Silva). That is an essential functionality to suppress certain errors. We have already discussed that so many times also in the typescript-project. (microsoft/TypeScript#9448 (comment)) Thank you! EDIT My workaround currently looks like this: I make myself unpopular by setting @ts-ignore flags in the source code of colleagues sitting at a far corner somewhere in the company. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report or Feature Request
Command
Versions
Windows 10.
Desired functionality
angular-cli
commands likebuild
andserve
should be able to work in presence of TypeScript errors.Most of TypeScript errors are actually warnings in the sense that they do not prevent JavaScript code to be emitted. As far as I understand, nothing prevents
angular-cli
to work normally as long as it receives JavaScript code and metadata (like descriptors metadata) from the TypeScript compiler, even if the compilation produces some errors.Currently, it seems that
angular-cli
bails out on any TypeScript error.Let me explain our case. We have a fairly large Angular project. To improve type checking, we would like to switch to
strict: true
intsconfig.json
and gradually combat the problems in the existing code TypeScript will report. At the same time, our team will immediately start to benefit fromstrict: true
when writing new code due to the fact that more potential issues will be highlighted by our IDEs. Unfortunately, we cannot use this approach becauseng serve
orng build
will no longer work, i.e. our development process will be broken until we fix all the problems (which is not going to happen in the foreseeable future).By the way, TypeScript compiler itself since quite a while ago supports the
noEmitOnError
option (https://www.typescriptlang.org/docs/handbook/compiler-options.html). In my opinion, in the perfect worldangular-cli
would rely on that. However, I understand that it hardly going to happen due to backward compatibility considerations.The text was updated successfully, but these errors were encountered: