Description
To maintain high code quality and formatting consistency across the project, we need to set up automated GitHub Actions for:
Linting: Ensures the code follows best practices and the style guide.
Prettier: Enforces consistent code formatting across the codebase.
Testing: Runs automated tests on each push and pull request.
This setup will ensure that any code merged into the main branch adheres to our code quality standards.
Tasks
Configure ESLint and Prettier in the project:
Add ESLint configuration (.eslintrc.json) with appropriate rules.
Add Prettier configuration (.prettierrc) for code formatting.
Add scripts in package.json for linting and formatting.
Set Up GitHub Action for Linting:
Create a workflow file (.github/workflows/lint.yml) to run ESLint.
Ensure this action runs on each push and pull_request.
Set Up GitHub Action for Prettier:
Create a workflow file (.github/workflows/prettier.yml) to check formatting.
Ensure this action also runs on push and pull_request.
Acceptance Criteria
GitHub Actions workflows for linting, formatting, are set up and running.
All actions trigger on push and pull_request events.
The main branch is protected to ensure only code passing all checks can be merged.
Example Workflow File Structure
Here’s an example of the file structure for the workflows:
Description To maintain high code quality and formatting consistency across the project, we need to set up automated GitHub Actions for:
Linting: Ensures the code follows best practices and the style guide. Prettier: Enforces consistent code formatting across the codebase. Testing: Runs automated tests on each push and pull request. This setup will ensure that any code merged into the main branch adheres to our code quality standards.
Tasks Configure ESLint and Prettier in the project:
Add ESLint configuration (
.eslintrc.json
) with appropriate rules. Add Prettier configuration (.prettierrc
) for code formatting. Add scripts inpackage.json
for linting and formatting.Set Up GitHub Action for Linting:
Create a workflow file
(.github/workflows/lint.yml
) to run ESLint. Ensure this action runs on each push and pull_request.Set Up GitHub Action for Prettier: Create a workflow file (
.github/workflows/prettier.yml
) to check formatting. Ensure this action also runs on push and pull_request.Acceptance Criteria
GitHub Actions workflows for linting, formatting, are set up and running. All actions trigger on push and pull_request events.
The main branch is protected to ensure only code passing all checks can be merged. Example Workflow File Structure
Here’s an example of the file structure for the workflows:
.github/workflows/lint.yml .github/workflows/prettier.yml