Skip to content

Meta: Format TS files with dprint - #9217

Closed
fregante with Copilot wants to merge 15 commits into
mainfrom
copilot/format-ts-tsx-files-with-dprint
Closed

fregante with Copilot wants to merge 15 commits into
mainfrom
copilot/format-ts-tsx-files-with-dprint

Conversation

Copilot AI commented Apr 18, 2026 •

Copy link
Copy Markdown
Contributor

Formats all TypeScript and TSX source files using dprint, with tuned configuration to preserve existing code style.

Test URLs

Screenshot

@fregante fregante left a comment

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.

@copilot never ever disable dprint inline. My requests are about global config, not inline exceptions

Comment thread source/features/bugs-tab.tsx Resolved
Comment thread source/features/closing-remarks.tsx Resolved
.closest('[data-testid="results-list"] > div')!
.querySelector('ul > span:last-of-type')!
.before(
<>

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.

Same

Copilot AI commented Apr 18, 2026

Copy link
Copy Markdown
Contributor Author

@copilot never ever disable dprint inline. My requests are about global config, not inline exceptions

Removed the inline // dprint-ignore — fixed via "jsx.multiLineParens": "never" and "jsx.quoteStyle": "preferDouble" in the global config instead (eefc8c2).

Copilot AI requested a review from fregante April 18, 2026 09:16

@fregante fregante left a comment

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.

Reviewed 130 files so far 😰

The changes are mostly ok

headerCommentCount.append(spacer);
headerCommentCount.after(link,
);
headerCommentCount.after(link);

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.

Good

Comment thread source/features/embed-gist-inline.tsx Resolved
Comment thread source/features/embed-gist-inline.tsx Resolved
Comment thread source/features/patch-diff-links.tsx Resolved
Comment thread source/features/quick-review.tsx Resolved
@fregante

Copy link
Copy Markdown
Member

So I think we cannot go ahead with dprint on TSX files since it breaks whitespace (see "wrong" comments). We'd have to wait for them to find and fix this issue before we can continue.

@fregante fregante closed this Apr 19, 2026
Copilot AI mentioned this pull request Apr 19, 2026
5 tasks done
@SunsetTechuila

Copy link
Copy Markdown
Contributor

@SunsetTechuila

Copy link
Copy Markdown
Contributor

Is this the only blocker?

@fregante

Copy link
Copy Markdown
Member

I haven't verified every file, but given how old that issue is I don’t think it's going to be magically fixed this week.

We're not in a rush to format TS files but due to how every other formatter deals with the features.add() arrays, dprint appears to be the only option (other than the current eslint)

Copilot AI requested a review from fregante April 20, 2026 09:43
@fregante
fregante marked this pull request as ready for review April 21, 2026 20:00
@refined-github refined-github deleted a comment from Copilot AI Apr 21, 2026
@fregante

Copy link
Copy Markdown
Member

Resolve conflicts. Prefer the code from main for is() and not() helpers. That work was extracted and approved already. @copilot

Copilot AI commented Apr 21, 2026

Copy link
Copy Markdown
Contributor Author

Resolve conflicts. Prefer the code from main for is() and not() helpers. That work was extracted and approved already. @copilot

Done in 0c3bfe9 — merged origin/main and used the source/helpers/css-selectors.ts version of is()/not() (with overloads for arrays) throughout. Removed the simpler versions I had added to dom-utils.ts.

Comment thread dprint.json Outdated
"**/*.css",
"**/*.gql",
"source/**/*.ts",
"source/**/*.tsx"

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.

Remove the two "source"
Add dprint.json itself

Comment thread dprint.json Outdated
"graphql": {},
"typescript": {
"indentWidth": 1,
"useTabs": true,

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.

Redundant

Comment thread source/options/feature-list.tsx Outdated
input.removeAttribute('name');
$(`.feature-name[for="${feature}"]`).after(
<span className="hotfix-notice"> (Disabled due to {createRghIssueLink(relatedIssue)})</span>,
<span className="hotfix-notice">(Disabled due to {createRghIssueLink(relatedIssue)})</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.

Missing space

{oldNames.length > 0 && (
<div className="color-fg-muted mt-n3">
<span className="text-small">previously named </span>
<span className="text-small">previously named</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.

Missing space

Comment thread source/features/embed-gist-inline.tsx Outdated
}
`}
</style>,
<style>{gistCss}</style>,

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.

Don't extract. Set inline via textContent JSX attribute.

@fregante

Copy link
Copy Markdown
Member

@copilot add missing dprint/typescript dependency. Format all files. Create new "CI / Format" step in the workflow files and take dprint out of the "CI / Lint" step

Copilot AI commented Apr 22, 2026

Copy link
Copy Markdown
Contributor Author

@copilot add missing dprint/typescript dependency. Format all files. Create new "CI / Format" step in the workflow files and take dprint out of the "CI / Lint" step

Done in f0e2f66:

  • Added @dprint/typescript: "^0.95.15" to devDependencies
  • Ran dprint fmt — formatted 4 files (build/features.test.ts, build/readme-parser.test.ts, build/readme-parser.ts, source/features/embed-gist-inline.tsx)
  • Added new "Format" CI job that runs npm run lint:dprint (dprint check)
  • Changed Lint CI job to run npm run lint:js + npm run lint:biome directly (removing dprint)

@fregante

Copy link
Copy Markdown
Member

I don’t think it's going to be magically fixed this week.

I have a patch!

🥹
🙏

fregante added a commit that referenced this pull request May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants