That may not be the best way to phrase the question, but gives the basic idea.
If everything client-side is malleable, is it even worth it to use a JS library for sanitization?
I've seen DOMPurify recommended a few times recently and have read their security document (though it didn't provide the information I thought it might), and this isn't intended as a criticism of the effort or people behind it, or its quality.
However if you can't trust anything on the user's end, and ultimately need to process on the server anyway, then is it worth even adding another dependency and download?
It might be said that a library like that isn't large (especially compared to the JS and CSS frameworks people are using), and that it also helps protect against less advanced attacks, so adds some benefit without much cost.
But I'm still not sure if it adds enough value to include, as XSS involves targeting other users through the Web (and thus servers) by definition.
What do you think?