Skip to content

Commit 1d22551

Browse files
style: apply oxfmt formatting
Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
1 parent 94dcdfc commit 1d22551

File tree

5 files changed

+18
-13
lines changed

5 files changed

+18
-13
lines changed

packages/react-doctor/src/plugin/rules/nextjs.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ export const nextjsMissingMetadata: Rule = {
184184
const describeClientSideNavigation = (node: EsTreeNode): string | null => {
185185
if (node.type === "CallExpression" && node.callee?.type === "MemberExpression") {
186186
const objectName = node.callee.object?.type === "Identifier" ? node.callee.object.name : null;
187-
const methodName = node.callee.property?.type === "Identifier" ? node.callee.property.name : null;
187+
const methodName =
188+
node.callee.property?.type === "Identifier" ? node.callee.property.name : null;
188189
if (objectName === "router" && (methodName === "push" || methodName === "replace")) {
189190
return `router.${methodName}() in useEffect — use redirect() from next/navigation or handle navigation in an event handler`;
190191
}

packages/react-doctor/src/plugin/rules/react-native.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ const getRawTextDescription = (child: EsTreeNode): string => {
5656

5757
const isTextHandlingComponent = (elementName: string): boolean => {
5858
if (REACT_NATIVE_TEXT_COMPONENTS.has(elementName)) return true;
59-
return [...REACT_NATIVE_TEXT_COMPONENT_SUFFIXES].some((suffix) =>
60-
elementName.endsWith(suffix),
61-
);
59+
return [...REACT_NATIVE_TEXT_COMPONENT_SUFFIXES].some((suffix) => elementName.endsWith(suffix));
6260
};
6361

6462
export const rnNoRawText: Rule = {

packages/react-doctor/src/utils/discover-project.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,10 @@ const parsePnpmWorkspaceCatalogs = (rootDirectory: string): CatalogCollection =>
187187
const colonIndex = trimmed.indexOf(":");
188188
if (colonIndex > 0) {
189189
const key = trimmed.slice(0, colonIndex).trim().replace(/["']/g, "");
190-
const value = trimmed.slice(colonIndex + 1).trim().replace(/["']/g, "");
190+
const value = trimmed
191+
.slice(colonIndex + 1)
192+
.trim()
193+
.replace(/["']/g, "");
191194
if (key && value) defaultCatalog[key] = value;
192195
}
193196
continue;
@@ -211,7 +214,10 @@ const parsePnpmWorkspaceCatalogs = (rootDirectory: string): CatalogCollection =>
211214
const colonIndex = trimmed.indexOf(":");
212215
if (colonIndex > 0 && currentCatalogName) {
213216
const key = trimmed.slice(0, colonIndex).trim().replace(/["']/g, "");
214-
const value = trimmed.slice(colonIndex + 1).trim().replace(/["']/g, "");
217+
const value = trimmed
218+
.slice(colonIndex + 1)
219+
.trim()
220+
.replace(/["']/g, "");
215221
if (key && value) namedCatalogs[currentCatalogName][key] = value;
216222
}
217223
}
@@ -282,11 +288,7 @@ const resolveCatalogVersion = (
282288

283289
if (rootDirectory) {
284290
const pnpmCatalogs = parsePnpmWorkspaceCatalogs(rootDirectory);
285-
const pnpmVersion = resolveCatalogVersionFromCollection(
286-
pnpmCatalogs,
287-
packageName,
288-
catalogName,
289-
);
291+
const pnpmVersion = resolveCatalogVersionFromCollection(pnpmCatalogs, packageName, catalogName);
290292
if (pnpmVersion) return pnpmVersion;
291293
}
292294

packages/react-doctor/tests/fixtures/bun-catalog-workspace/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
"name": "bun-catalog-workspace",
33
"private": true,
44
"workspaces": {
5-
"packages": ["apps/*"],
5+
"packages": [
6+
"apps/*"
7+
],
68
"catalog": {
79
"react": "^19.1.4",
810
"react-dom": "^19.1.4"

packages/react-doctor/tests/fixtures/monorepo-with-root-react/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
22
"name": "monorepo-root",
33
"private": true,
4-
"workspaces": ["packages/*"],
4+
"workspaces": [
5+
"packages/*"
6+
],
57
"dependencies": {
68
"react": "^19.0.0",
79
"react-dom": "^19.0.0"

0 commit comments

Comments
 (0)