Releases: AnasJahangir/LintBot
Releases · AnasJahangir/LintBot
LintBot v1.0.0 - Initial Release
We are excited to announce the first release of LintBot!
LintBot is a powerful GitHub App designed to automatically check JavaScript files in pull requests for code quality issues using ESLint. This initial release brings you the following features:
Features:
-
Automatic ESLint Checks: Every pull request triggers an ESLint check on JavaScript files.
-
Detailed Feedback: Provides feedback directly in the pull request comments, highlighting any errors or warnings found by ESLint.
Getting Started
Prerequisites
- Node.js (version 14 or higher)
- GitHub account and a GitHub App setup
- MongoDB (if you choose to store any data)
Installation
- Clone the repository:
git clone https://github.com/AnasJahangir/lintbot.git cd lintbot
- Install dependencies:
npm install
- Create a .env file in the root of the project and add your GitHub App credentials:
GITHUB_APP_ID=your_app_id GITHUB_PRIVATE_KEY=your_private_key PORT=3000
Running the Application
Start the server:
npm start
The server will be listening on the port defined in your environment variables (default is 3000).
How to Set Up GitHub App
- Go to your GitHub account settings and navigate to "Developer settings."
- Click on "GitHub Apps" and then "New GitHub App."
- Fill in the required fields:
- GitHub App Name: LintBot
- Homepage URL: Your application's URL or GitHub repository URL
- Callback URL: http://localhost:3000/webhook (or your deployed URL)
- Webhook URL: http://localhost:3000/webhook
- Set the necessary permissions:
- Repository Permissions: Read and write access for issues and pull requests.
- Generate a private key and add it to your .env file as GITHUB_PRIVATE_KEY.
API Endpoints
Webhook
POST /webhook - This endpoint listens for GitHub webhook events. When a pull request is opened, it triggers the ESLint checks on JavaScript files.
Folder Structure
lintbot/
├── node_modules/
├── .env
├── package.json
├── index.js
└── README.md