Skip to content

Commit ea0c690

Browse files
author
Joe Savona
committed
[compiler] Format TS files with prettier
Auto-formatted Options.ts, Program.ts, runner-watch.ts, and runner-worker.ts via yarn prettier-all.
1 parent b81dc57 commit ea0c690

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Options.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77

88
import * as t from '@babel/types';
99
import {z} from 'zod/v4';
10-
import {
11-
CompilerError,
12-
CompilerErrorDetailOptions,
13-
} from '../CompilerError';
10+
import {CompilerError, CompilerErrorDetailOptions} from '../CompilerError';
1411
import {
1512
EnvironmentConfig,
1613
ExternalFunction,
@@ -260,7 +257,11 @@ export type CompileErrorDetail = {
260257
description: string | null;
261258
severity: string;
262259
suggestions: Array<unknown> | null;
263-
details?: Array<{kind: string; loc: t.SourceLocation | null; message: string | null}>;
260+
details?: Array<{
261+
kind: string;
262+
loc: t.SourceLocation | null;
263+
message: string | null;
264+
}>;
264265
loc?: t.SourceLocation | null;
265266
};
266267
export type CompileErrorEvent = {

compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Program.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,7 @@ export function formatDetailForLogging(
189189
suggestions: detail.suggestions ?? null,
190190
details: detail.options.details.map(d => {
191191
if (d.kind === 'error') {
192-
const loc =
193-
d.loc != null && typeof d.loc !== 'symbol' ? d.loc : null;
192+
const loc = d.loc != null && typeof d.loc !== 'symbol' ? d.loc : null;
194193
return {kind: d.kind, loc, message: d.message};
195194
} else {
196195
return {kind: d.kind, loc: null, message: d.message};
@@ -199,9 +198,7 @@ export function formatDetailForLogging(
199198
};
200199
} else {
201200
const loc =
202-
detail.loc != null && typeof detail.loc !== 'symbol'
203-
? detail.loc
204-
: null;
201+
detail.loc != null && typeof detail.loc !== 'symbol' ? detail.loc : null;
205202
return {
206203
category: detail.category,
207204
reason: detail.reason,

compiler/packages/snap/src/runner-watch.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,10 @@ export function buildRust(): boolean {
221221
try {
222222
fs.copyFileSync(sourcePath, destPath);
223223
} catch (e) {
224-
console.error(`Failed to copy native module (${sourcePath} -> ${destPath}):`, e);
224+
console.error(
225+
`Failed to copy native module (${sourcePath} -> ${destPath}):`,
226+
e,
227+
);
225228
return false;
226229
}
227230

compiler/packages/snap/src/runner-worker.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ const originalConsoleError = console.error;
3434
// contains ~1250 files. This assumes that no dependencies have global caches
3535
// that may need to be invalidated across Forget reloads.
3636
const invalidationSubpath = 'packages/babel-plugin-react-compiler/dist';
37-
const rustInvalidationSubpath = 'packages/babel-plugin-react-compiler-rust/dist';
37+
const rustInvalidationSubpath =
38+
'packages/babel-plugin-react-compiler-rust/dist';
3839
let version: number | null = null;
3940
export function clearRequireCache() {
4041
Object.keys(require.cache).forEach(function (path) {

0 commit comments

Comments
 (0)