A developer has been given the green light to build 42 new homes.