Skip to content

Commit bc5c668

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

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
@@ -189,7 +189,10 @@ const parsePnpmWorkspaceCatalogs = (rootDirectory: string): CatalogCollection =>
189189
const colonIndex = trimmed.indexOf(":");
190190
if (colonIndex > 0) {
191191
const key = trimmed.slice(0, colonIndex).trim().replace(/["']/g, "");
192-
const value = trimmed.slice(colonIndex + 1).trim().replace(/["']/g, "");
192+
const value = trimmed
193+
.slice(colonIndex + 1)
194+
.trim()
195+
.replace(/["']/g, "");
193196
if (key && value) defaultCatalog[key] = value;
194197
}
195198
continue;
@@ -213,7 +216,10 @@ const parsePnpmWorkspaceCatalogs = (rootDirectory: string): CatalogCollection =>
213216
const colonIndex = trimmed.indexOf(":");
214217
if (colonIndex > 0 && currentCatalogName) {
215218
const key = trimmed.slice(0, colonIndex).trim().replace(/["']/g, "");
216-
const value = trimmed.slice(colonIndex + 1).trim().replace(/["']/g, "");
219+
const value = trimmed
220+
.slice(colonIndex + 1)
221+
.trim()
222+
.replace(/["']/g, "");
217223
if (key && value) namedCatalogs[currentCatalogName][key] = value;
218224
}
219225
}
@@ -284,11 +290,7 @@ const resolveCatalogVersion = (
284290

285291
if (rootDirectory) {
286292
const pnpmCatalogs = parsePnpmWorkspaceCatalogs(rootDirectory);
287-
const pnpmVersion = resolveCatalogVersionFromCollection(
288-
pnpmCatalogs,
289-
packageName,
290-
catalogName,
291-
);
293+
const pnpmVersion = resolveCatalogVersionFromCollection(pnpmCatalogs, packageName, catalogName);
292294
if (pnpmVersion) return pnpmVersion;
293295
}
294296

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)