The London Borough of Hounslow granted Essential Living (Brentford) Ltd planning permission for the scheme in May as part of the regeneration of Brentford.
The project involves demolition of an existing Morrison's supermarket and its replacement by a larger 3,500 square metre store, to be operated by Aldi.
The plans include a further 660 square metres of retail space, a cafe and bar, and 221 rented sector apartments in two blocks, varying between six and 10 storeys high.
The council accepted a planning officer's advice that the design quality of the proposal was high and that it would deliver "much-needed housing", including affordable homes.
W. Morrisons Supermarket PLC had been unsuccessful in its quest to become the operator of the new store and launched a judicial review challenge to the planning permission.
Ruling on the matter at the High Court this week, Mr Justice Ouseley noted that the town centre site had been allocated in a local planning policy for "retail-led" development.
Morrison's pointed out that, in terms of floorspace, only 24 per cent of the development would be used for retail purposes, and 76 per cent for residential.
The judge said the officer's report should have stated that the proposals conficted with the allocation policy in that they were residential-led.
The purpose of the policy was to ensure that Brentford's retail functioning was enhanced and that the site was not developed predominantly for housing, the court heard.
However, in dismissing Morrison's challenge, the judge said that, even had the officer not made that error, it was "highly likely" that planning consent would have been granted.
He found that the development achieved the objectives of the site allocation in terms of the size and nature of the proposed retail floor space.
And Morrison's had not objected that there was too much, or too little, retail floor space, or that it should have been configured differently.
The officer, and the council, "would still have concluded lawfully that the proposal accorded with the development plan as a whole," the judge ruled.
And he concluded: "The outcome for Morrison's, without the error, was highly likely still to have been the same."
The other grounds of challenge to the planning put forward by Morrison's were also dismissed.