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:
bashcd packages/rendererpnpm exec prettier src --write
bashcd packages/rendererpnpm 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:
bashcd packages/rendererpnpm run lint
bashcd packages/rendererpnpm run lint
Testing everything
You can run
bashpnpm run stylecheck
bashpnpm run stylecheck
in the root to test locally if the whole repo is well-formatted and will pass the continuous integration checks.