forked from engineering/crv2
add CONTRIBUTING.md
parent
a5fd953547
commit
880ff7db9f
|
@ -0,0 +1,123 @@
|
|||
# Contributing to LOC's Community Relations Alpha Edition System
|
||||
|
||||
Thank you for considering contributing to this project! Your contributions are highly valued, and we’re excited to collaborate with you.
|
||||
|
||||
This guide outlines the process for contributing code, reporting issues, and adhering to code quality standards using **ESLint** and **Prettier**.
|
||||
|
||||
---
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Getting Started](#getting-started)
|
||||
- [Fork and Clone](#fork-and-clone)
|
||||
- [Install Dependencies](#install-dependencies)
|
||||
- [Code Standards](#code-standards)
|
||||
- [ESLint](#eslint)
|
||||
- [Prettier](#prettier)
|
||||
- [Making Your Changes](#making-your-changes)
|
||||
- [Running Tests](#running-tests)
|
||||
- [Linting and Formatting](#linting-and-formatting)
|
||||
- [Submitting a Pull Request](#submitting-a-pull-request)
|
||||
- [Getting Help](#getting-help)
|
||||
|
||||
---
|
||||
|
||||
## Getting Started
|
||||
### Fork and Clone
|
||||
|
||||
1. **Fork the Repository**: Click the "Fork" button at the top of this repository to create your own fork.
|
||||
|
||||
2. **Clone Your Fork**: Clone the repository to your local environment.
|
||||
|
||||
`git clone https://git.site.com/your-username/project-name.git`
|
||||
|
||||
3. **Navigate to the Project Directory**:
|
||||
|
||||
`cd project-name`
|
||||
|
||||
### Install Dependencies
|
||||
To install all necessary project dependencies, run:
|
||||
`npm install`
|
||||
|
||||
---
|
||||
|
||||
## Code Standards
|
||||
|
||||
### System Requirements
|
||||
|
||||
- Node.js v18 or higher
|
||||
- MongoDB 4.x or higher
|
||||
- Redis
|
||||
|
||||
We use **ESLint** for linting and **Prettier** for consistent code formatting. Please ensure your code follows these standards.
|
||||
|
||||
### ESLint
|
||||
|
||||
ESLint is configured to catch potential errors and enforce coding standards.
|
||||
|
||||
- **Configuration File**: eslint.config.mjs
|
||||
- **Plugins**: Includes @typescript-eslint for TypeScript-specific rules and prettier to ensure Prettier rules are respected.
|
||||
|
||||
### Prettier
|
||||
|
||||
Prettier is used for automatic code formatting to maintain a consistent style across the codebase.
|
||||
|
||||
- **Configuration File**: .prettierrc
|
||||
- **Integration**: Integrated with ESLint, so running eslint will also check for Prettier formatting issues.
|
||||
|
||||
---
|
||||
|
||||
## Making Your Changes
|
||||
|
||||
1. **Create a Branch**: Create a new branch for your work.
|
||||
|
||||
git checkout -b feature/your-feature-name
|
||||
|
||||
2. **Make Your Changes**: Edit files, add features, or fix bugs as needed.
|
||||
|
||||
3. **Run Tests**: Ensure all tests pass.
|
||||
|
||||
*Tests may not be active for the project, please check with Maintainer.*
|
||||
|
||||
`npm test`
|
||||
|
||||
4. **Linting and Formatting**: Run ESLint and Prettier before committing.
|
||||
|
||||
`npm run lint`
|
||||
`npm run format`
|
||||
|
||||
To automatically fix linting issues:
|
||||
`npm run lint:fix`
|
||||
|
||||
### Git Hooks
|
||||
|
||||
We use **Husky** and **lint-staged** to automate linting and formatting checks before each commit. Install these with:
|
||||
|
||||
`npm run prepare`
|
||||
|
||||
This will set up Git hooks to automatically check your code before committing.
|
||||
|
||||
---
|
||||
|
||||
## Submitting a Pull Request
|
||||
|
||||
1. **Push to Your Fork**:
|
||||
|
||||
git push origin feature/your-feature-name
|
||||
|
||||
2. **Open a Pull Request**:
|
||||
- Go to the original repository on Git.
|
||||
- Click on **New Pull Request**.
|
||||
- Select your branch and provide a clear description of your changes.
|
||||
|
||||
3. **Address Feedback**: The project maintainers may review and provide feedback. Please address any requested changes.
|
||||
|
||||
---
|
||||
|
||||
## Getting Help
|
||||
|
||||
If you have questions or need assistance, feel free to reach out by opening an issue. We're here to help!
|
||||
|
||||
This project is managed and maintained by the __Library of Code Department of Engineering__. We can be reached in our [Discord server](https://loc.sh/discord) or via [Email](mailto:engineering@libraryofcode.org).
|
||||
|
||||
Thank you for contributing!
|
Loading…
Reference in New Issue