Repository navigation
Expand file tree
/
Copy pathoxfmt.config.ts
More file actions
96 lines (89 loc) · 2.71 KB
/
Copy pathoxfmt.config.ts
File metadata and controls
96 lines (89 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
import { defineConfig } from "oxfmt";
export default defineConfig({
// Indentation and line length
useTabs: false,
tabWidth: 2,
printWidth: 80,
endOfLine: "lf",
// Quotes
singleQuote: false,
jsxSingleQuote: false,
quoteProps: "as-needed",
// Syntax
semi: true,
trailingComma: "all",
arrowParens: "always",
// Brackets and attributes
bracketSpacing: true,
bracketSameLine: false,
singleAttributePerLine: false,
// Sorting
sortImports: {
newlinesBetween: true,
internalPattern: ["@local/", "@hashintel/", "@blockprotocol/", "@apps/"],
groups: [
"value-builtin",
"value-external",
"value-internal",
["value-parent", "value-sibling", "value-index"],
[
"type-import",
"type-internal",
"type-parent",
"type-sibling",
"type-index",
],
"unknown",
],
},
sortTailwindcss: true,
sortPackageJson: {
sortScripts: true,
},
// Per-language overrides
overrides: [
{
files: ["**/*.json", "**/*.jsonc"],
options: {
trailingComma: "none",
},
},
{
// These pages teach the Cargo.toml layout that tombi produces. oxfmt
// formats ```toml fences with its own TOML style, and it can neither
// switch off one fence language nor hand a fence to tombi, so the
// fences in these pages are left as written.
files: [".agents/skills/managing-cargo-dependencies/**/*.md"],
options: {
embeddedLanguageFormatting: "off",
},
},
],
ignorePatterns: [
// License files have intentional formatting that shouldn't be touched
"**/LICENSE*.md",
// Component docs pages pass canonical example code to Stage as
// template-literal `code` attributes, whose contents the MDX printer
// re-indents — keep these hand-formatted.
"libs/@hashintel/ds-components/**/*.docs.mdx",
// Brunch Markdown is created and maintained by agents
"libs/@hashintel/brunch-agent/**/*.md",
"apps/brunch-agent/evals/**/*.md",
// While supported, it doesn't yet support the full breadth
// of tombi configuration options that we have set
// see: https://github.com/oxc-project/oxc/issues/18580
"**/*.toml",
// Autogenerated files
// `mise lock` writes these and records their digests in `mise.lock`
".config/mise/locks/**",
"**/*.snap.*",
"apps/petrinaut-website/src/examples/generated/**/*.json",
"apps/petrinaut-website/src/routeTree.gen.ts",
"**/openapi.json",
"**/*.aux.mir",
"**/docs/task-dependencies.json",
// Parser test inputs: the snapshots record their exact lines and columns, and some are
// invalid YAML on purpose
"libs/@local/integrations/definition/tests/ui/**",
],
});