Code Contributions
Thank you for your interest in contributing to Beaver Notes! We are thrilled to have you on board 💖
Prerequisites
Before contributing to the project, make sure you have the necessary tools installed:
- Node.js: Version 22 or later
- Yarn:
npm install -g yarn
Once you have these, you can verify the versions using:
node -v
yarn -v
Getting Started
1. Fork the Repository
Click the Fork button at the top right of the repo and clone it to your machine:
git clone https://github.com/your-username/Beaver-Notes.git
cd Beaver-Notes
2. Install Dependencies
Ensure you have Yarn installed, then install dependencies:
yarn install
3. Run the Project in Development Mode
yarn watch
4. Create a New Branch
Use a descriptive name for your branch:
git checkout -b feature/add-dark-mode
Code Style & Quality
Linting
To maintain code quality, we use Prettier for code formatting. Prettier will automatically format your code based on the .prettierrc
configuration file.
You can run Prettier manually by executing:
yarn prettier --write .
We also use ESLint for static code analysis. This helps identify and fix code quality and style issues.
Run the linter:
yarn lint
Auto-fix lint issues:
yarn lint --fix
Pre-commit Hooks (Husky and Lint-Staged)
We use Husky and Lint-Staged to ensure that code formatting and linting happen before committing changes.
Before you make a commit, the following will happen automatically:
- Prettier will format the code.
- ESLint will check for issues and fix them if possible.
When attempting to commit, Husky will invoke the lint-staged script, which runs the following linting tasks:
"lint-staged": {
"*.{js,ts,vue}": "eslint --cache --fix"
}
Commit and Push Changes
After making changes, commit and push them to the repository. Here’s a typical workflow:
- Stage your changes:
git add .
- Commit the changes:
git commit -m "Your commit message"
Husky will run Prettier and ESLint checks before committing.
- Push the changes:
git push origin branch-name
Submitting a Pull Request
Before opening a PR:
- Keep code consistent with project style.
- Run Prettier and ESLint.
Open your PR against the development branch, with a clear description and completed checklist, it helps us review and merge faster 🚀.