Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions .oxfmtrc.json

This file was deleted.

23 changes: 23 additions & 0 deletions oxfmt.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { defineConfig } from 'oxfmt'

export default defineConfig({
semi: false,
singleQuote: true,
trailingComma: 'all',
printWidth: 80,
sortPackageJson: false,
svelte: {},
ignorePatterns: [
'**/.next',
'**/.nx/cache',
'**/.svelte-kit',
'**/build',
'**/coverage',
'**/dist',
'**/query-codemods/**/__testfixtures__',
'.changeset/*.md',
'pnpm-lock.yaml',
'**/tsconfig.vitest-temp.json',
'docs/framework/*/reference',
],
})
12 changes: 2 additions & 10 deletions scripts/generate-labeler-config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as fs from 'node:fs'
import * as path from 'node:path'
import { format } from 'oxfmt'
import oxfmtConfig from '../oxfmt.config.ts'

/** Pairs of package labels and their corresponding paths */
type LabelerPair = [string, string]
Expand Down Expand Up @@ -52,16 +53,7 @@ async function generateLabelerYaml(pairs: Array<LabelerPair>): Promise<string> {
})
.join('\n')

// Read the oxfmt config. `format()` does not discover config files itself.
const oxfmtConfigPath = path.resolve('.oxfmtrc.json')
if (!fs.existsSync(oxfmtConfigPath)) {
throw new Error(
'No oxfmt config file found. Please ensure `.oxfmtrc.json` exists in the project root.',
)
}
console.info('using oxfmt config file at:', oxfmtConfigPath)

const oxfmtConfig = JSON.parse(fs.readFileSync(oxfmtConfigPath, 'utf-8'))
// `format()` does not discover config files itself, so pass the config explicitly.
console.info('using resolved oxfmt config:', oxfmtConfig)

// Format the YAML string using oxfmt
Expand Down
Loading