John Locke and Jean Jacques Rousseau were both enlightenment era philosophers and writers and there were certain similarities that bound them together. Both were Social Contract Theorists, which meant they used similar methodologies, imagining what human existence would have looked like before people formed governments and civil societies (this is the State of Nature), from which they could discern the fundamental purpose which governments and organized societies form. Also, unlike Hobbes (for whom the State of Nature was defined as a state of cruelty and misery) Locke and Rousseau had a far more positive reading of this primordial human state. Finally, both Locke and Rousseau were strongly opposed to traditional Absolutism.
That being said, there were striking differences between the two. For one, there was their vision of the State of Nature (and its implications). Rousseau was much more utopian than Locke was, to the point where one could view him as anti-enlightenment in certain respects. For Locke, people are understood as rational actors, and he defines the State of Nature largely in terms of freedom. However, for Locke, the State of Nature is also fragile, because without formal governments and societies to provide for law and justice, people in the State of Nature cannot prevent individuals from abusing one another, and there is no recourse for justice. As a result, for Locke, the original Social Contract is understood as a kind of exchange: people sacrifice some of that original freedom to gain security, and to protect those rights that are most quintessential: life, liberty and property. If government becomes tyrannical, and no longer acts to protect those Natural Rights it was founded to safeguard, than it no longer holds any legitimacy, and people have a moral right to overthrow it.
Rousseau, in his Discourse on Inequality, has a different vision of the State of Nature. Where Locke defines primordial humans as rational actors, Rousseau views them as innocent, and fundamentally good. What results is a kind of utopia. This lends radical implications to Rousseau's version of the Social Contract, because for both Hobbes and Locke, the Contract is understood as a kind of progress. We progress out of the State of Nature to create civil societies, but for Rousseau, this is itself an act of corruption. For Rousseau, civil society strips human beings of their own inner goodness, raising up social and economic distinctions which would otherwise not exist. This lends him a radicalism that goes well beyond Locke, and is rare among Enlightenment era thinkers, given how he views the social and economic structures and even the very ideas of culture and civilization as suspect. Among Enlightenment era thinkers, Rousseau has a unique focus on pathos and emotionalism (and sometimes he seems suspicious of human reason altogether), which differentiates him sharply from Locke, and makes him a somewhat problematic figure within the Enlightenment altogether.