diff --git a/packages/react-docgen/src/utils/parseJsDoc.ts b/packages/react-docgen/src/utils/parseJsDoc.ts index 370df5c9fea..62174e51927 100644 --- a/packages/react-docgen/src/utils/parseJsDoc.ts +++ b/packages/react-docgen/src/utils/parseJsDoc.ts @@ -68,10 +68,10 @@ function getType(tagType: Type | null | undefined): JsDocType | null { 'name' in tagType && tagType.name ? tagType.name : 'expression' in tagType && - tagType.expression && - 'name' in tagType.expression - ? tagType.expression.name - : null; + tagType.expression && + 'name' in tagType.expression + ? tagType.expression.name + : null; if (typeName) { return { name: typeName }; diff --git a/packages/react-docgen/src/utils/resolveObjectKeysToArray.ts b/packages/react-docgen/src/utils/resolveObjectKeysToArray.ts index 87ffce00011..b6e0fc03a29 100644 --- a/packages/react-docgen/src/utils/resolveObjectKeysToArray.ts +++ b/packages/react-docgen/src/utils/resolveObjectKeysToArray.ts @@ -90,8 +90,8 @@ export function resolveObjectToNameArray( const name: string = key.isIdentifier() ? key.node.name : raw - ? (key.node.extra?.raw as string) - : `${key.node.value}`; + ? (key.node.extra?.raw as string) + : `${key.node.value}`; values.push(name); } else if ( diff --git a/packages/react-docgen/src/utils/resolveObjectValuesToArray.ts b/packages/react-docgen/src/utils/resolveObjectValuesToArray.ts index fbc385a68da..0838abc15ad 100644 --- a/packages/react-docgen/src/utils/resolveObjectValuesToArray.ts +++ b/packages/react-docgen/src/utils/resolveObjectValuesToArray.ts @@ -56,9 +56,9 @@ function resolveObjectToPropMap(object: NodePath): Map | null { const value = valuePath.isStringLiteral() ? `"${valuePath.node.value}"` : valuePath.isNumericLiteral() - ? `${valuePath.node.value}` - : // we return null here because there are a lot of cases and we don't know yet what we need to handle - 'null'; + ? `${valuePath.node.value}` + : // we return null here because there are a lot of cases and we don't know yet what we need to handle + 'null'; values.set(name, value); } else if (propPath.isSpreadElement()) {