Skip to content

Commit c839cbe

Browse files
authored
tools: oxfmt (#3066)
oxfmt
1 parent 2ccdc89 commit c839cbe

File tree

18 files changed

+426
-302
lines changed

18 files changed

+426
-302
lines changed

.claude/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"hooks": [
77
{
88
"type": "command",
9-
"command": "jq -r '.tool_input.file_path' | xargs ./node_modules/.bin/prettier --write --ignore-unknown",
9+
"command": "jq -r '.tool_input.file_path' | xargs ./node_modules/.bin/oxfmt --no-error-on-unmatched-pattern",
1010
"timeout": 10
1111
}
1212
]

.claude/skills/add-relevant-docs/SKILL.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ Used on list pages and detail pages inside `<PageHeader>`.
8484
```tsx
8585
import { DocsPopover } from '~/components/DocsPopover'
8686
import { docLinks } from '~/util/links'
87-
8887
;<PageHeader>
8988
<PageTitle icon={<SomeIcon24 />}>Page Title</PageTitle>
9089
<DocsPopover
@@ -107,7 +106,6 @@ import { SideModalFormDocs } from '~/ui/lib/ModalLinks'
107106
import { docLinks } from '~/util/links'
108107

109108
// Inside the form, after form fields:
110-
111109
;<SideModalFormDocs docs={[docLinks.someLink]} />
112110
```
113111

@@ -116,7 +114,6 @@ For custom links not in `docLinks`, use `ModalLinks` and `ModalLink` directly:
116114
```tsx
117115
import { ModalLink, ModalLinks } from '~/ui/lib/ModalLinks'
118116
import { links } from '~/util/links'
119-
120117
;<ModalLinks heading="Relevant docs">
121118
<ModalLink to={links.somePageDocs} label="Human-Readable Label" />
122119
</ModalLinks>

.oxfmtrc.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
3+
"printWidth": 92,
4+
"singleQuote": true,
5+
"semi": false,
6+
"trailingComma": "es5",
7+
"experimentalTailwindcss": {},
8+
"experimentalSortImports": {
9+
"internalPattern": ["~/", "app/"],
10+
"partitionByComment": true,
11+
"customGroups": [{ "groupName": "oxide", "elementNamePattern": ["@oxide/**"] }],
12+
"groups": [
13+
"builtin",
14+
"external",
15+
"oxide",
16+
"internal",
17+
["parent", "sibling", "index"],
18+
"unknown"
19+
]
20+
},
21+
"experimentalSortPackageJson": false,
22+
"ignorePatterns": [
23+
"dist/**",
24+
"coverage/**",
25+
"templates/**",
26+
"mockServiceWorker.js",
27+
"index.html"
28+
]
29+
}

.prettierignore

Lines changed: 0 additions & 7 deletions
This file was deleted.

.prettierrc.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

.vscode/extensions.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
{
2-
"recommendations": [
3-
"oxc.oxc-vscode",
4-
"esbenp.prettier-vscode",
5-
"bradlc.vscode-tailwindcss"
6-
]
2+
"recommendations": ["oxc.oxc-vscode", "bradlc.vscode-tailwindcss"]
73
}

.vscode/settings.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"[jsonc]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
3-
"[json]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
4-
"[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
5-
"[javascriptreact]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
6-
"[typescript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
7-
"[typescriptreact]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
2+
"[jsonc]": { "editor.defaultFormatter": "oxc.oxc-vscode" },
3+
"[json]": { "editor.defaultFormatter": "oxc.oxc-vscode" },
4+
"[javascript]": { "editor.defaultFormatter": "oxc.oxc-vscode" },
5+
"[javascriptreact]": { "editor.defaultFormatter": "oxc.oxc-vscode" },
6+
"[typescript]": { "editor.defaultFormatter": "oxc.oxc-vscode" },
7+
"[typescriptreact]": { "editor.defaultFormatter": "oxc.oxc-vscode" },
88
"typescript.tsdk": "node_modules/typescript/lib",
99
"editor.formatOnSave": true,
1010
"tailwindCSS.experimental.classRegex": ["classed.[a-z]+`([^`]*)`"],
@@ -13,7 +13,7 @@
1313
"explorer.fileNesting.expand": false,
1414
"explorer.fileNesting.patterns": {
1515
".gitignore": ".gitattributes, .gitmodules, .gitmessage, .mailmap, .git-blame*",
16-
"package.json": "package-lock.json, .babelrc, .editorconfig, .figma*, .github*, .huskyrc*, plopfile*, .oxlintrc*, .prettier*, .vscode*, playwright.config.*, prettier*, tsconfig.*, vitest.config.*, yarn*, postcss.config.*, tailwind.config.*, vite.config.ts, mockServiceWorker.js, vercel.json, .licenserc.yaml, LICENSE"
16+
"package.json": "package-lock.json, .babelrc, .editorconfig, .figma*, .github*, .huskyrc*, plopfile*, .oxlintrc*, .oxfmtrc*, .prettier*, .vscode*, playwright.config.*, tsconfig.*, vitest.config.*, yarn*, postcss.config.*, tailwind.config.*, vite.config.ts, mockServiceWorker.js, vercel.json, .licenserc.yaml, LICENSE"
1717
},
1818
"vite.browserType": "system",
1919
"vite.buildCommand": "npm run build",

app/api/__tests__/client.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import { describe, expect, it, vi } from 'vitest'
1212
import { project } from '@oxide/api-mocks'
1313

1414
import { api, q, useApiMutation } from '..'
15-
import type { DiskCreate } from '../__generated__/Api'
1615
import { overrideOnce } from '../../../test/unit/server'
16+
import type { DiskCreate } from '../__generated__/Api'
1717

1818
// TODO: rethink whether these tests need to exist when they are so well-covered
1919
// by playwright tests

app/api/__tests__/safety.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import { execSync } from 'child_process'
99
import fs from 'fs'
1010
import path from 'path'
11+
1112
import { expect, it } from 'vitest'
1213

1314
it('Generated API client version matches API version specified for deployment', () => {

app/api/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
// for convenience so we can do `import type { ApiTypes } from '@oxide/api'`
1010
import type * as ApiTypes from './__generated__/Api'
11-
1211
import './window.ts'
1312

1413
export * from './client'

0 commit comments

Comments
 (0)