-
Notifications
You must be signed in to change notification settings - Fork 106
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
Unused imports typescript error #412
Comments
Are you sure this is an error and not just a linter warning? With that said, the imports could be commented out to match the uses. |
In my case it is an error because I want to use noUnusedLocals for my ts files. And there is no way to ignore them for just the generated files. |
It'd be better if the imports are commented as well, or add some option (experimentalDecorators) to let the user select whether to add the decorators or not. also there is a variable that isn't used in the parser/Lexer generated files. |
This enables noUnusedLocals and noUnusedParameters TypeScript compiler options to check for unused parameters, imports, and variables. Unfortunately the antlr4ts generator creates code that violates this, so it's necessary to make a trade-off and pick the lesser evil. Given how many other places in the code-base had dead code, I think it's more valuable to have it enabled and deal with manually editing the antlr4ts output. There's an open issue about it tunnelvisionlabs/antlr4ts#412 so it might eventually be fixed upstream.
This enables tslint no-unused-variable options to check for unused parameters, imports, and variables. Ideally we'd use TypeScript's native `noUnusedLocals` and `noUnusedParameters`, but unfortunately antlr4ts generates code that violates this. There's an open issue about this tunnelvisionlabs/antlr4ts#412 so if it's eventually fixed we can swap to `noUnusedLocals`.
This enables tslint no-unused-variable options to check for unused parameters, imports, and variables. Ideally we'd use TypeScript's native `noUnusedLocals` and `noUnusedParameters`, but unfortunately antlr4ts generates code that violates this. There's an open issue about this tunnelvisionlabs/antlr4ts#412 so if it's eventually fixed we can swap to `noUnusedLocals`.
I met this issue in my project. It violates noUnusedLocals in ts compile options, that cannot be changed. Is there any solution or workaround for it now? |
* chore: remove unused code This enables tslint no-unused-variable options to check for unused parameters, imports, and variables. Ideally we'd use TypeScript's native `noUnusedLocals` and `noUnusedParameters`, but unfortunately antlr4ts generates code that violates this. There's an open issue about this tunnelvisionlabs/antlr4ts#412 so if it's eventually fixed we can swap to `noUnusedLocals`. * Keep wire helper types * Revert generated files Co-authored-by: Adel <adel.m.salah@gmail.com>
The generated files contains some errors. You have imported the decorators NotNull and Override and commented their usage, is there a way to uncomment them or remove the imports without me touching the file manualy?
The text was updated successfully, but these errors were encountered: