Skip to content

Development Tips

Josue Rios edited this page Jan 27, 2021 · 5 revisions

Auto-merging yarn.lock merge conflicts

Solution: npm-merge-driver

  1. cd into your repo
  2. Run the following:
npx npm-merge-driver install \
    --driver-name yarn-merge-driver \
    --driver "npx npm-merge-driver merge %A %O %B %P -c yarn" \
    --files yarn.lock

That's all. The merge driver will automagically fix merge conflicts for the lock file.

Note: You only need to run this once per repo clone.

Recommended VS Code extensions

  • ESLint shows lint issues in your editor.
  • Prettier autoformats your files according to our config. Be sure to set it as your default formatter (at least for the repo folder/workspace).

Cloud Shell: Auto-running VS Code on VM creation

Note: It's preferred you develop on your local machine instead as you may quickly run out of space on Cloud Shell.

Prerequisites: Installation

Run the following to install code-server locally:

curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone

Auto-start code-server

Run the following in your shell to auto-start code-server:

echo "(\
while ! getent passwd | grep $USER; do sleep 1; done; \
sudo -H -u $USER bash -l -c '~/.local/bin/code-server --auth none'\
) & disown" >> .customize_environment

Try restarting your VM (Triple dot menu -> Restart), wait for the VM to boot, then preview port 8080 again and you should see it running!

Note: Some commands in the terminal may not work

Clone this wiki locally