Repository navigation
Expand file tree
/
Copy pathoxfmt.config.ts
More file actions
65 lines (64 loc) · 2.03 KB
/
Copy pathoxfmt.config.ts
File metadata and controls
65 lines (64 loc) · 2.03 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
import { ignorePatterns, oxfmtConfig } from '@rhyek/oxc-config/oxfmt';
import { defineConfig } from 'oxfmt';
export default defineConfig({
...oxfmtConfig,
// The shared order, with react first after the builtins.
sortImports: {
...oxfmtConfig.sortImports,
customGroups: [{ groupName: 'react', elementNamePattern: ['react'] }],
groups: [
'builtin',
'react',
'external',
['internal', 'subpath'],
['parent', 'sibling', 'index', 'style'],
'unknown',
],
},
ignorePatterns: [
...ignorePatterns,
// `example/`'s TanStack Start output and generated route tree.
'**/.output/**',
'**/.tanstack/**',
'**/routeTree.gen.ts',
// README, CHANGELOG and the docs are formatted by hand. The docs' `ts` snippets are kept to
// the site's width by maintenance/scripts/format-docs-snippets.ts.
'**/*.md',
],
overrides: [
{
// `example/`'s import order: builtin, react, @tanstack/**, other packages, the workspace's
// own @example/** packages, the app's ~/ alias, then parent, sibling and index imports.
files: ['example/**'],
options: {
sortImports: {
...oxfmtConfig.sortImports,
internalPattern: [],
customGroups: [
{ groupName: 'react', elementNamePattern: ['react', 'react-dom', 'react-dom/**'] },
{ groupName: 'tanstack', elementNamePattern: ['@tanstack/**'] },
{ groupName: 'workspace', elementNamePattern: ['@example/**'] },
{ groupName: 'alias', elementNamePattern: ['~/**'] },
],
groups: [
'builtin',
'react',
'tanstack',
'external',
'workspace',
'alias',
'parent',
'sibling',
'index',
'unknown',
],
},
},
},
{
// shadcn/ui's CLI output, kept as generated so `shadcn diff` stays clean.
files: ['example/apps/frontend/src/components/ui/**'],
options: { sortImports: false },
},
],
});