Conversation
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
- Add no-pr-in-user-strings.js rule to detect PR in vscode.l10n.t() calls - Export rule from build/eslint-rules/index.js - Configure rule as error level in .eslintrc.js - Rule uses word boundary regex to detect standalone 'PR' - Successfully detects existing issue in issueFeatureRegistrar.ts The rule correctly identifies 1 existing violation which will need to be fixed in a follow-up commit to demonstrate the rule is working properly.
Replace 'PR' with 'pull request' in @githubpr Summarize command to comply with new ESLint rule Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add lint rule to check for "PR" in user-facing strings
Add ESLint rule to enforce "pull request" over "PR" in user-facing strings
Aug 28, 2025
alexr00
approved these changes
Aug 28, 2025
DonJayamanne
approved these changes
Aug 28, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds a custom ESLint rule
no-pr-in-user-stringsthat detects usage of "PR" in user-facing strings and enforces the use of "pull request" instead for better accessibility and consistency.Implementation
The rule implements the following functionality:
vscode.l10n.t()andl10n.t()calls/\bPR\b/regex to match "PR" as a standalone word, avoiding false positives like "APRICOT"Files Added/Modified
build/eslint-rules/no-pr-in-user-strings.js- The ESLint rule implementationbuild/eslint-rules/index.js- Export the new rule.eslintrc.js- Configure rule as error level for TypeScript filessrc/issues/issueFeatureRegistrar.ts- Fix existing violationExample Usage
The rule catches cases like:
Validation
The rule successfully detected and helped fix 1 existing violation in the codebase:
@githubpr Summarize PR {0}/{1}#{2}@githubpr Summarize pull request {0}/{1}#{2}All existing lint rules continue to work, and both
npm run lintandnpm run hygienepass successfully.Created from VS Code via the GitHub Pull Request extension.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.