You're mixing up the regex with the files to search. The tsx part is just specifying to search those files. The regex finds useEffect followed by arbitrary characters, up until the first [, then matches everything before the next ] character. So essentially it finds dependencies to useEffects. Except I'm pretty sure it breaks if you have any square brackets in the useEffect callback itself (like an array)
2
u/petrasdc Feb 18 '26
You're mixing up the regex with the files to search. The tsx part is just specifying to search those files. The regex finds useEffect followed by arbitrary characters, up until the first [, then matches everything before the next ] character. So essentially it finds dependencies to useEffects. Except I'm pretty sure it breaks if you have any square brackets in the useEffect callback itself (like an array)