-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
TypeScript --noUnusedParameters and --noUnusedLocals flags #615
Comments
Good find, is there a way to completely disable validation for a .ts document (there is already a comment for TSLint)? |
@RSuter You can't disable validation currently because it's at the TypeScript compiler level. I have some changes in a branch to solve the particular issues here, but I couldn't send a PR last night because of the diff problem. We'll probably want to go through the other clients besides Angular 2 and check those as well. |
Yes, we should fix all tpls |
@RSuter Yes, you can skip the validation with TSLint for some files, but you shouldn't bother with TSLint, mostly because its usage is optional and the usage of the TS compiler is required : ) As @grovesNL said, those flags are now part of the Typescript compiler itself. You can disasble the validation if you set them to false(the default values), but you can't disable them for some files. So It's either on or off for all of your ts files. As I said, and as @grovesNL pointed out, there might be some other problems (due to some other flags in the TS compiler config) and in other TS templates from(I posted this issue just for the Angular2 template). We could start with min NSwag configuration, generate all of the possible TS templates and then run them with through the TS compiler with max strictness options. Something like:
|
I'll try to look at this soon. #563 is related to |
Maybe we should also improve the integration tests so that the generated TS outputs are compiled and linted... Currently I regenerate the integration svcs and only check the diff... |
Fix Angular 2 compiler errors from #615
Can we close this one? |
Hello, I am currently using tslint as a linter for my ts files and I was ignoring the ts file, generated by your awesome lib.
Now, tslint started to deprecate the unused varuable flag (Start to deprecate no-unused-variable rule) , because in newer versions of Typescript
noUnusedParameters
andnoUnusedLocals
flags have been added (Flag unused declarations with --noUnusedParameters and --noUnusedLocals)If you set them to true and try to compile the ts file, generated by NSwag you will get at least:
noUnusedParameters
to true (caused by this)noUnusedLocals
to true (caused by this)As far as I can see the latest is caused, because it is used in the
TransformOptionsMethod
hereThere might be some other errors, those are the onse I stumbled upon.
Thank you!
The text was updated successfully, but these errors were encountered: