Changing file EOL with vscode extension API
You can add this line to your user preferences settings (CTRL + ,):
"files.eol": "\n"
On the bottom right of vs code it will say lf or crlf. Click there and it will give an option to change.
The solution is:
editor.edit(builder => {
builder.setEndOfLine(vscode.EndOfLine.LF);
})