Skip to content

Use oxlint and oxfmt#289

Merged
toiroakr merged 20 commits into
mainfrom
chore/use-oxlint-and-oxfmt
Dec 25, 2025
Merged

Use oxlint and oxfmt#289
toiroakr merged 20 commits into
mainfrom
chore/use-oxlint-and-oxfmt

Conversation

@riku99

@riku99 riku99 commented Dec 23, 2025

Copy link
Copy Markdown
Contributor

This PR introduces oxlint and oxfmt.

oxlint is used only in packages/sdk, while oxfmt is configured in the root package.json, so it affects formatting across the entire repository.

The migration was done using the commands provided by oxlint and oxfmt to automatically generate the necessary configuration files. After that, any remaining issues were fixed manually as needed.

Notes

oxlint does not cover all ESLint rules, so ESLint is still used for rules that cannot be validated by oxlint.

oxfmt does not support all Prettier configurations, so this PR also includes code changes resulting from formatting differences.

@changeset-bot

changeset-bot Bot commented Dec 23, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9dc357d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@tailor-platform/sdk Patch
@tailor-platform/create-sdk Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@riku99 riku99 changed the title USe oxlint Use oxlint Dec 23, 2025
@pkg-pr-new

pkg-pr-new Bot commented Dec 23, 2025

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/tailor-platform/sdk/@tailor-platform/create-sdk@289

commit: 9dc357d

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown

TypeScript Compiler Diagnostics (full)

main (054081d) #289 (6185f59) +/-
Types 56,845 56,845 0
Instantiations 188,752 188,752 0
Check Time 2.74s 1.72s -1.02s
Total Time 5.9s 3.75s -2.15s

TypeScript Compiler Diagnostics (50 types)

main (054081d) #289 (6185f59) +/-
Types 2,143 2,143 0
Instantiations 3,714 3,714 0
Check Time 0s 0s 0s
Total Time 1.75s 1.58s -0.17s

TypeScript Compiler Diagnostics (200 resolvers)

main (054081d) #289 (6185f59) +/-
Types 17,673 17,673 0
Instantiations 144,881 144,881 0
Check Time 0.04s 0.04s 0s
Total Time 2.99s 2.82s -0.17s

TypeScript Compiler Diagnostics (100 executors)

main (054081d) #289 (6185f59) +/-
Types 4,698 4,698 0
Instantiations 19,199 19,199 0
Check Time 0.02s 0.02s 0s
Total Time 1.92s 1.77s -0.15s

Reported by octocov

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@riku99 riku99 changed the title Use oxlint Use oxlint and oxfmt Dec 25, 2025
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@riku99
riku99 requested a review from remiposo as a code owner December 25, 2025 09:10
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@riku99
riku99 requested a review from toiroakr December 25, 2025 09:18

@toiroakr toiroakr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 👍

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@toiroakr

Copy link
Copy Markdown
Contributor

@copilot can you fix lint?

Copilot AI commented Dec 25, 2025

Copy link
Copy Markdown
Contributor

@toiroakr I've opened a new pull request, #320, to work on those changes. Once the pull request is ready, I'll request review from you.

@riku99

riku99 commented Dec 25, 2025

Copy link
Copy Markdown
Contributor Author

Sorry about this — under the templates directory we have
"format:check": "prettier --check .",
so formatting the files at the repository root with oxfmt seems to cause differences.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Comment thread .oxfmtrc.json
"packages/tailor-proto/",
"packages/create-sdk/templates/**",
"packages/create-sdk/templates/**/generated/"
"packages/create-sdk/templates/**"

@riku99 riku99 Dec 25, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We don’t want oxfmt to affect anything under packages/create-sdk/templates/**, since those files are meant to be used as user-facing templates. To make that explicit, we ignore templates/** in the formatter/linting setup.

Comment thread lefthook.yml
2-format:
glob: "*.{ts,js,json,md,yml,yaml}"
run: npx prettier --check {staged_files}
exclude:

@riku99 riku99 Dec 25, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oxfmt only applies ignorePatterns when it discovers files itself (e.g. oxfmt --check .). When we pass file paths explicitly in lefthook (pnpm oxfmt --check {staged_files}), those files are still checked even if they match ignorePatterns.

As a result, changes under example/generated/** can make pre-commit fail with pnpm oxfmt --check {staged_files}, even though oxfmt --write . would never touch them.
To keep generated/template files completely out of pre-commit formatting, we also need to list the same paths under exclude: in lefthook.yml, in addition to ignorePatterns in .oxfmtrc.json.

@github-actions

Copy link
Copy Markdown

Code Metrics Report (packages/sdk)

main (b4bfd9a) #289 (5d07c14) +/-
Coverage 48.4% 48.5% +0.0%
Code to Test Ratio 1:0.3 1:0.3 +0.0
Details
  |                    | main (b4bfd9a) | #289 (5d07c14) |  +/-  |
  |--------------------|----------------|----------------|-------|
+ | Coverage           |          48.4% |          48.5% | +0.0% |
  |   Files            |            169 |            169 |     0 |
  |   Lines            |           4888 |           4863 |   -25 |
- |   Covered          |           2368 |           2359 |    -9 |
+ | Code to Test Ratio |          1:0.3 |          1:0.3 |  +0.0 |
  |   Code             |          27849 |          26059 | -1790 |
- |   Test             |           9023 |           8564 |  -459 |

Code coverage of files in pull request scope (48.6% → 48.7%)

Skip file coverages because there are too many files (117)

SDK Configure Bundle Size

main (b4bfd9a) #289 (5d07c14) +/-
configure-index-size 2.91KB 2.91KB 0KB
dependency-chunks-size 17.7KB 17.7KB 0KB
total-bundle-size 20.61KB 20.61KB 0KB

Runtime Performance

main (b4bfd9a) #289 (5d07c14) +/-
Generate Median 2,453ms 2,347ms -106ms
Generate Max 2,467ms 2,446ms -21ms
Apply Build Median 2,769ms 2,620ms -149ms
Apply Build Max 2,794ms 2,704ms -90ms

Type Performance (instantiations)

main (b4bfd9a) #289 (5d07c14) +/-
tailordb-basic 112,156 112,156 0
tailordb-optional 4,468 4,468 0
tailordb-relation 5,414 5,414 0
tailordb-validate 3,612 3,612 0
tailordb-hooks 6,628 6,628 0
tailordb-object 12,108 12,108 0
tailordb-enum 3,452 3,452 0
resolver-basic 12,873 12,873 0
resolver-nested 29,297 29,297 0
resolver-array 21,545 21,545 0
executor-schedule 11,176 11,176 0
executor-webhook 7,789 7,789 0
executor-record 13,111 13,111 0
executor-resolver 14,094 14,094 0
executor-operation-function 7,773 7,773 0
executor-operation-gql 7,770 7,770 0
executor-operation-webhook 7,783 7,783 0
executor-operation-workflow 9,030 9,030 0

Reported by octocov

@riku99
riku99 requested a review from toiroakr December 25, 2025 11:54
@toiroakr
toiroakr merged commit c6f655e into main Dec 25, 2025
15 checks passed
@toiroakr
toiroakr deleted the chore/use-oxlint-and-oxfmt branch December 25, 2025 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants