-
Notifications
You must be signed in to change notification settings - Fork 12k
feat(@angular/cli): extend tslnit config from recommended #6507
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
feat(@angular/cli): extend tslnit config from recommended #6507
Conversation
Tests files edited with |
Probably, some blueprints must be edited too.I will check this tomorrow. For now app generates without lint errors. We can minimise blueprint changes and disable some rules. |
From the linked issue it looks like @cexbrayat was also working on this. |
b370d8d
to
c770e77
Compare
Some rules just hasn't been used yet. |
I was indeed working on something similar but I didn't find the time to test my PR properly to see if the ruleset was identical. I also thought like @clydin that ideally the PR should require no changes as a first step, and wanted to offer several alternatives for the new rules and the ones where the CLI differs from the recommended config. But your PR @ValeryVS is maybe a good first step to start a discussion with the maintainers, so thank you for submitting this 👍 |
@clydin @cexbrayat
|
If we choose "Disable all rules, that wasn't used in old config", we should make another request with new rules support anyway. @filipesilva Which way from comment above you prefer? |
@cexbrayat |
c770e77
to
ab17c80
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heya @ValeryVS, good work matching these all. There just one rule that I think we should modify:
"no-consecutive-blank-lines": [
true,
2
],
It would get rid of some of the changes needed in polyfills, and overall it's quite common to leave two empty lines as separators (we do it a lot on the CLI).
Other than that, LGTM.
I tried the new config quickly on an existing project, and it raises a lot of warnings due to I don't know if this is a good or bad thing, I just wanted to point it out. Other than that, it's really close to what I had in my WIP PR for this 👍 |
Personally, I really don't think |
ab17c80
to
d14c312
Compare
@filipesilva Also adjust
@cexbrayat export interface Entity {
users: {
id: number;
name: string;
photo: string;
birthDate: string;
}[]; // <-- Pst... I'm array. Don't tell any one!
} @clydin if (a => 2) {
return true;
} This usage case is madness, but somtmies I swap lettres when tpying fast. So, it make sense. Anyway, the final word is for consumers. I, personally, add few more strict rules to this config for my projects. I want to add
We can discuss what else we could enable or disable in followup requests. |
3d9e5cc
to
d698b1c
Compare
@@ -30,7 +30,6 @@ function check(val: any, fxState: any) { | |||
fxState.num = val + ""; | |||
} | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was fail Exceeds the 2 allowed consecutive blank lines
which not fixed with lint --fix
command.
We can change no-consecutive-blank-lines
to 3
, if we want to avoid this change.
@@ -29,7 +29,6 @@ function check(val: any, fxState: any) { | |||
fxState.num = val + ""; | |||
} | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was fail Exceeds the 2 allowed consecutive blank lines
which not fixed with lint --fix
command.
We can change no-consecutive-blank-lines
to 3
, if we want to avoid this change.
The |
Also, the fact that there is debate here regarding various rules essentially proves my earlier point that even a recommended rule set is highly opinionated. My overall view for the default rule set for the CLI is that it should encourage best practices especially in regards to the use of Angular but should not be overtly strict in general and especially in the realm of stylistic concerns. Ideally new users of the CLI shouldn't be turned off to the tool because their preferred code style immediately results in numerous errors. With that said, I think a |
d698b1c
to
a0b477f
Compare
Imho This, together with #6568 makes me think linting config in general needs to be reviewed... I'll try to bring this up and get it sorted one way or another. Meanwhile, @ValeryVS can you rebase please? It's failing on stuff unrelated to your PR. |
no need to duplicate rules new rules can be applied without updating, when new tslint is used Fixes: angular#6179
a0b477f
to
a4aeca7
Compare
@filipesilva |
Heya @ValeryVS, wanted to give you an update. I escalated this up so that we come up with a better set of defaults instead of just trying to keep the current ones up to date. The current set of defaults was based on something we used in the Angular.io examples a long time ago. Meanwhile a lot of changes have been introduced to tslint and codelyzer, including defaults. We might end up making an angular default, from which projects would extend. I'm monitoring progress on this but have no estimate currently. Because of that I marked this as blocked. |
@filipesilva What's the status on this PR? |
Closing this; it changes blueprints which we don't support anymore. Please submit a PR on devkit if you want us to consider this. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
no need to duplicate rules
new rules can be applied without updating, when new tslint is used
Fixes: #6179