contains the below comment
/* tslint:disable:no-unused-variable member-ordering */
attempting to avoid linting errors.
However, this prevents fixers (like prettier-tslint, etc) to actually attempt and fix the the unused local vars issue.
Also note that the specific problem of unused locals will not be avoided if the TS compiler has stricter config that does not allow unused locals.
3.3.2
https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache
/* tslint:disable:no-unused-variable member-ordering */
Disabling the tslint rule does nobody a favor as TS can still catch you out.
The fix is to properly handle the conditionals of the template to correctly declare things only when needed.
override the template to remove the comment and use a fixer - but this is not ideal
@gkamperis as you've suggested, please a fixer as a workaround for the time being. You can do so in the file post-processing hook. For example, using prettier to format the code:
export TS_POST_PROCESS_FILE="/usr/local/bin/prettier --write"
and switch on post file processing via --enable-post-process-file (CLI)
tslint had the no-unused-variable rule which came with a fixer, but that rule has been deprecated because it is now implemented in the built-in typescript compiler. However, tsc doesn't have a fixer.
So... how does one run a post-process fixer for this?
I can't seem to find a linter that will fix no-unused-variable (eslint's one doesn't have a fixer)
I'm new to the typescript-axios generator, and just encountered this error. Are they any programatic workarounds?
Most helpful comment
tslinthad theno-unused-variablerule which came with a fixer, but that rule has been deprecated because it is now implemented in the built-in typescript compiler. However,tscdoesn't have a fixer.So... how does one run a post-process fixer for this?
I can't seem to find a linter that will fix
no-unused-variable(eslint's one doesn't have a fixer)