-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Contributing Guidelines
Welcome to the Code Style and Contribution Guidelines for LobeChat. This guide will help you understand our code standards and contribution process, ensuring code consistency and smooth project progression.
In LobeChat, we use the @lobehub/lint
package to maintain a unified code style. This package incorporates configurations for ESLint
, Prettier
, remarklint
, and stylelint
to ensure that our JavaScript, Markdown, and CSS files adhere to the same coding standards.
We use ESLint to check for issues in our JavaScript code. You can find the .eslintrc.js
file in the project's root directory, which contains our extensions and custom rules for the ESLint configuration of @lobehub/lint
.
To ensure your code aligns with the project's standards, run ESLint before committing your code.
Prettier is responsible for code formatting to maintain consistency. Our Prettier configuration can be found in .prettierrc.js
, imported from @lobehub/lint
.
It's recommended to configure your editor to run Prettier automatically upon saving files or manually run it before committing.
For Markdown files, we use remarklint to ensure consistent document formatting. You can find the corresponding configuration file in the project.
We utilize stylelint to standardize the style of our CSS code. In the configuration file for stylelint, we have made some custom rule adjustments based on @lobehub/lint
configuration.
Ensure that your style code passes stylelint checks before committing.
LobeChat follows the gitmoji and semantic release as our code submission and release process.
When committing code, please use gitmoji to label your commit messages. This helps other contributors quickly understand the content and purpose of your submission.
Gitmoji commit messages use specific emojis to represent the type or intent of the commit. Here's an example:
📝 Update README with contribution guidelines
- Added section about code style preferences
- Included instructions for running tests
- Corrected typos and improved formatting
In this example, the 📝 emoji represents a documentation update. The commit message clearly describes the changes and provides specific details.
We use semantic release to automate version control and release processes. Ensure that your commit messages adhere to the semantic release specifications so that when the code is merged into the main branch, the system can automatically create a new version and release it.
To ensure consistency in commit messages, we use commitlint
to check the format of commit messages. You can find the relevant rules in the .commitlintrc.js
configuration file.
Before committing your code, ensure that your commit messages adhere to our standards.
- Fork the project to your account.
- Create a new branch for development.
- After completing the development, ensure that your code passes the aforementioned code style checks.
- Commit your changes and use appropriate gitmoji to label your commit message.
- Create a Pull Request to the main branch of the original project.
- Await code review and make necessary modifications based on feedback.
Thank you for following these guidelines, as they help us maintain the quality and consistency of the project. We look forward to your contributions!
This is the 🤯 / 🤖 Lobe Chat wiki. Wiki Home
- Architecture Design | 架构设计
- Code Style and Contribution Guidelines | 代码风格与贡献指南
- Complete Guide to LobeChat Feature Development | LobeChat 功能开发完全指南
- Conversation API Implementation Logic | 会话 API 实现逻辑
- Directory Structure | 目录架构
- Environment Setup Guide | 环境设置指南
- How to Develop a New Feature | 如何开发一个新功能:前端实现
- New Authentication Provider Guide | 新身份验证方式开发指南
- Resources and References | 资源与参考
- Technical Development Getting Started Guide | 技术开发上手指南
- Testing Guide | 测试指南