Meta: Format TS files with dprint (once)#9240
Conversation
Agent-Logs-Url: https://github.com/refined-github/refined-github/sessions/c3dc672a-de56-45b7-a27a-15d171bd96cb Co-authored-by: fregante <1402241+fregante@users.noreply.github.com>
Agent-Logs-Url: https://github.com/refined-github/refined-github/sessions/c3dc672a-de56-45b7-a27a-15d171bd96cb Co-authored-by: fregante <1402241+fregante@users.noreply.github.com>
Agent-Logs-Url: https://github.com/refined-github/refined-github/sessions/c3dc672a-de56-45b7-a27a-15d171bd96cb Co-authored-by: fregante <1402241+fregante@users.noreply.github.com>
…arens wrapping Agent-Logs-Url: https://github.com/refined-github/refined-github/sessions/a0a5458b-72d6-472f-9517-ff55e16b62ef Co-authored-by: fregante <1402241+fregante@users.noreply.github.com>
…estions Agent-Logs-Url: https://github.com/refined-github/refined-github/sessions/460890b1-23b1-4fe4-8f3e-7dd2e4208847 Co-authored-by: fregante <1402241+fregante@users.noreply.github.com>
…-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>
…extContent Agent-Logs-Url: https://github.com/refined-github/refined-github/sessions/5376b822-64f3-4366-87d4-50eecc479cda Co-authored-by: fregante <1402241+fregante@users.noreply.github.com>
Agent-Logs-Url: https://github.com/refined-github/refined-github/sessions/00571d53-38ab-475d-a61a-c1f07ff24f83 Co-authored-by: fregante <1402241+fregante@users.noreply.github.com>
Agent-Logs-Url: https://github.com/refined-github/refined-github/sessions/00571d53-38ab-475d-a61a-c1f07ff24f83 Co-authored-by: fregante <1402241+fregante@users.noreply.github.com>
|
YOLO |
|
To maintainers: Please add labels to this PR |
|
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. |
| 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}, | ||
| ); |
There was a problem hiding this comment.
"arguments.preferHanging": "always" fixes this, but makes other calls look worse
| if (elementExists([ | ||
| 'button[data-hotkey="Mod+Enter"]:disabled', | ||
| 'button[type="submit"]:disabled', | ||
| ], form)) { | ||
| if ( | ||
| elementExists([ |
There was a problem hiding this comment.
ifStatement.preferHanging doesn't have the onlySingleItem setting for some reason
| 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> |
There was a problem hiding this comment.
dprint/dprint-plugin-typescript#500
The only relevant issue I can find. How can anyone like this?
There was a problem hiding this comment.
Maybe it could be jsxTextNode.forceSingleLine like importDeclaration.forceSingleLine
There was a problem hiding this comment.
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)
|
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>{' '} |
|
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. |
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. |
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 |
| ${ | ||
| commits.map((commit: string) => ` |
There was a problem hiding this comment.
Isn't affected by preferHanging at all
There was a problem hiding this comment.



Replaces and closes #9239