-
Notifications
You must be signed in to change notification settings - Fork 155
fix(@schematics/angular): set tslint to emit warnings #269
Conversation
tslint 5 is now raising errors by default, instead of warnings previously, and it's very confusing (lint errors can't be displayed the same way as real syntax errors).
@cyrilletuzi won't this make running tslint always return successfully (instead of an error code)? |
Based on the discussion in the referenced PR, I don't really think this should be default behavior especially since it is something that can be easily changed by the user, if desired. |
@filipesilva @clydin I just tested with
|
And even if it wasn't the case, I would disagree about the default behavior : if this is really easy to change, then default should be a nice experience for most users (which is the role of the CLI), who are currently troubled in their dev experience to see just lint errors as syntax errors (I'm teaching Angular courses, so I speak from experience), and advanced users should be the ones who have to change it (supposing it's necessary, but it doesn't seem so). |
For reference, the PR that @clydin mentioned is angular/angular-cli#6568. It surprises me that On the topic of linting experience vs correctness, I'm sorry but I have to disagree. I understand that your experience overwhelmingly emphasizes the learning developer experience, but that the non-learning segment is also important. This default means no linting check will ever fail unless you change it manually. That includes CI checks, git pre-commit hooks, and just running You must get daily (if not hourly) confused questions about why all these linting problems show as errors, and for you this has been going on for months now. But please also consider how many issues would be opened because of That is my argument: while the current option can be surprising, a lot of users will also find this change both surprising and incorrect. So I think this approach simply moves the bad user experience from one set of users to another, and then makes linting behaviour incorrect (insofar as linting is meant to fail when there are problems). @alexeagle mentioned the multiple tslint approach (angular/angular-cli#6568 (comment)). We already do something similar with And to be honest we already bend over backwards with exclusion lists to pretend we have multiple I think at the moment the current separation (or lack thereof) between editor tooling config and build tooling config is problematic for users, and that linting is just one facet of the problem. |
Well, the current CLI may be buggy, but wouldn't it be a good solution for both set of users ? With this PR, Another solution would be to include a default vscode (and other editors) setting file with |
Just curious, why is this an issue now? Is is something new with 5.8? Looking through the changelog it doesn't seem to be something that changed in 5.8, and looking through our git blame we've been using 5 for months now. |
It's not an issue now. The initial PR is from 6 months ago. At that time I was told it was more complicated than I thought and that it would be discussed by the CLI team. Then no news, I just saw a bullet in one of the Weekly meeting notes saying it won't go any further if there was no caretaker for it. |
Speaking of lint warnings vs. compiler errors, we now have another way to deal with this at Google, http://tsetse.info |
If I understand correctly new @hansl commit in CLI, the solution of this PR won't be possible anymore if we want to satisfy everyone. So what about the second option ? Ie. generate a default settings file for main editors (like We could add an option like I can take care of the PR, just need a go (don't want to lose time if it's not OK, this one would be less trivial). |
I'm going to close this as the intent behind linting is to show up as errors anyway, otherwise they're lost in the process. If you want to use warnings, doing this PR yourself in the project isn't too much work. |
tslint 5 is now raising errors by default, instead of warnings previously, and it's very confusing (lint errors can't be displayed the same way as real syntax errors).
@hansl @Brocco @filipesilva