There's a setting in the editor, to remove whitespace at the end of a line when saving.