Skip to content

formatter: Descrency between Prettier and OxFmt #14871

@KieranP

Description

@KieranP

Ran OxFmt on our codebase, very close to being fully prettier compatible, one issue found.

Config (both for Prettier & OxFmt):

{
  "arrowParens": "always",
  "bracketSameLine": false,
  "bracketSpacing": true,
  "objectWrap": "preserve",
  "printWidth": 80,
  "semi": false,
  "singleQuote": true,
  "tabWidth": 2,
  "trailingComma": "es5",
  "useTabs": false
}

Before (formatted with Prettier):

return {
  listParts: (): AwsS3Part[] =>
    // just for pause/resume but required by uppy
    [],

  getUploadParameters: (
    _file: UppyFile<Meta, Body>,
    _options: { signal?: AbortSignal }
  ): AwsS3UploadParameters =>
    // not used since we only use multipart uploads but required by uppy
    ({
      method: 'PUT',
      url: '',
      fields: {},
      headers: {},
    }),
}

After (formatted with OxFmt 0.7.0, same formatting options as Prettier):

return {
  listParts: (): AwsS3Part[] => // just for pause/resume but required by uppy
  [],

  getUploadParameters: (
    _file: UppyFile<Meta, Body>,
    _options: { signal?: AbortSignal }
  ): AwsS3UploadParameters => // not used since we only use multipart uploads but required by uppy
  ({
    method: 'PUT',
    url: '',
    fields: {},
    headers: {},
  }),
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions