-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Local Development Experience
This guide covers optional tools and configurations to improve your local development workflow beyond the minimum requirements of Git and Docker.
Pre-commit hooks are scripts that run automatically before you create a commit. They help ensure code quality and consistency by running checks like linters and formatters, preventing errors from being committed to the repository.
Our project's pre-commit configuration and setup instructions are currently documented in our Git Cheat Sheet.
➡️ See Running Pre-commit Locally for setup instructions.
Note: The section in the link above will be migrated here in the future. For now, please refer to it there.
The following instructions help you configure VS Code for an optimal experience with this project.
This setup configures VS Code to automatically format .less
files on save, ensuring consistent styling across the project.
Important: Currently, this project only uses Prettier for
.less
files. This configuration is scoped accordingly to prevent accidentally reformatting other files.
If you haven't already, install the necessary npm packages, including Prettier:
npm install --no-audit
- Open the Extensions view in VS Code (Ctrl+Shift+X or ⌘+Shift+X).
- Search for
Prettier
. - Install the official extension with 58 million installs.
We recommend disabling the extension globally and enabling it only for this workspace. This prevents it from reformatting code in other projects that may not use Prettier.
- In the Extensions view, find the Prettier extension and click the gear icon ⚙️.
- Select Disable to turn it off globally.
- Select Enable (Workspace) to activate it only for this project.
-
Open the workspace settings file. The easiest way is to open the VS Code command palette (Ctrl+Shift+P or ⌘+Shift+P), type
Open Workspace Settings (JSON)
, and press Enter. -
Add the following JSON object to your
.vscode/settings.json
file. If the file already has content, add this as a new top-level key."[less]": { "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.formatOnSave": true }
Now, whenever you save a .less
file in this project, VS Code will automatically format it using Prettier.
Please use this new Wiki. Welcome to the Open Library Handbook! Here you will learn how to...
- Get Set Up
- Understand the Codebase
- Contribute to the Front-end
- Contribute to the Back-end
- Manage your developer environment
- Lookup Common Recipes
- Participate in the Community
Developer Guides
- BookWorm / Affiliate Server
- Developing the My Books & Reading Log
- Developing the Books page
- Understanding the "Read" Button
Other Portals
- Design
- Librarianship
- Communications
- Staff (internal)