Stopping the thief is one thing, but hitting him with a bat , which can be a deadly weapon, is another. In some ways this resembles "spring gun " cases, where someone sets a spring gun rigged to shoot trespassers. It is against public policy. Courts usually if not always find the person who sets the trap crimminally or civilly liabel, even though the victim has committed an offense.