Skip to content

Commit 73eeb59

Browse files
chore: Migrate from biome to oxlint (#2156)
1 parent 951543e commit 73eeb59

111 files changed

Lines changed: 412 additions & 499 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,19 @@ jobs:
1616
- uses: actions/checkout@v4
1717
with:
1818
lfs: true
19-
- uses: biomejs/setup-biome@v2
2019
- uses: denoland/setup-deno@v2
2120
with:
22-
deno-version: v2.x # Run with latest stable Deno.
21+
deno-version: v2.4.3
2322

2423
- name: Install pnpm
2524
uses: pnpm/action-setup@v4
2625
with:
2726
run_install: false
2827

29-
- name: Use Node.js 22.x
28+
- name: Use Node.js 24.x
3029
uses: actions/setup-node@v4
3130
with:
32-
node-version: 22.x
31+
node-version: 24.x
3332
cache: 'pnpm'
3433

3534
- name: Install dependencies

.oxlintrc.json

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"plugins": ["eslint", "typescript", "import", "unicorn", "oxc"],
4+
"categories": {
5+
"correctness": "warn",
6+
"suspicious": "warn"
7+
},
8+
"rules": {
9+
"typescript/no-explicit-any": "error",
10+
"typescript/no-non-null-assertion": "error",
11+
"eslint-plugin-unicorn/prefer-add-event-listener": "off",
12+
"eslint-plugin-import/no-named-as-default": "off",
13+
"eslint-plugin-import/no-named-as-default-member": "off",
14+
"eslint-plugin-import/extensions": [
15+
"error",
16+
"always",
17+
{ "ignorePackages": true }
18+
]
19+
},
20+
"ignorePatterns": ["**/*.astro"],
21+
"overrides": [
22+
{
23+
"files": ["**/*.test.ts", "**/tests/**"],
24+
"rules": {
25+
"typescript/no-non-null-assertion": "off",
26+
"eslint/no-unused-vars": "off",
27+
"eslint/no-unused-expressions": "off",
28+
"eslint-plugin-unicorn/consistent-function-scoping": "off",
29+
"eslint/no-unsafe-optional-chaining": "off",
30+
"eslint/no-constant-condition": "off"
31+
}
32+
}
33+
],
34+
"settings": {
35+
"jsx-a11y": {
36+
"polymorphicPropName": null,
37+
"components": {},
38+
"attributes": {}
39+
},
40+
"next": {
41+
"rootDir": []
42+
},
43+
"react": {
44+
"formComponents": [],
45+
"linkComponents": [],
46+
"version": null,
47+
"componentWrapperFunctions": []
48+
},
49+
"jsdoc": {
50+
"ignorePrivate": false,
51+
"ignoreInternal": false,
52+
"ignoreReplacesDocs": true,
53+
"overrideReplacesDocs": true,
54+
"augmentsExtendsReplacesDocs": false,
55+
"implementsReplacesDocs": false,
56+
"exemptDestructuredRootsFromChecks": false,
57+
"tagNamePreference": {}
58+
},
59+
"vitest": {
60+
"typecheck": false
61+
}
62+
},
63+
"env": {
64+
"builtin": true
65+
},
66+
"globals": {}
67+
}

