Remotion 仓库中的格式化
Remotion 代码库使用 Oxfmt 和 ESLint 进行格式化,并且要求所有代码在合并前都必须正确格式化。
🌐 The Remotion codebase uses Oxfmt and ESLint for formatting and requires all code to be formatted correctly before it is merged.
Oxfmt
在 VS Code 中,你可以安装 Oxc 扩展。
🌐 In VS Code, you can install the Oxc extension.
当你保存文件时,编辑器应该自动识别我们的 .vscode/settings.json 文件并格式化你的代码。
🌐 The editor should automatically pick up our .vscode/settings.json file and format your code when you save a file.
要手动格式化整个包,请在包上运行 bunx oxfmt src --write。示例:
🌐 To manually format a whole package, run bunx oxfmt src --write on a package. Example:
cd packages/renderer
bunx oxfmt src --writeESLint
ESLint 会警告代码风格问题和错误。你可以安装 ESLint VS Code 扩展,以便在编写代码时在编辑器中收到警告。其他编辑器的扩展可在 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.
你也可以在任何包中运行 pnpm run lint 来检查是否有错误。例如:
🌐 You can also run pnpm run lint in any package to check if there are any errors. Example:
cd packages/renderer
pnpm run lint测试一切
🌐 Testing everything
你可以运行
🌐 You can run
pnpm run stylecheck在根目录中本地测试整个仓库是否格式正确,并且能够通过持续集成检查。
🌐 in the root to test locally if the whole repo is well-formatted and will pass the continuous integration checks.