File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33## Unreleased
44
55- Support false positives with TypeScript function overloading (fixes [ #105 ] ( https://github.com/ArnaudBarre/eslint-plugin-react-refresh/issues/105 ) )
6+ - Support nested function calls for extraHOCs (fixes [ #104 ] ( https://github.com/ArnaudBarre/eslint-plugin-react-refresh/issues/104 ) )
67
78## 0.5.0
89
Original file line number Diff line number Diff line change @@ -276,12 +276,17 @@ const valid: {
276276 code : "export default class MyComponent extends Component { render() { return <div>Hello</div>; } }" ,
277277 } ,
278278 {
279- name : "Direct export uppercase function " ,
279+ name : "Function overloading " ,
280280 code : `export function Button(props: PropsWithChildren<{ onClick: () => void }>): ReactNode;
281281export function Button(props: PropsWithChildren): ReactNode {
282282 return <button {...props}>{props.children}</button>;
283283}` ,
284284 } ,
285+ {
286+ name : "Nested function calls for extraHOCs" ,
287+ code : "export const Component = styled('div').attrs({})`display: flex;`" ,
288+ options : { extraHOCs : [ "styled" ] } ,
289+ } ,
285290] ;
286291
287292const invalid : {
Original file line number Diff line number Diff line change @@ -78,10 +78,7 @@ export const onlyExportComponents: TSESLint.RuleModule<
7878 // react-redux: connect(mapStateToProps, mapDispatchToProps)(...);
7979 // TanStack: createRootRoute()({ component: Foo });
8080 // styled-components: styled('div')`display: flex;`; or styled('div')({ display: 'flex' });
81- if (
82- callee . type === "CallExpression"
83- && callee . callee . type === "Identifier"
84- ) {
81+ if ( callee . type === "CallExpression" ) {
8582 return getHocName ( callee ) ;
8683 }
8784 // React.memo(...)
You can’t perform that action at this time.
0 commit comments