Use oxlint and oxfmt#289
Conversation
🦋 Changeset detectedLatest commit: 9dc357d The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
commit: |
This comment has been minimized.
This comment has been minimized.
TypeScript Compiler Diagnostics (full)
TypeScript Compiler Diagnostics (50 types)
TypeScript Compiler Diagnostics (200 resolvers)
TypeScript Compiler Diagnostics (100 executors)
Reported by octocov |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@copilot can you fix lint? |
|
Sorry about this — under the templates directory we have |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| "packages/tailor-proto/", | ||
| "packages/create-sdk/templates/**", | ||
| "packages/create-sdk/templates/**/generated/" | ||
| "packages/create-sdk/templates/**" |
There was a problem hiding this comment.
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.
| 2-format: | ||
| glob: "*.{ts,js,json,md,yml,yaml}" | ||
| run: npx prettier --check {staged_files} | ||
| exclude: |
There was a problem hiding this comment.
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.
Code Metrics Report (packages/sdk)
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
Runtime Performance
Type Performance (instantiations)
Reported by octocov |
This PR introduces
oxlintandoxfmt.oxlint is used only in
packages/sdk, while oxfmt is configured in the rootpackage.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.