Skip to content

formatter: non idempotent formatting on comments in TS #20219

@CatChen

Description

@CatChen

Steps to reproduce

  1. Clone https://github.com/CatChen/oxlint-suggestion-action and set it up with yarn v4.
  2. Run yarn codegen. It calls codegen.ts, which has afterOneFileWrite: ['oxfmt --write'] hook set up so all newly generated code should go through oxfmt once.
  3. Commit any changes.
  4. Run yarn format. It run oxfmt a second time.
  5. Notice code change in src/__graphql__/graphql.ts.

Examples of code changes from the second pass of oxfmt:

@@ -1151,7 +1151,7 @@ export type AuditLogOrder = {
 1151
 1152    /** Properties by which Audit Log connections can be ordered. */
 1153    export type AuditLogOrderField =
 1154  - /** Order audit log entries by timestamp */
 1154  +   /** Order audit log entries by timestamp */
 1155      'CREATED_AT';
 1156
 1157    /** Represents a 'auto_merge_disabled' event on a given pull request. */
@@ -6010,7 +6010,7 @@ export type DeploymentOrder = {
 6010
 6011    /** Properties by which deployment connections can be ordered. */
 6012    export type DeploymentOrderField =
 6013  - /** Order collection by creation time */
 6013  +   /** Order collection by creation time */
 6014      'CREATED_AT';
 6015
 6016    /** A protection rule. */
@@ -7225,7 +7225,7 @@ export type EnterpriseAdministratorInvitationOrder = {
 7225
 7226    /** Properties by which enterprise administrator invitation connections can be ordered. */
 7227    export type EnterpriseAdministratorInvitationOrderField =
 7228  - /** Order enterprise administrator member invitations by creation time */
 7228  +   /** Order enterprise administrator member invitations by creation time */
 7229      'CREATED_AT';
 7230
 7231    /** The possible administrator roles in an enterprise account. */
@@ -7485,7 +7485,7 @@ export type EnterpriseMemberInvitationOrder = {
 7485
 7486    /** Properties by which enterprise member invitation connections can be ordered. */
 7487    export type EnterpriseMemberInvitationOrderField =
 7488  - /** Order enterprise member invitations by creation time */
 7488  +   /** Order enterprise member invitations by creation time */
 7489      'CREATED_AT';
 7490
 7491    /** Ordering options for enterprise member connections. */

They are purely indentations.

Metadata

Metadata

Assignees

Labels

Type

Priority

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions