Vim removes all trailing whitespace on write.
vim-javascript and syntastic