Skip to content

Lint log messages are shown twice #11088

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

Closed
pas2al opened this issue Jun 1, 2018 · 9 comments
Closed

Lint log messages are shown twice #11088

pas2al opened this issue Jun 1, 2018 · 9 comments

Comments

@pas2al
Copy link

pas2al commented Jun 1, 2018

Versions

Angular CLI: 6.0.7
Node: 9.6.1
OS: darwin x64
Angular: 6.0.3
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.7
@angular-devkit/build-angular     0.6.7
@angular-devkit/build-optimizer   0.6.7
@angular-devkit/core              0.6.7
@angular-devkit/schematics        0.6.7 (cli-only)
@angular/cdk                      6.2.0
@angular/cli                      6.0.7
@angular/material                 6.2.0
@ngtools/webpack                  6.0.7
@schematics/angular               0.6.7 (cli-only)
@schematics/update                0.6.7
rxjs                              6.2.0
typescript                        2.7.2
webpack                           4.8.3

Repro steps

  • Start lint with ng lint

Observed behavior

Success and error messages from lint are shown twice in the console.

For example, success case:

$ ng lint


All files pass linting.


All files pass linting.

Error case (with a simple lint error (missing semicolon)):

$ ng lint

ERROR: .../frontend/src/app/file-list/file-list.component.ts[11, 55]: Missing semicolon
ERROR: .../frontend/src/app/file-list/file-list.component.ts[11, 55]: Missing semicolon

Lint errors found in the listed files.


All files pass linting.

Desired behavior

The log messages (success and error case) should only be shown once.

Mention any other details that might be useful (optional)

Why are there so many new lines between the log messages?
Why does it say All files pass linting. in the error case? Shouldn't it just say Lint errors found in the listed files.?

@fetis
Copy link

fetis commented Jun 7, 2018

I can confirm, I have the same problem

@ndelrossi
Copy link

ndelrossi commented Jun 13, 2018

Running ng lint [project name] prevents the double message for me. See: https://github.com/angular/angular-cli/wiki/lint

@pas2al
Copy link
Author

pas2al commented Jun 14, 2018

Ok, but why do we receive the message twice even when there is only one project?

@pas2al pas2al changed the title Lint log messages are shown twice in the console Lint log messages are shown twice Jun 14, 2018
@will-janz
Copy link

Running ng lint on a fresh CLI generated project returns similar output as the OP, and running ng lint project yielded expected output. Looking at angular.json I have two projects; "project" and "project-e2e". I made "project-e2e2" and ng lint showed "All files passed linting" three times.

Seems like ng lint's default behavior is to lint every project at once, of which there are two to start.

@pas2al pas2al closed this as completed Jul 18, 2018
@fetis
Copy link

fetis commented Jul 19, 2018

thanks for research @will-janz
in that case, I would suggest to re-configure ts lint for e2e to look into the e2e folder only.

@fbiville
Copy link

Maybe ng lint could display the project being linted as well, that would be less confusing.

@farxelemon
Copy link

Maybe ng lint could display the project being linted as well, that would be less confusing.

Any updates on this? I really would like ng lint to display a message with the project linted.

@csutorasr
Copy link

csutorasr commented Apr 29, 2019

This is solved by #12384.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants