-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Feature: Add a way to output lint result to a file #13497
Comments
I'd approach similarly - just redirect stdout to a file. If you want to have a more "native" feel, I'd recommend you to implement a custom tslint formatter and update your configuration in Although this feature seems useful in some specific scenarios, we need to be careful expanding the scope of the CLI with functionalities which have good pre-existing solutions. I hope this helps! Thanks :) |
What is the point of the json ouput option if the cli is printing it unusable as actual json. Makes no sense to me. This was working in Angular 6 but has broken in Angular 7 |
@alan-agius4 pointed out that this is a regression; reopening. |
@PodgeHeavin, I am unable to reproduce the issue. Can you run You should have the following versions
My result is [
{
"endPosition": {
"character": 26,
"line": 8,
"position": 214
},
"failure": "\" should be '",
"fix": {
"innerStart": 198,
"innerLength": 16,
"innerText": "'int-issue-json'"
},
"name": "/Users/alan/git/lint-issue-json/src/app/app.component.ts",
"ruleName": "quotemark",
"ruleSeverity": "ERROR",
"startPosition": {
"character": 10,
"line": 8,
"position": 198
}
},
{
"endPosition": {
"character": 26,
"line": 8,
"position": 214
},
"failure": "Missing semicolon",
"fix": {
"innerStart": 214,
"innerLength": 0,
"innerText": ";"
},
"name": "/Users/alan/git/lint-issue-json/src/app/app.component.ts",
"ruleName": "semicolon",
"ruleSeverity": "ERROR",
"startPosition": {
"character": 26,
"line": 8,
"position": 214
}
}
] |
|
Kindly update to the latest version of packages mentioned above and see if you still encounter the issue. |
Issue persists. The issue is only present in bash/linux but not in windows CMD.
|
Hi,If you want to redirect the stream output in git bash I suggest you use the FORCE_COLOR=0 ng lint --format=json > issues.json Let me know if this solved your issue. Thanks. |
This has not fixed the issue unfortunately. What has changed from Angular 6 to Angular 7 to cause this? We have some of our code on Angular 6 and the command is working fine and a new project running with angular 7 and this is where we are seeing the issue. It is failing on git bash locally and all our linux build servers. |
I removed the colors for the info, Git Bash is known to have some issues with colors. Though using |
Rely on the terminal to provide the color for info messages fixes #13497
Rely on the terminal to provide the color for info messages fixes #13497
Thanks for this. Impressed with the turn around. |
@PodgeHeavin this should be part of 7.2.3 in an hour or so. |
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. |
🚀 Feature request
Description
ng lint --format=json > issues.json
Worked previously as describe here: #4959
Worked for outputting results to json or any format.
In Angular 7 there was the addition of color to the output of lint results. This has broken the above workaround for outputting to a file.
what was previously like:
is now like so
Solution I would like
I would like an option added to ng lint to output to a file easilyWorkaround
"ng lint --format=json | sed -r \"s/\\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g\" > issues.json"
Which is ugly but works
The text was updated successfully, but these errors were encountered: