File tree 2 files changed +18
-0
lines changed
packages/eslint-plugin-react-hooks
2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -7765,6 +7765,15 @@ const testsTypescript = {
7765
7765
}
7766
7766
` ,
7767
7767
} ,
7768
+ {
7769
+ code : normalizeIndent `
7770
+ function App(props) {
7771
+ React.useEffect((() => {
7772
+ console.log(props.test);
7773
+ }) as any, [props.test]);
7774
+ }
7775
+ ` ,
7776
+ } ,
7768
7777
] ,
7769
7778
invalid : [
7770
7779
{
Original file line number Diff line number Diff line change @@ -1223,6 +1223,15 @@ export default {
1223
1223
isEffect ,
1224
1224
) ;
1225
1225
return ; // Handled
1226
+ case 'TSAsExpression' :
1227
+ visitFunctionWithDependencies (
1228
+ callback . expression ,
1229
+ declaredDependenciesNode ,
1230
+ reactiveHook ,
1231
+ reactiveHookName ,
1232
+ isEffect ,
1233
+ ) ;
1234
+ return ; // Handled
1226
1235
case 'Identifier' :
1227
1236
if ( ! declaredDependenciesNode ) {
1228
1237
// No deps, no problems.
You can’t perform that action at this time.
0 commit comments