Skip to content

Commit

Permalink
fix: Prioritize variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
GunseiKPaseri committed Oct 29, 2024
1 parent 1aabcda commit bac6c02
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -320,19 +320,17 @@ fn is_hooked_component(f: &JsCallExpression) -> Option<bool> {

/// Check if the exported item is a React component
fn is_exported_react_component(any_exported_item: &ExportedItem) -> bool {
if let Some(AnyJsExported::AnyJsExpression(AnyJsExpression::JsCallExpression(f))) =
if let Some(exported_item_id) = any_exported_item.identifier.clone() {
Case::identify(&exported_item_id.text(), false) == Case::Pascal
&& match any_exported_item.exported.clone() {
Some(exported) => !matches!(exported, AnyJsExported::TsEnumDeclaration(_)),
None => true,
}
} else if let Some(AnyJsExported::AnyJsExpression(AnyJsExpression::JsCallExpression(f))) =
any_exported_item.exported.clone()
{
if is_hooked_component(&f).unwrap_or(false) {
return true;
}
is_hooked_component(&f).unwrap_or(false)
} else {
false
}
let Some(exported_item_id) = any_exported_item.identifier.clone() else {
return false;
};
Case::identify(&exported_item_id.text(), false) == Case::Pascal
&& match any_exported_item.exported.clone() {
Some(exported) => !matches!(exported, AnyJsExported::TsEnumDeclaration(_)),
None => true,
}
}

This file was deleted.

This file was deleted.

0 comments on commit bac6c02

Please sign in to comment.