Permission has been granted for almost 100 new homes on a former factory site in Barnsley.