Skip to content

Improve detailed formatter#143

Merged
IanVS merged 4 commits intoIanVS:mainfrom
brokentone:feature/kenton/simplify-detailed-formatter
Oct 10, 2025
Merged

Improve detailed formatter#143
IanVS merged 4 commits intoIanVS:mainfrom
brokentone:feature/kenton/simplify-detailed-formatter

Conversation

@brokentone
Copy link
Copy Markdown
Contributor

@brokentone brokentone commented Sep 17, 2025

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.

Screenshot 2025-09-26 at 11 32 34 AM

@brokentone brokentone force-pushed the feature/kenton/simplify-detailed-formatter branch 3 times, most recently from daa648a to ef43eaf Compare September 26, 2025 13:46
@brokentone brokentone changed the title Add test scaffold for detailed formatter Improve detailed formatter Sep 26, 2025
@brokentone brokentone force-pushed the feature/kenton/simplify-detailed-formatter branch from ef43eaf to acc6a67 Compare September 26, 2025 15:26
@brokentone brokentone marked this pull request as ready for review September 26, 2025 15:59
@IanVS
Copy link
Copy Markdown
Owner

IanVS commented Oct 1, 2025

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.

Copy link
Copy Markdown
Owner

@IanVS IanVS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM, nice work, thanks.

Comment thread tests/fixtures/reports/one-file-one-error-one-fixable-error.js
@IanVS IanVS merged commit b8de69a into IanVS:main Oct 10, 2025
4 checks passed
@brokentone
Copy link
Copy Markdown
Contributor Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replacing eslint-formatter-friendly output documentation link instead of google link

2 participants