Open etrich opened 7 years ago
@etrich could you file a pull request?
I would suggest we fix those warnings/issues reported by tslint one by one instead of disabling tslint.
@etrich would you have time to help file PRs to make the TS Angular generator better? (this is not to say we push the task to you but I'm sure the community would appreciate your help to make the TS Angular generator better in terms of the code format)
I would suggest we fix those warnings/issues reported by tslint one by one instead of disabling tslint.
Given the rules can be dynamically configured in tslint.json, it would require a generator that can be dynamically configured using these rules and able to produce code in accordance. I don't think anyone wants to go there, so we'd need to agree on a tslint ruleset, which could be the tslint.json produced by Angular CLI ng new
(which uses codelyzer).
For people wanting to use "non standard" tslint rules, there would still be an opt-out in Angular CLI by adding lines in .angular-cli.json:
"lint": [{ "project": "src/tsconfig.app.json", "exclude": ["/node_modules/", "custom-path"] },
I can probably find some time to help, what's release date for 2.3.0 ?
I can probably find some time to help, what's release date for 2.3.0 ?
We hope to release it by the end of this year.
I'll just add a note here about tslint's no-unused-variable being deprecated in favor of tsc's --noUnusedLocals and friends. Which might be something to keep in mind.
Filed a related issue for typescript-fetch at #10835, but reposting here:
Would you accept a PR to remove references to TSLint?
@JoshuaKGoldberg good point! I have the generated files excluded in my ignored
eslintrc section.
However, I actually do run eslint --fix
from my scripts once after the code is generated, to get rid of unused imports etc, that could later cause a typescript compilation error. Not that this matters here, just wanted to provide a point of view :)
Description
The generated TS code disables only specific tslint rules:
/ tslint:disable:no-unused-variable member-ordering /
Some other generated files do not disable any tslint rules.
The generated code is causing tslint issues depending on configured rules, such as:
Swagger-codegen version
2.3.0 - swagger-codegen-cli-2.3.0-20171004.083430-178
Steps to reproduce
"semicolon": [ true, "always" ],
ng lint
Suggest a fix/enhancement
Simple fix would be to disable all tslint rules in generated files:
/ tslint:disable /