Skip to content

Meta: Format TS files with dprint (once)#9240

Merged
fregante merged 36 commits into
mainfrom
dprint-but-eslint
Apr 22, 2026
Merged

Meta: Format TS files with dprint (once)#9240
fregante merged 36 commits into
mainfrom
dprint-but-eslint

Conversation

@fregante
Copy link
Copy Markdown
Member

@fregante fregante commented Apr 22, 2026

Replaces and closes #9239

Copilot AI and others added 30 commits April 18, 2026 08:48
…-files-with-dprint

Co-authored-by: fregante <1402241+fregante@users.noreply.github.com>
…-files-with-dprint

Co-authored-by: fregante <1402241+fregante@users.noreply.github.com>
… use helpers in selectors

Agent-Logs-Url: https://github.com/refined-github/refined-github/sessions/2d1d5acc-7b73-4b87-8187-4c9afb857bcf

Co-authored-by: fregante <1402241+fregante@users.noreply.github.com>
Co-authored-by: fregante <1402241+fregante@users.noreply.github.com>
@fregante fregante marked this pull request as ready for review April 22, 2026 10:13
@fregante fregante merged commit c0e15f4 into main Apr 22, 2026
14 checks passed
@fregante
Copy link
Copy Markdown
Member Author

YOLO

@fregante fregante deleted the dprint-but-eslint branch April 22, 2026 10:15
@github-actions
Copy link
Copy Markdown

To maintainers: Please add labels to this PR

@fregante fregante added the meta Related to Refined GitHub itself label Apr 22, 2026
@fregante
Copy link
Copy Markdown
Member Author

So in this PR I went ahead and removed any changes I deemed downgrades, including and especially those touching the whitespace. Once dprint/dprint-plugin-typescript#476 is resolved, I assume dprint will roughly follow our existing style anyway.

Comment on lines -30 to +37
observe([
'main [href="/apps/github-actions"] ~ div a.status-actions', // Legacy
'[data-testid="check-run-item"] a[href*="/actions/runs/"]', // React component on isPRCommits
], addForPr, {signal});
observe(
[
'main [href="/apps/github-actions"] ~ div a.status-actions', // Legacy
'[data-testid="check-run-item"] a[href*="/actions/runs/"]', // React component on isPRCommits
],
addForPr,
{signal},
);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a downgrade

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

"arguments.preferHanging": "always" fixes this, but makes other calls look worse

Comment on lines -25 to +26
if (elementExists([
'button[data-hotkey="Mod+Enter"]:disabled',
'button[type="submit"]:disabled',
], form)) {
if (
elementExists([
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a downgrade too

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ifStatement.preferHanging doesn't have the onlySingleItem setting for some reason

Comment on lines -40 to 45
A submission via <kbd>enter</kbd> has been prevented. You can press <kbd>enter</kbd> again or use <kbd>{moduleKey}</kbd><kbd>enter</kbd>.
A submission via <kbd>enter</kbd> has been prevented. You can press <kbd>enter</kbd> again or use{' '}
<kbd>{moduleKey}</kbd>
<kbd>enter</kbd>.
</p>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Very bad

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not configurable

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

dprint/dprint-plugin-typescript#500

The only relevant issue I can find. How can anyone like this?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe it could be jsxTextNode.forceSingleLine like importDeclaration.forceSingleLine

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think generally formatters are somewhat aware of inline tags but they don't always handle them the best way. And honestly anything longer than 80 characters plus tags is going to be hard to follow anyway, so there's no winning. The only solution I can think of is to not break the line at all if whitespace or inline tags are involved. But even then there exceptions (we have a feature with " • " followed by a whole dropdown component)

@SunsetTechuila
Copy link
Copy Markdown
Member

I don't understand the point of this PR. Just a lot of mostly unnecessary or even bad changes. Can we revert it?

<span className="ml-2 diffstat tooltipped tooltipped-s" aria-label={tooltip}>
<span className="color-fg-success">+{additions}</span>{' '}
<span className="color-fg-danger">−{deletions}</span>{' '}
<span className="color-fg-success">+{additions}</span> <span className="color-fg-danger">−{deletions}</span>{' '}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🗿

@fregante
Copy link
Copy Markdown
Member Author

fregante commented Apr 22, 2026

I don't understand what you don't understand. You saw the dprint TS PR and suggested that the only issue we had (whitespace) was fixable and you had a patch do it already. I had even closed the PR but reopened because you seemed interested. If you didn't like any of this, then that was your time to say it. The changes here are exactly what dprint suggested, minus the whitespace ones.

@fregante
Copy link
Copy Markdown
Member Author

fregante commented Apr 23, 2026

Can we revert it?

We can if you prefer not using any formatter on TS files at all, not now not next month. Reverting to ESLint and its formatting rules.

The merge was fast-tracked because the PR touches 118 files and it contains a substantial amount of manual work and reviewing, so it couldn't risk getting conflicts.

@SunsetTechuila
Copy link
Copy Markdown
Member

The merge was fast-tracked because the PR touches 118 files and it contains a substantial amount of manual work and reviewing, so it couldn't risk getting conflicts.

That's an explanation, thanks 👍

Regarding the formatting downgrades: I thought they could be fixed by tweaking the config, but it turns out they can't

Comment on lines +20 to +21
${
commits.map((commit: string) => `
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Isn't affected by preferHanging at all

Copy link
Copy Markdown
Member

@SunsetTechuila SunsetTechuila Apr 23, 2026

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can't complain about one GitHub bug without hitting another one! Fantastic

chrome_4LD98WIPZS

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

Labels

meta Related to Refined GitHub itself

Development

Successfully merging this pull request may close these issues.

3 participants