Skip to content

Add comprehensive GitHub Copilot instructions for eslint-plugin-primer-react with Node.js v20 support #378

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 7, 2025

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 6, 2025

This PR adds a comprehensive .github/copilot-instructions.md file that provides GitHub Copilot with detailed instructions on how to work effectively in the eslint-plugin-primer-react codebase, updated to reflect the repository's Node.js v20 upgrade.

The instructions cover all essential aspects of working with this ESLint plugin repository:

Key Features

Setup and Bootstrap: Clear instructions for Node.js v20+ setup, dependency installation with npm ci, and confirms no build step is required since this is a direct JavaScript project.

Development Commands: All npm scripts with measured execution times:

  • npm test - 5 seconds (286 tests)
  • npm run lint - 1.5 seconds
  • npm run format:check - 0.5 seconds
  • npm run lint:md - under 1 second

Validation Workflows: Step-by-step instructions for validating changes before committing, including the complete sequence: lint → lint:md → format:check → test.

Manual Rule Testing: Working code examples showing how to test individual ESLint rules using Node.js and ESLint's RuleTester, with proper JSX parsing configuration.

Repository Navigation: Complete directory structure explanation covering src/rules/, src/rules/__tests__/, docs/rules/, src/configs/, and src/utils/.

Common Development Tasks: Detailed workflows for adding new rules and modifying existing ones, including the relationship between rule implementations, tests, and documentation.

Node.js v20 Alignment

All Node.js version references have been updated to reflect the repository's upgrade to v20:

  • Setup instructions specify Node.js v20+ as the current standard
  • Troubleshooting section updated to reference v20+
  • Documentation aligns with the actual .nvmrc (v20) and CI workflows

Validation

All commands and patterns in the instructions have been thoroughly tested and validated:

  • ✅ Dependency installation works as documented
  • ✅ All test and lint commands execute with documented timing
  • ✅ Manual rule testing patterns work correctly
  • ✅ File structure matches documentation
  • ✅ Complete validation workflow executes successfully
  • ✅ Node.js v20 references validated against actual repository configuration

The instructions emphasize that this repository has very fast validation commands (all under 5 seconds except dependency installation), making it efficient for iterative development.

Fixes #377.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copy link

changeset-bot bot commented Aug 6, 2025

⚠️ No Changeset found

Latest commit: a9fbb0f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Copilot Copilot AI changed the title [WIP] ✨Set up Copilot instructions Add comprehensive GitHub Copilot instructions for eslint-plugin-primer-react Aug 6, 2025
Copilot finished work on behalf of joshblack August 6, 2025 20:48
@Copilot Copilot AI requested a review from joshblack August 6, 2025 20:48
@joshblack joshblack marked this pull request as ready for review August 6, 2025 21:07
@Copilot Copilot AI review requested due to automatic review settings August 6, 2025 21:07
@joshblack joshblack requested a review from a team as a code owner August 6, 2025 21:07
@joshblack joshblack enabled auto-merge (squash) August 6, 2025 21:07
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive GitHub Copilot instructions for the eslint-plugin-primer-react repository to help AI assistants work more effectively with the codebase. The instructions provide detailed guidance on setup, development workflows, testing patterns, and repository structure.

Key changes:

  • Added complete development workflow documentation with command execution times
  • Included manual rule testing patterns using Node.js and ESLint's RuleTester
  • Documented repository structure and common development tasks


1. Using manual Node.js rule testing (shown above)
2. Running existing test suite which validates all rules
3. Creating test files and using ESLint RuleTester in the **tests** files
Copy link
Preview

Copilot AI Aug 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The word 'tests' should not be bolded here as it's not a specific directory name. Consider using 'test files' or referencing the actual directory src/rules/__tests__/.

Suggested change
3. Creating test files and using ESLint RuleTester in the **tests** files
3. Creating test files and using ESLint RuleTester in the test files

Copilot uses AI. Check for mistakes.


### Bootstrap and Setup

- Install Node.js v18+ (currently works with v20+):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot I've just updated the repository to Node.js v20 can you update these docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the copilot-instructions.md file to reflect the Node.js v20 upgrade. All references to v18 have been updated to v20 throughout the documentation, including the setup instructions, troubleshooting section, and .nvmrc file reference. The changes have been validated with markdown linting.

auto-merge was automatically disabled August 7, 2025 21:56

Head branch was pushed to by a user without write access

@jonrohan jonrohan enabled auto-merge (squash) August 7, 2025 21:57
@Copilot Copilot AI changed the title Add comprehensive GitHub Copilot instructions for eslint-plugin-primer-react Add comprehensive GitHub Copilot instructions for eslint-plugin-primer-react with Node.js v20 support Aug 7, 2025
@Copilot Copilot AI requested a review from jonrohan August 7, 2025 21:57
Copilot finished work on behalf of jonrohan August 7, 2025 21:57
@jonrohan jonrohan merged commit bc025bb into main Aug 7, 2025
6 of 7 checks passed
@jonrohan jonrohan deleted the copilot/fix-377 branch August 7, 2025 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✨Set up Copilot instructions
3 participants