-
Notifications
You must be signed in to change notification settings - Fork 147
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
Output list instead of table #5426
base: master
Are you sure you want to change the base?
Conversation
@rpl @willdurand I believe the improvements here are evident from my screenshots:
The only reason not to move forward with this is because it already works, albeit in this suboptimal fashion. Since I'm currently available to work on this, allow me to complete this change and merge this PR. I don’t really like keeping PRs open for years |
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.
Thanks for improving the readability and dropping one dependency. We're willing to switch the output format.
Could you adjust the text and update the tests so that they pass?
Thanks for this, and apologies for the review delay!
const location = message.file | ||
? `${message.file}${message.line ? `:${message.line}` : ''}${ | ||
message.column ? `:${message.column}` : '' | ||
}` | ||
: 'N/A'; |
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.
Could you split this string construction in separate variables, so that there are no three ternary expressions embedded in one?
For example something like the following (untested, but just to show how it could be unrolled into something that is a bit more readable):
const location = message.file | |
? `${message.file}${message.line ? `:${message.line}` : ''}${ | |
message.column ? `:${message.column}` : '' | |
}` | |
: 'N/A'; | |
let location = message.file || 'N/A'; | |
if (message.file && message.line) { | |
location += `:${message.line}`; | |
if (message.column) { | |
location += `:${message.column}`; | |
} | |
} |
Great, let's see if I have time this month |
Before
This isn't even the full table, it doesn't fit on my screen
After