There is a VSCode extension already: REditorSupport.r it uses a LSP and the packages lintr and styler for lint and format