apps/infra-benchmarks/src/discriminated-union.ts

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const bench = new Bench({
1010
name: 'discriminated union',
1111
time: 100,
1212
async setup() {
13-
// biome-ignore lint/suspicious/noExplicitAny: making sure GC has no impact on the results
13+
// oxlint-disable-next-line typescript/no-explicit-any making sure GC has no impact on the results
1414
(globalThis as any).gc();
1515
},
1616
});
@@ -43,23 +43,23 @@ bench
4343
.add(
4444
'string tags',
4545
() => {
46-
let count = 0;
46+
let _count = 0;
4747

4848
for (const obj of stringTaggedObjs) {
4949
if (obj[$internal].type === 'aaa') {
50-
count += 2;
50+
_count += 2;
5151
} else if (obj[$internal].type === 'bbb') {
52-
count += 3;
52+
_count += 3;
5353
} else if (obj[$internal].type === 'ccc') {
54-
count += 4;
54+
_count += 4;
5555
}
5656
}
5757
},
5858
{
5959
beforeEach() {
6060
stringTaggedObjs = Array.from({ length: NUMBER_OF_OBJS }, () => ({
6161
[$internal]: {
62-
// biome-ignore lint/style/noNonNullAssertion: in range
62+
// oxlint-disable-next-line typescript/no-non-null-assertion
6363
type: STRING_TAGS[Math.floor(Math.random() * STRING_TAGS.length)]!,
6464
},
6565
}));
@@ -69,23 +69,23 @@ bench
6969
.add(
7070
'number tags',
7171
async () => {
72-
let count = 0;
72+
let _count = 0;
7373

7474
for (const obj of numberTaggedObjs) {
7575
if (obj[$internal].type === NUMBER_TAG_CATALOG.aaa) {
76-
count += 2;
76+
_count += 2;
7777
} else if (obj[$internal].type === NUMBER_TAG_CATALOG.bbb) {
78-
count += 3;
78+
_count += 3;
7979
} else if (obj[$internal].type === NUMBER_TAG_CATALOG.ccc) {
80-
count += 4;
80+
_count += 4;
8181
}
8282
}
8383
},
8484
{
8585
beforeEach() {
8686
numberTaggedObjs = Array.from({ length: NUMBER_OF_OBJS }, () => ({
8787
[$internal]: {
88-
// biome-ignore lint/style/noNonNullAssertion: in range
88+
// oxlint-disable-next-line typescript/no-non-null-assertion
8989
type: NUMBER_TAGS[Math.floor(Math.random() * NUMBER_TAGS.length)]!,
9090
},
9191
}));
@@ -95,23 +95,23 @@ bench
9595
.add(
9696
'number tags (inlined catalog)',
9797
async () => {
98-
let count = 0;
98+
let _count = 0;
9999

100100
for (const obj of numberTaggedObjs) {
101101
if (obj[$internal].type === 0) {
102-
count += 2;
102+
_count += 2;
103103
} else if (obj[$internal].type === 1) {
104-
count += 3;
104+
_count += 3;
105105
} else if (obj[$internal].type === 2) {
106-
count += 4;
106+
_count += 4;
107107
}
108108
}
109109
},
110110
{
111111
beforeEach() {
112112
numberTaggedObjs = Array.from({ length: NUMBER_OF_OBJS }, () => ({
113113
[$internal]: {
114-
// biome-ignore lint/style/noNonNullAssertion: in range
114+
// oxlint-disable-next-line typescript/no-non-null-assertion
115115
type: NUMBER_TAGS[Math.floor(Math.random() * NUMBER_TAGS.length)]!,
116116
},
117117
}));
@@ -121,23 +121,23 @@ bench
121121
.add(
122122
'symbol tags',
123123
async () => {
124-
let count = 0;
124+
let _count = 0;
125125

126126
for (const obj of symbolTaggedObjs) {
127127
if (obj[$internal].type === aaa) {
128-
count += 2;
128+
_count += 2;
129129
} else if (obj[$internal].type === bbb) {
130-
count += 3;
130+
_count += 3;
131131
} else if (obj[$internal].type === ccc) {
132-
count += 4;
132+
_count += 4;
133133
}
134134
}
135135
},
136136
{
137137
beforeEach() {
138138
symbolTaggedObjs = Array.from({ length: NUMBER_OF_OBJS }, () => ({
139139
[$internal]: {
140-
// biome-ignore lint/style/noNonNullAssertion: in range
140+
// oxlint-disable-next-line typescript/no-non-null-assertion
141141
type: SYMBOL_TAGS[Math.floor(Math.random() * SYMBOL_TAGS.length)]!,
142142
},
143143
}));
@@ -147,15 +147,15 @@ bench
147147
.add(
148148
'symbol keys',
149149
async () => {
150-
let count = 0;
150+
let _count = 0;
151151

152152
for (const obj of symbolKeyedObjs) {
153153
if (obj[aaa]) {
154-
count += 2;
154+
_count += 2;
155155
} else if (obj[bbb]) {
156-
count += 3;
156+
_count += 3;
157157
} else if (obj[ccc]) {
158-
count += 4;
158+
_count += 4;
159159
}
160160
}
161161
},
@@ -165,7 +165,7 @@ bench
165165
{ length: NUMBER_OF_OBJS },
166166
() =>
167167
({
168-
// biome-ignore lint/style/noNonNullAssertion: in range
168+
// oxlint-disable-next-line typescript/no-non-null-assertion
169169
[SYMBOL_TAGS[Math.floor(Math.random() * SYMBOL_TAGS.length)]!]:
170170
true,
171171
}) as { [K in (typeof SYMBOL_TAGS)[number]]: boolean },

apps/treeshake-test/compareResults.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function groupResultsByTest(results: typeof BenchmarkResults.infer) {
1919
if (!grouped[result.testFilename]) {
2020
grouped[result.testFilename] = {};
2121
}
22-
// biome-ignore lint/style/noNonNullAssertion: it's there...
22+
// oxlint-disable-next-line typescript/no-non-null-assertion it's there...
2323
grouped[result.testFilename]![result.bundler] = result.size;
2424
}
2525
return grouped;
@@ -46,9 +46,9 @@ async function generateReport(
4646

4747
// Split tests into static and dynamic
4848
const staticTests = [...allTests].filter((t) => !t.includes('_from_'))
49-
.sort();
49+
.toSorted();
5050
const dynamicTests = [...allTests].filter((t) => t.includes('_from_'))
51-
.sort();
51+
.toSorted();
5252

5353
// Summary statistics
5454
let totalDecreased = 0;
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/** biome-ignore-all lint/correctness/noUnusedImports: it's a test */
21
import tgpu from 'typegpu';
32
import * as d from 'typegpu/data';
43
import * as std from 'typegpu/std';

apps/typegpu-docs/public/coi-serviceworker.js

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,18 @@ if (typeof window === 'undefined') {
106106
value: (reloadToDegrade || coepHasFailed && coi.coepDegrade())
107107
? false
108108
: coi.coepCredentialless(),
109+
// oxlint-disable-next-line unicorn/require-post-message-target-origin
109110
});
110111
if (reloadToDegrade) {
111-
!coi.quiet && console.log('Reloading page to degrade COEP.');
112+
if (!coi.quiet) {
113+
console.log('Reloading page to degrade COEP.');
114+
}
112115
window.sessionStorage.setItem('coiReloadedBySelf', 'coepdegrade');
113116
coi.doReload('coepdegrade');
114117
}
115118

116119
if (coi.shouldDeregister()) {
120+
// oxlint-disable-next-line unicorn/require-post-message-target-origin
117121
n.serviceWorker.controller.postMessage({ type: 'deregister' });
118122
}
119123
}
@@ -123,52 +127,58 @@ if (typeof window === 'undefined') {
123127
if (window.crossOriginIsolated !== false || !coi.shouldRegister()) return;
124128

125129
if (!window.isSecureContext) {
126-
!coi.quiet &&
130+
if (!coi.quiet) {
127131
console.log(
128132
'COOP/COEP Service Worker not registered, a secure context is required.',
129133
);
134+
}
130135
return;
131136
}
132137

133138
// In some environments (e.g. Firefox private mode) this won't be available
134139
if (!n.serviceWorker) {
135-
!coi.quiet &&
140+
if (!coi.quiet) {
136141
console.error(
137142
'COOP/COEP Service Worker not registered, perhaps due to private mode.',
138143
);
144+
}
139145
return;
140146
}
141147

142148
n.serviceWorker.register(window.document.currentScript.src).then(
143149
(registration) => {
144-
!coi.quiet &&
150+
if (!coi.quiet) {
145151
console.log(
146152
'COOP/COEP Service Worker registered',
147153
registration.scope,
148154
);
155+
}
149156

150157
registration.addEventListener('updatefound', () => {
151-
!coi.quiet &&
158+
if (!coi.quiet) {
152159
console.log(
153160
'Reloading page to make use of updated COOP/COEP Service Worker.',
154161
);
162+
}
155163
window.sessionStorage.setItem('coiReloadedBySelf', 'updatefound');
156164
coi.doReload();
157165
});
158166

159167
// If the registration is active, but it's not controlling the page
160168
if (registration.active && !n.serviceWorker.controller) {
161-
!coi.quiet &&
169+
if (!coi.quiet) {
162170
console.log(
163171
'Reloading page to make use of COOP/COEP Service Worker.',
164172
);
173+
}
165174
window.sessionStorage.setItem('coiReloadedBySelf', 'notcontrolling');
166175
coi.doReload();
167176
}
168177
},
169178
(err) => {
170-
!coi.quiet &&
179+
if (!coi.quiet) {
171180
console.error('COOP/COEP Service Worker failed to register:', err);
181+
}
172182
},
173183
);
174184
})();

apps/typegpu-docs/src/components/ExampleView.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ function useExample(
3232
const exampleRef = useRef<ExampleState | null>(null);
3333
const setExampleControlParams = useSetAtom(exampleControlsAtom);
3434

35-
// biome-ignore lint/correctness/useExhaustiveDependencies: reload example on html change
3635
useEffect(() => {
3736
let cancelled = false;
3837
setSnackbarText(undefined);

apps/typegpu-docs/src/components/design/DeleteIcon.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ const DeleteIcon = () => {
1818
const controls = useAnimation();
1919

2020
return (
21-
// biome-ignore lint/a11y/noStaticElementInteractions: This is just an animation
2221
<div
2322
className='flex cursor-pointer select-none items-center justify-center rounded-md p-2 transition-colors duration-200 hover:bg-accent'
2423
onMouseEnter={() => controls.start('animate')}

apps/typegpu-docs/src/components/stackblitz/openInStackBlitz.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@ import typegpuPackageJson from 'typegpu/package.json' with { type: 'json' };
1414
import unpluginPackageJson from 'unplugin-typegpu/package.json' with {
1515
type: 'json',
1616
};
17-
// biome-ignore lint/correctness/useImportExtensions: dude it's there
1817
import pnpmWorkspace from '../../../../../pnpm-workspace.yaml?raw';
1918
import typegpuDocsPackageJson from '../../../package.json' with {
2019
type: 'json',
2120
};
2221
import type { Example, ExampleCommonFile } from '../../utils/examples/types.ts';
23-
// biome-ignore lint/correctness/useImportExtensions: dude it's there
22+
// oxlint-disable-next-line import/default
2423
import index from './stackBlitzIndex.ts?raw';
2524

2625
const pnpmWorkspaceYaml = type({

apps/typegpu-docs/src/components/translator/lib/tgslExecutor.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export async function executeTgslCode(tgslCode: string): Promise<string> {
6262
`Failed to execute TGSL code: ${
6363
error instanceof Error ? error.message : String(error)
6464
}`,
65+
{ cause: error },
6566
);
6667
}
6768
}

0 commit comments

Comments
 (0)