How can I configure GitHub Copilot to respect my team's specific coding conventions in a monorepo with multiple languages? #198816
-
🏷️ Discussion TypeQuestion 💬 Feature/Topic AreaCopilot in GitHub BodyHow can I configure GitHub Copilot to respect my team's specific coding conventions (like naming patterns and import ordering) in a monorepo with multiple languages? I've tried .github/copilot-instructions.md but it seems inconsistent across TypeScript and Python files. Is there a way to set language-specific instructions or context files? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Hey Single Instructions File with Language Sections Place all rules in Inside # TypeScript Conventions
- PascalCase components
- Absolute imports
# Python Conventions
- PEP 8 compliance
- Ruff/isort for importsFor stricter enforcement, combine with ESLint/Prettier (TS) and Ruff/Black (Python) configs — Copilot reads these and aligns suggestions accordingly. |
Beta Was this translation helpful? Give feedback.
-
|
Hey [sudeep-tech1010] Sub-Folder Instruction Files (Best for Multi-Language Repos) Instead of jamming everything into the root .github folder, break your instructions down by your monorepo's service or package boundaries. You can place localized .copilot-instructions.md (or .github/copilot-instructions.md inside specific workspace roots if using advanced features) right alongside your code : : my-monorepo/ |
Beta Was this translation helpful? Give feedback.
Hey
Instead of sub-folder instruction files (which Copilot doesn't automatically detect), try this:
Single Instructions File with Language Sections
Place all rules in
.github/copilot-instructions.mdat the repo root, organized by language:Inside
copilot-instructions.md:For stricter enforcement, combine with ESLint/Prettier (TS) and Ruff/Black (Python) configs — Copilot reads these an…