LintBot is a GitHub App designed to automatically check JavaScript files in pull requests for code quality issues using ESLint. Whenever a pull request is opened, LintBot retrieves the JavaScript files, runs ESLint checks, and comments on the pull request with any issues found.
- Automatic ESLint Checks: On every pull request, LintBot checks for JavaScript code quality.
- Detailed Feedback: Provides feedback directly in the pull request comments, highlighting any errors or warnings.
- Backend: Node.js, Express
- GitHub API: Octokit
- Linting: ESLint
- Environment Variables: dotenv for managing sensitive information
- Node.js (version 14 or higher)
- GitHub account and a GitHub App setup
- MongoDB (if you choose to store any data)
- 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
Start the server:
npm start
The server will be listening on the port defined in your environment variables (default is 3000).
- 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.
POST /webhook - This endpoint listens for GitHub webhook events. When a pull request is opened, it triggers the ESLint checks on JavaScript files.
lintbot/
├── node_modules/
├── .env
├── package.json
├── index.js
└── README.md
If you would like to contribute to LintBot, please fork the repository and submit a pull request.
This project is licensed under the MIT License.
- Copy the markdown text above and paste it into a
README.md
file in your project repository. - Customize any sections as needed to match your specific implementation or additional features.
Feel free to modify the name and features as per your application’s specifics or any additional functionality you may have!