Skip to content
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

Suggestion : Add a compiler flag to treat errors as warnings #14501

Closed
ifle opened this issue Mar 7, 2017 · 16 comments
Closed

Suggestion : Add a compiler flag to treat errors as warnings #14501

ifle opened this issue Mar 7, 2017 · 16 comments

Comments

@ifle
Copy link

ifle commented Mar 7, 2017

Add a compiler flag to treat errors as warnings.
That will be very helpful in case of migration from legacy javascript project to typescript

@RyanCavanaugh
Copy link
Member

Other than printing

a.ts(12,12): warning TS2345

instead of

a.ts(12,12): error TS2345

what would you expect this flag to do, behaviorally?

@ifle
Copy link
Author

ifle commented Mar 8, 2017

That will allows to compile asp.net web project in VS without compile errors.
For now the build is fail. We have the legacy asp.net project . We started migration from js to ts. In the first stage we renamed all js files to ts. There are a lot typescript errors, but generated js is still valid.

@RyanCavanaugh RyanCavanaugh added the Needs Investigation This issue needs a team member to investigate its status. label May 24, 2017
@mribichich
Copy link

Same for me, I have a couple of errors that I know there ok, but since typescript treats them as errors the build fails.

@mhegazy
Copy link
Contributor

mhegazy commented May 30, 2017

what are the errors if i may ask?

@onzag
Copy link

onzag commented Sep 18, 2017

How is this going, I have thousand of errors because I am running a migration, but the build fails because of the errors, giving a lot of log messages in webpack, I simply can't fix them all.

@mhegazy
Copy link
Contributor

mhegazy commented Sep 18, 2017

How is this going, I have thousand of errors because I am running a migration, but the build fails because of the errors, giving a lot of log messages in webpack, I simply can't fix them all.

what is your build driver? MSBuild?

@aminpaks
Copy link
Contributor

I think the new compiler @ts-ignore flag will cover this no?

@ifle
Copy link
Author

ifle commented Oct 21, 2017

That is right direction :). In my case the best solution is adding the flag to the tsconfig with optional list of ignored errors

@aminpaks
Copy link
Contributor

@ifle apparently the topic is more complicated that I thought. Read what @alexeagle has to say about this

@alexeagle
Copy link
Contributor

I agree, for violations of the type system or language spec, // @ts-ignore gives you an extra freedom to disable errors during a migration.

@KodaPOwER
Copy link

Any news on this?
How can i just compile even on error? We are migrating from js to ts.
I have a lot of file just renamed to .ts waiting to be converted.
If i compile on save, i have the error in the error list but the js file is emitted.
Instead msbuild stop on the error and that broke my CI in teamcity.
Why i can't replicate this behavior in msbuild? I can't flag 2000+ lines with // @ts-ignore

@bodinsamuel
Copy link

Hello, It's a been long time and the issue is not closed.
Is it something you are planning? thanks :)

@RyanCavanaugh RyanCavanaugh removed the Needs Investigation This issue needs a team member to investigate its status. label Jul 17, 2019
@RyanCavanaugh
Copy link
Member

I think the only thing left to address here is the msbuild scenario, which is effectively tracked at #13280

@QingLeiLi
Copy link

QingLeiLi commented Oct 20, 2019

Maybe we should add a ts config option to prevent the error to throw.

@nbkhope
Copy link

nbkhope commented Apr 29, 2022

Was this feature ever implemented? I too would love to have errors be just warnings as it helps migrating a codebase from JS to TS.

@TomasHubelbauer
Copy link

Would be cool to be able to treat unused imports as errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests