-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[code-infra] Add copilot instructions specific to x repo #19623
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
JCQuintas
merged 7 commits into
mui:master
from
JCQuintas:add-initial-copilotinstruction
Sep 19, 2025
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7d2c55c
[code-infra] Add copilot instructions specific to x repo
JCQuintas 459af15
Merge branch 'master' into add-initial-copilotinstruction
JCQuintas c9c530c
h1
JCQuintas d6c1398
remove run
JCQuintas b5f5738
Apply suggestion from @JCQuintas
JCQuintas 772bbce
Document Vitest usage for testing
JCQuintas 58ee411
Update .github/copilot-instructions.md
JCQuintas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # Instructions for AI pair programmer | ||
|
|
||
| ## Testing | ||
|
|
||
| We use [Vitest](https://vitest.dev/api/) as our test runner. | ||
|
Check warning on line 5 in .github/copilot-instructions.md
|
||
| There are two main types of test in this repository: unit tests and browser tests. Both use the same files. | ||
|
|
||
| To run tests: | ||
|
|
||
| - `browser tests`: `pnpm test:browser` | ||
| - Browser tests are enabled for any package that has a `vitest.config.browser.mts` in its root | ||
| - `unit tests`: `pnpm test:unit` | ||
| - Unit tests are enabled for any package that has a `vitest.config.jsdom.mts` in its root | ||
|
|
||
| The following options work in both environments: | ||
|
|
||
| - Always use the `--run` flag to skip watch mode. | ||
| - Always use `--project <project-name>` to run tests only for a specific project. The project names are defined by the folder names in the `packages` directory. Additionally you can use `<partial-project-name>*` to run tests for multiple projects that match the partial name. | ||
| - For example: `pnpm test:unit --run --project 'x-charts*'` | ||
| - To test a single file, you can append the file name to the command. | ||
| - For example: `pnpm test:unit --run --project 'x-charts' ChartsSurface.test.tsx` | ||
| - To test a single test, you can use use the `-t` flag followed by a regex that matches the test name. Always add the file name as well to avoid running all tests in the repo. | ||
| - For example: `pnpm test:unit --run --project 'x-charts' -t 'renders the surface' ChartsSurface.test.tsx` | ||
|
|
||
| ### Ensuring a test only runs in a specific environment | ||
|
|
||
| - Use `it.skipIf(isJSDOM)` to skip when running unit tests | ||
| - Use `it.skipIf(!isJSDOM)` to run only in browser mode. | ||
|
|
||
| ## Formatting | ||
|
|
||
| We use multiple formatters and scripts to ensure the code is consistent. Some of these scripts take multiple seconds to run. | ||
|
Check warning on line 32 in .github/copilot-instructions.md
|
||
|
|
||
| To format the code, run: | ||
|
|
||
| - `pnpm prettier:all` should always be run | ||
| - `pnpm eslint` should always be run | ||
| - `pnpm proptypes` should be run when editing React components | ||
| - `pnpm docs:api` should be run when editing React components or TypeScript types/interfaces | ||
| - `pnpm docs:typescript:formatted` should be run when creating or editing the docs examples using typescript | ||
| - `pnpm generate:exports` should always be run when committing code that touches the x-charts family of packages | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.