Improve detailed formatter#143
Conversation
daa648a to
ef43eaf
Compare
ef43eaf to
acc6a67
Compare
|
Excellent, thanks! I will give this a review soon. In the meantime, what would you think about releasing this as a standalone formatter, so others can use it as well? I see that @JounQin was asking about the friendly-formatter maintenance status in royriojas/eslint-formatter-friendly#14 not too long ago, so perhaps this formatter would be useful to him. |
Sorry for the delay -- it's a good point. I'll let you know if I end up doing so! |
Description
I've written a new detailed formatter to replace the abandoned "friendly" formatter, which fixes: #144 and is the last piece for #137
I've tried to carry over most of the functionality, while also merging the tsc output and make some additional cleanup. i.e. one of my concerns with the old format is that I would get lost on which message went with which code. Between the colors and the spacing, the grouping was a bit unclear.
Now, the messages are sorted by file, line, and column (vs the old formatter also sorted by severity). Each message is 2 lines of the filename+path with the line and column positions, severity, the rule name and the link (using terminal-link -- so it will print the link unless it's supported to embed the link). Also this link is fixed, using the meta url value, which fixes #113
The second line is the message.
Then using
@babel/code-frame, it also uses both the start and the end values to show the full error position.Finally, it has a summary of the files, similar to tsc, vs the rule links.
Added tests to support and made various updates as needed.