x)- [ ] bug report -> please search issues before submitting
- [X] feature request
@angular/cli: 1.1.0-beta.0
node: 7.4.0
TSLint has introduced tslint:recommended (and tslint:latest) for a while, allowing a config to extend the recommended default, and just override a few rules.
It means we could simplify the configuration, and just keep a few overrides that are common in the Angular community.
See the recommended set of rules: https://github.com/palantir/tslint/blob/master/src/configs/recommended.ts
I gave it a naive first try, this is how the tslint.json would look like (to keep the configuration really close to the one we have right now):
{
"rulesDirectory": [
"node_modules/codelyzer"
],
"extends": "tslint:recommended",
"rules": {
"array-type": false,
"arrow-parens": false,
"interface-name": false,
"import-blacklist": [true, "rxjs"],
"max-line-length": [
true,
140
],
"member-access": false,
"member-ordering": [
true,
"static-before-instance",
"variables-before-functions"
],
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-empty": false,
"no-inferrable-types": [true, "ignore-params"],
"no-non-null-assertion": true,
"no-string-literal": false,
"no-switch-case-fall-through": true,
"object-literal-sort-keys": false,
"ordered-imports": false,
"one-line": [
true,
"check-open-brace",
"check-catch",
"check-else",
"check-whitespace"
],
"quotemark": [
true,
"single"
],
"trailing-comma": false,
"variable-name": false,
"directive-selector": [true, "attribute", "pr", "camelCase"],
"component-selector": [true, "element", "pr", "kebab-case"],
"use-input-property-decorator": true,
"use-output-property-decorator": true,
"use-host-property-decorator": true,
"no-input-rename": true,
"no-output-rename": true,
"use-life-cycle-interface": true,
"use-pipe-transform-interface": true,
"component-class-suffix": true,
"directive-class-suffix": true,
"no-access-missing-member": true,
"templates-use-public": true,
"invoke-injectable": true
}
}
If you think it is interesting, I can work on a PR.
I think this would be a nice addition, because it means less rules for us to keep up to date.
@filipesilva Are you working on this? If you aren't I'd like to pick this up.
@laumair I already have a PR nearly ready :)
@cexbrayat Ah! :+1:
Extremely upvote for this. I was very surprised that this's not turned on by default. Have to clean up some shitty code because of it now.
I see that the previous PR didn't make it to master. Does anyone want to give it a try? If there's still interest around this, we'll be happy to merge the PR. Just make sure that you preserve the same tslint.json config.
@mgechev I can give it a go. Do you mean that at first we need the exact same result as the current config, even if that means taking an opposite choice than the recommended set?
For example, we currently don't enforce adjacent-overload-signatures, whereas the recommended set does. That means we'll have to set adjacent-overload-signatures: false in the config if we extend the recommended set. What do you think?
@cexbrayat yes, this would be ideal.
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
I think this would be a nice addition, because it means less rules for us to keep up to date.