-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathbiome.jsonc
More file actions
167 lines (164 loc) · 6.67 KB
/
Copy pathbiome.jsonc
File metadata and controls
167 lines (164 loc) · 6.67 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
{
"$schema": "https://biomejs.dev/schemas/2.5.5/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"defaultBranch": "main",
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": true,
"includes": [
"**",
"!**/docs",
"!**/unity/**/*/Plugins",
"!**/.node-version",
"!**/node_modules",
"!**/package-lock.json",
"!**/dist",
"!**/coverage",
"!**/build",
"!**/out",
"!**/.docusaurus",
"!**/*.gen.ts",
"!**/mockServiceWorker.js",
"!**/Library",
"!**/Assets",
"!**/manifest.json",
"!**/packages-lock.json",
"!**/models/generated",
// Build output of the three React apps under unity/core/.react, committed
// because the Unity package has to ship them. Each path is the BUILD_PATH
// from the matching app's .env, so anything here is webpack's, not ours.
"!**/unity/core/Editor/Resources/ReactUnity/editor/devtools",
"!**/unity/core/Editor/Resources/ReactUnity/editor/quick-start",
"!**/unity/core/Tests/Runtime/Resources/ReactUnity/tests/injectable",
// Vendored third-party UMD bundles (whatwg-fetch, abortcontroller-polyfill,
// base64.js, queue-microtask). Each keeps its source URL in a header comment
// and is replaced wholesale on update, so reformatting it only adds diff noise.
"!**/unity/core/Resources/ReactUnity/polyfills",
// Vendored @babel/standalone, loaded by the editor test runner. At 3.7 MiB it is
// over Biome's 1 MiB per-file ceiling, and being unable to read a file is an
// error, not a skip -- leaving it in fails `pnpm check` outright.
"!**/unity/core/Editor/Resources/ReactUnity/tests/scripts/babel-standalone.js"
]
},
"assist": { "actions": { "source": { "organizeImports": "on" } } },
"css": {
"formatter": {
"enabled": true
}
},
"javascript": {
"jsxRuntime": "reactClassic",
"formatter": {
"quoteStyle": "single"
}
},
"json": {
"formatter": {
"enabled": true,
"lineWidth": 140,
// Biome 2 special-cases package.json and expands every array onto its own lines,
// regardless of width. "auto" is the general default -- collapse what fits in
// lineWidth -- and it is what the manifests in this repo are already written as,
// so stating it here keeps `keywords`, `files` and `sideEffects` on one line.
"expand": "auto"
}
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 140
},
"linter": {
"enabled": true,
"rules": {
"preset": "recommended",
"complexity": {
"noForEach": "off"
},
"correctness": {
"noChildrenProp": "off",
// ReactUnity's CSS is a subset of CSS plus its own extensions, parsed by
// unity/core/Runtime/Styling rather than a browser. Biome validates against
// the web specs, so it rejects properties and media features that are valid
// here: `sorting-layer`, `state-duration`, `@media (skin: dark)`. None of
// these rules take an allowlist, so they are off rather than suppressed per
// line. The last three joined the recommended set in Biome 2 and reject the
// rest of the dialect the same way: element selectors (`view`, `button`,
// `image` are Unity components, not HTML tags), `:hover`-style states Unity
// defines itself, and `@atlas`/`@font` style at-rules.
"noUnknownProperty": "off",
"noUnknownMediaFeatureName": "off",
"noUnknownTypeSelector": "off",
"noUnknownPseudoClass": "off",
"noUnknownPseudoElement": "off",
// New in Biome 2, and it cannot see the `_Name` convention this repo uses for
// the inner implementation of a component (packages/material/src/*/index.tsx
// exports a wrapped `Accordion` around `_Accordion`). A leading underscore is
// not the uppercase start the rule looks for, so every hook in those files
// reads as "called outside a component". React's own linter accepts them.
"useHookAtTopLevel": "off",
"noUnusedImports": {
"fix": "safe",
"level": "warn"
},
"useExhaustiveDependencies": {
"level": "error",
// useAutoRef is a useRef wrapper (packages/material/src/util/hooks/use-auto-ref.ts):
// it returns a ref whose .current tracks the latest value, precisely so effects can
// read a fresh value without listing it as a dependency. Biome can't see through the
// wrapper, so without this it demands `xRef.current` in the dependency arrays --
// which would defeat the pattern the hook exists to provide.
"options": {
"hooks": [{ "name": "useAutoRef", "stableResult": true }]
}
}
},
"suspicious": {
"noAssignInExpressions": "off",
"noConfusingVoidType": "off",
"noExplicitAny": "off",
"noArrayIndexKey": "off",
// Same reason as the noUnknown* rules above: `@font`, `@atlas` and friends are
// ReactUnity at-rules, not CSS ones.
"noUnknownAtRules": "off"
},
"style": {
"useImportType": "off",
"noParameterAssign": "off",
"noNonNullAssertion": "off"
},
// `"off"` is Biome 2's spelling of the `{ "all": false }` this group carried
// before; `biome migrate` does not translate it, so the rules came back on and
// reported 68 errors. Why the group is off: every JSX file Biome sees here renders
// *Unity* elements, not DOM. `<button>` is a UGUI component with no `type`
// attribute, `<image>` takes no `alt`, and there is no accessibility tree behind a
// Unity canvas for a screen reader to read -- so the web a11y rules ask for props
// that do not exist. The one place in the repo that renders real DOM, the docs
// site, is excluded from Biome entirely (see `files.includes`).
"a11y": "off"
}
},
"overrides": [
{
// These helpers compare values that arrive over the C# interop boundary --
// UIElements StyleKeyword/LengthUnit and Yoga YogaUnit enums, which reach JS as
// boxed objects rather than the numbers they compare against. Loose equality is
// what makes them match, and `isNaN` has to keep coercing for the same reason;
// the file already carries an `eslint-disable eqeqeq` block saying as much.
"includes": ["**/unity/core/.react/devtools/src/common/helpers.ts"],
"linter": {
"rules": {
"suspicious": {
"noDoubleEquals": "off",
"noGlobalIsNan": "off"
}
}
}
}
]
}