This is a feature request to add a simple function that adds a generic .devcontainer/devcontainer.json file to an existing R project or package using a function exported by usethis.
Development inside of a clean working environment is good programming practice and there is no better way to do that then spinning up a new container that is not affected by previous builds, tests runs or old files.
Preferrable that the container image is based off of an image provided by the rocker project. Some of these images includes development environments that spin up a new RStudio session.