Skip to main content

Formatting in the Remotion repo

The Remotion codebase uses Prettier and ESLint for formatting and requires all code to be formatted correctly before it is merged.

Prettier

In VS Code, you can install the Prettier. Extensions for other editors are available on the Prettier website.

The editor should automatically pick up our .vscode/settings.json file and format your code when you save a file.

To manually format a whole package, run pnpm exec prettier src --write on a package. Example:

bash
cd packages/renderer
pnpm exec prettier src --write
bash
cd packages/renderer
pnpm exec prettier src --write

ESLint

ESLint will warn about code style issues and errors. You can install the ESLint VS Code extension to get warnings in the editor as you write code. Extensions for other editors are available on the ESLint website.

You can also run pnpm run lint in any package to check if there are any errors. Example:

bash
cd packages/renderer
pnpm run lint
bash
cd packages/renderer
pnpm run lint

Testing everything

You can run

bash
pnpm run stylecheck
bash
pnpm run stylecheck

in the root to test locally if the whole repo is well-formatted and will pass the continuous integration checks.