docs: codify issue template frontmatter policy (#880)#893
Conversation
|
✅ Template check passed after update. Thanks for fixing the PR description. |
|
Warning Review limit reached
More reviews will be available in 38 minutes and 44 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR updates issue template validation and documentation to reflect a new canonical issue type structure. Documentation clarifies the new type count (35), whilst the validation script gains template-to-type mapping and comprehensive YAML frontmatter inspection with a corresponding test. ChangesTemplate type validation and documentation alignment
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request updates documentation to reflect an increase in canonical issue types from 29 to 35, and enhances the check-template-labels.js script to validate template frontmatter, labels, and template-to-type mappings, supported by a new smoke test. The review feedback suggests improving cross-platform compatibility by supporting CRLF line endings in the frontmatter extraction regex, and implementing bidirectional validation on the template map to prevent potential unhandled file-not-found crashes.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| } | ||
|
|
||
| function extractFrontmatter(content) { | ||
| const match = content.match(/^---\n([\s\S]*?)\n---\n?/); |
There was a problem hiding this comment.
The regular expression used to extract frontmatter expects Unix-style line endings (\n). If the repository is checked out on Windows with core.autocrlf enabled, the files will have CRLF (\r\n) line endings, causing this match to fail and return null. This will lead to false validation failures. Updating the regex to support optional carriage returns (\r?) ensures cross-platform compatibility.
| const match = content.match(/^---\n([\s\S]*?)\n---\n?/); | |
| const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/); |
| const missingMappedFiles = templateFiles.filter( | ||
| (file) => !TEMPLATE_TYPE_MAP[file], | ||
| ); | ||
| if (missingMappedFiles.length > 0) { | ||
| console.error("Missing template-to-type mapping entries:"); | ||
| for (const file of missingMappedFiles) console.error(` - ${file}`); | ||
| process.exit(1); | ||
| } |
There was a problem hiding this comment.
The current validation only checks if all existing template files are defined in TEMPLATE_TYPE_MAP. However, it does not verify the reverse: if TEMPLATE_TYPE_MAP contains a file that does not exist in the filesystem, fs.readFileSync on line 293 will throw an unhandled ENOENT error and crash the script. Implementing bidirectional validation ensures the mapping is kept perfectly in sync and prevents unhandled crashes.
const templateFilesSet = new Set(templateFiles);
const missingMappedFiles = templateFiles.filter(
(file) => !TEMPLATE_TYPE_MAP[file],
);
const extraMappedFiles = templateMapEntries
.map(([file]) => file)
.filter((file) => !templateFilesSet.has(file));
if (missingMappedFiles.length > 0 || extraMappedFiles.length > 0) {
if (missingMappedFiles.length > 0) {
console.error("Missing template-to-type mapping entries:");
for (const file of missingMappedFiles) console.error(\` - \${file}\`);
}
if (extraMappedFiles.length > 0) {
console.error("Template-to-type mapping contains non-existent files:");
for (const file of extraMappedFiles) console.error(\` - \${file}\`);
}
process.exit(1);
}There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0df73b60cb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
| } | ||
|
|
||
| const unknownMappedTypes = [...mappedTypes].filter((typeLabel) => !issueTypeLabels.has(typeLabel)); |
There was a problem hiding this comment.
Add a reverse coverage check for canonical types
When a new canonical issue type is added to .github/issue-types.yml without updating TEMPLATE_TYPE_MAP, this validator still passes because it only verifies that mapped types exist in issueTypeLabels; it never checks for issueTypeLabels that are absent from mappedTypes. That leaves the new template-to-type mapping contract unable to catch exactly the drift it is meant to guard against, so future canonical types can be introduced without any broader-template assignment.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (5)
docs/AUTOMATION.md (1)
5-6:⚠️ Potential issue | 🟠 Major | ⚡ Quick winPlease bump
versionandlast_updatedafter this doc edit.The validator is failing because metadata on Line 5 and Line 6 still reflects the previous revision.
✅ Suggested patch
-version: "v1.0.1" -last_updated: "2026-06-01" +version: "v1.0.2" +last_updated: "2026-06-07"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/AUTOMATION.md` around lines 5 - 6, Update the metadata in AUTOMATION.md by bumping the version field and updating the last_updated timestamp: change the "version" value (currently "v1.0.1") to the new release version and set "last_updated" (currently "2026-06-01") to today's date (or the appropriate new date) so the file's metadata matches the current revision.Source: Pipeline failures
.github/custom-instructions.md (1)
6-7:⚠️ Potential issue | 🟠 Major | ⚡ Quick winFrontmatter freshness needs a quick version/date bump to unblock CI.
Tiny gremlin, big blocker: the body changed, but Line 6 (
version) and Line 7 (last_updated) stayed unchanged, so the frontmatter validator fails.✅ Suggested patch
-version: v1.1 -last_updated: '2026-06-05' +version: v1.2 +last_updated: '2026-06-07'🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/custom-instructions.md around lines 6 - 7, Update the frontmatter in .github/custom-instructions.md by incrementing the version value and setting last_updated to today's date; specifically edit the "version" key (currently v1.1) and the "last_updated" key so the frontmatter validator passes (ensure the version string and ISO date format match project conventions).Source: Pipeline failures
docs/ISSUE_CREATION_GUIDE.md (3)
5-7:⚠️ Potential issue | 🟠 Major | ⚡ Quick winFrontmatter freshness is out of date, so validation is red.
Line 5 (
version) and Line 7 (last_updated) need updating because the body changed in this PR.✅ Suggested patch
-version: "1.0.1" -last_updated: '2026-06-03' +version: "1.0.2" +last_updated: '2026-06-07'🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/ISSUE_CREATION_GUIDE.md` around lines 5 - 7, Update the frontmatter fields in ISSUE_CREATION_GUIDE.md to reflect the PR changes: bump the version value (the "version" frontmatter key) to the new semantic version appropriate for this change and set the "last_updated" frontmatter key to today's date (ISO format) so the file metadata matches the body edits in this PR.Source: Pipeline failures
20-20:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winAdd a single H1 so heading structure starts correctly.
This file begins at H2 (
## Overview) and never defines an H1, which hurts document structure and accessibility.As per coding guidelines, “Use one H1 (
#) per file; keep heading levels sequential (never skip from H2 to H4)”.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/ISSUE_CREATION_GUIDE.md` at line 20, This file starts with an H2 "## Overview" but needs a single H1 at the top; add one H1 (for example "# Issue Creation Guide") immediately above the existing "## Overview" heading, ensure no other H1s exist in the file, and keep all subsequent headings sequential (do not change "## Overview" text itself).Source: Coding guidelines
142-160:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winGive this fenced block an explicit language tag.
The code fence is currently untyped (```), so markdown lint/style rules are missed for that block.
As per coding guidelines, “Use fenced code blocks with explicit language tags (
bash,yaml,markdown, etc.)”.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/ISSUE_CREATION_GUIDE.md` around lines 142 - 160, The fenced code block that starts with "**Describe the bug**" is missing a language tag; update the opening fence from ``` to ```markdown (so the block is ```markdown ... ```) to satisfy the lint/style rule for explicit fenced code block language tags and keep the closing ``` unchanged.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/agents/includes/check-template-labels.js`:
- Line 206: The regex in the label normalization call
label.replace(/['"\[\]]/gu, "") triggers ESLint's no-useless-escape for the
escaped "["; update the regex used in
scripts/agents/includes/check-template-labels.js within the map callback (the
label.replace(...) call) to remove the unnecessary backslash before "[" and only
escape the closing bracket, e.g. use /['"[\]]/gu so the character class is valid
and ESLint no-useless-escape is satisfied.
---
Outside diff comments:
In @.github/custom-instructions.md:
- Around line 6-7: Update the frontmatter in .github/custom-instructions.md by
incrementing the version value and setting last_updated to today's date;
specifically edit the "version" key (currently v1.1) and the "last_updated" key
so the frontmatter validator passes (ensure the version string and ISO date
format match project conventions).
In `@docs/AUTOMATION.md`:
- Around line 5-6: Update the metadata in AUTOMATION.md by bumping the version
field and updating the last_updated timestamp: change the "version" value
(currently "v1.0.1") to the new release version and set "last_updated"
(currently "2026-06-01") to today's date (or the appropriate new date) so the
file's metadata matches the current revision.
In `@docs/ISSUE_CREATION_GUIDE.md`:
- Around line 5-7: Update the frontmatter fields in ISSUE_CREATION_GUIDE.md to
reflect the PR changes: bump the version value (the "version" frontmatter key)
to the new semantic version appropriate for this change and set the
"last_updated" frontmatter key to today's date (ISO format) so the file metadata
matches the body edits in this PR.
- Line 20: This file starts with an H2 "## Overview" but needs a single H1 at
the top; add one H1 (for example "# Issue Creation Guide") immediately above the
existing "## Overview" heading, ensure no other H1s exist in the file, and keep
all subsequent headings sequential (do not change "## Overview" text itself).
- Around line 142-160: The fenced code block that starts with "**Describe the
bug**" is missing a language tag; update the opening fence from ``` to
```markdown (so the block is ```markdown ... ```) to satisfy the lint/style rule
for explicit fenced code block language tags and keep the closing ``` unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 3ab88ec9-1249-46a0-a8f2-ef28632b9816
📒 Files selected for processing (5)
.github/custom-instructions.mddocs/AUTOMATION.mddocs/ISSUE_CREATION_GUIDE.mdscripts/agents/includes/__tests__/check-template-labels.test.jsscripts/agents/includes/check-template-labels.js
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: coderabbit-gate
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{php,js,jsx,ts,tsx,css,scss,html}
📄 CodeRabbit inference engine (AGENTS.md)
Follow WordPress Coding Standards (CSS, HTML, JavaScript, PHP) and inline-documentation standards at all times
Files:
scripts/agents/includes/__tests__/check-template-labels.test.jsscripts/agents/includes/check-template-labels.js
**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{js,ts,jsx,tsx}: Follow ESLint/Prettier standards for JavaScript and TypeScript files
Avoid unnecessary JavaScript, defer/lazy-load where possible, and prefer native blocks
Files:
scripts/agents/includes/__tests__/check-template-labels.test.jsscripts/agents/includes/check-template-labels.js
**/*.{js,ts}
⚙️ CodeRabbit configuration file
**/*.{js,ts}: Review JavaScript/TypeScript:
- Ensure code is linted and follows project style guides.
- Check for dead code, unused variables, and clear function naming.
- Validate accessibility and performance optimisations.
- Ensure tests are isolated and do not depend on external state.
- Check for descriptive test names and clear test structure.
Files:
scripts/agents/includes/__tests__/check-template-labels.test.jsscripts/agents/includes/check-template-labels.js
.github/custom-instructions.md
⚙️ CodeRabbit configuration file
.github/custom-instructions.md: Review custom-instructions.md:
- Ensure the file is easy to navigate and up to date with org standards.
- Validate YAML frontmatter for completeness and accuracy.
- Confirm cross-references to prompts.md, agent.md, AGENTS.md, and instruction files.
- Check for up-to-date cross-references and clear documentation of Copilot usage.
Files:
.github/custom-instructions.md
**/*.md
📄 CodeRabbit inference engine (.github/instructions/markdown.instructions.md)
**/*.md: Use one H1 (#) per file; keep heading levels sequential (never skip from H2 to H4)
Use fenced code blocks with explicit language tags (bash,yaml,markdown, etc.)
Keep links relative for in-repo files; verify they resolve before merging
Use1.for ordered lists and-for unordered lists
Keep all wording in UK English (optimise, organisation, colour, behaviour, analyse)
Do not add areferences:frontmatter field — use inline links or a footer section instead
Blank lines before and after headings, code blocks, and block-level elements
Maximum line length: 120 characters (soft limit; prefer wrapping at natural sentence boundaries)
All.mdfiles in this repository should include YAML frontmatter with required fields: file_type, title, description, version, last_updated, owners, tags, status, stability, domain
Every image (![]()) must have descriptive alt text explaining the image's purpose, not its appearance. Empty alt (![ ]()) is valid only for purely decorative images
Link text must describe the destination — never use 'click here', 'read more', or bare URLs as visible text
Every table must have a header row (| Header |). Avoid merged cells
Use headings to communicate document structure, not for visual styling
Do not rely on colour alone to convey information in diagrams or callout blocks
Mermaid diagrams must includeaccTitleandaccDescrattributes for accessibility
Specify language in frontmatter; use plain language, avoid jargon where possible
Files:
docs/ISSUE_CREATION_GUIDE.mddocs/AUTOMATION.md
**/docs/**/*.md
⚙️ CodeRabbit configuration file
**/docs/**/*.md: Review documentation files:
- Ensure markdown is linted and formatted per project style guides.
- Flag illogical folder structures, file naming, or misplaced content.
- Confirm documentation is up to date, accurate, and cross-referenced.
- Ensure accessibility (heading hierarchy, alt text for images, UK English).
Files:
docs/ISSUE_CREATION_GUIDE.mddocs/AUTOMATION.md
🧠 Learnings (5)
📚 Learning: 2026-06-03T17:57:58.761Z
Learnt from: CR
Repo: lightspeedwp/.github PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-03T17:57:58.761Z
Learning: Run `npm ci` to install dependencies, `npm test` to run all tests, `npm run lint:md` to lint Markdown files, `npm run lint:js` to lint JS/TS files, `npm run format` to format files, and `npm run validate:frontmatter` to validate frontmatter
Applied to files:
scripts/agents/includes/__tests__/check-template-labels.test.jsdocs/AUTOMATION.mdscripts/agents/includes/check-template-labels.js
📚 Learning: 2026-06-03T15:59:30.973Z
Learnt from: CR
Repo: lightspeedwp/.github PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-03T15:59:30.973Z
Learning: Use the default PR template at .github/pull_request_template.md and select the most relevant additional template from .github/PULL_REQUEST_TEMPLATE/ for your change type
Applied to files:
.github/custom-instructions.mddocs/ISSUE_CREATION_GUIDE.md
📚 Learning: 2026-06-03T15:59:30.973Z
Learnt from: CR
Repo: lightspeedwp/.github PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-03T15:59:30.973Z
Learning: Ensure core instructions are consolidated and reference the appropriate instruction files in `instructions/{languages,documentation-formats,quality-assurance,automation,community-standards}.instructions.md`
Applied to files:
.github/custom-instructions.md
📚 Learning: 2026-06-03T17:57:58.761Z
Learnt from: CR
Repo: lightspeedwp/.github PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-03T17:57:58.761Z
Learning: All PRs must target `develop` by default, NOT `main`. Only `release/*` and `hotfix/*` branches are allowed to merge to `main`.
Applied to files:
docs/AUTOMATION.md
📚 Learning: 2026-06-03T15:59:30.973Z
Learnt from: CR
Repo: lightspeedwp/.github PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-03T15:59:30.973Z
Learning: Applies to agents/**/*.{js,py,ts} : Each agent must have both a code file (`.js`, `.py`, etc.) and a spec (`.md`) following the template
Applied to files:
docs/AUTOMATION.md
🪛 ESLint
scripts/agents/includes/__tests__/check-template-labels.test.js
[error] 4-4: 'require' is not defined.
(no-undef)
[error] 5-5: 'require' is not defined.
(no-undef)
scripts/agents/includes/check-template-labels.js
[error] 206-206: Unnecessary escape character: [.
(no-useless-escape)
🪛 GitHub Actions: CI / 0_check.txt
scripts/agents/includes/check-template-labels.js
[error] 206-206: ESLint: Unnecessary escape character: [ (no-useless-escape)
🪛 GitHub Actions: CI / check
scripts/agents/includes/check-template-labels.js
[error] 206-206: ESLint: Unnecessary escape character: [ (no-useless-escape).
🪛 GitHub Actions: CI • Unified Checks (Lint, Test, Validate) / 2_Linting.txt
scripts/agents/includes/check-template-labels.js
[error] 206-206: ESLint (no-useless-escape): Unnecessary escape character: [ (step: npm run lint:js / eslint --fix)
🪛 GitHub Actions: CI • Unified Checks (Lint, Test, Validate) / Linting
scripts/agents/includes/check-template-labels.js
[error] 206-206: ESLint: Unnecessary escape character: [ (no-useless-escape)
🪛 GitHub Actions: lint / 0_lint.txt
scripts/agents/includes/check-template-labels.js
[error] 206-206: ESLint error: Unnecessary escape character: [. (no-useless-escape)
🪛 GitHub Actions: lint / lint
scripts/agents/includes/check-template-labels.js
[error] 206-206: ESLint: Unnecessary escape character: [ (no-useless-escape)
🪛 GitHub Actions: Meta Agent / 2_front-matter-validate.txt
.github/custom-instructions.md
[error] 1-1: Frontmatter freshness validation failed: body changed but last_updated was not updated (2026-06-05).
[error] 1-1: Frontmatter freshness validation failed: body changed but version was not updated (v1.1).
docs/ISSUE_CREATION_GUIDE.md
[error] 1-1: Frontmatter freshness validation failed: body changed but last_updated was not updated (2026-06-03).
[error] 1-1: Frontmatter freshness validation failed: body changed but version was not updated (1.0.1).
docs/AUTOMATION.md
[error] 1-1: Frontmatter freshness validation failed: body changed but last_updated was not updated (2026-06-01).
[error] 1-1: Frontmatter freshness validation failed: body changed but version was not updated (v1.0.1).
🪛 GitHub Actions: Meta Agent / front-matter-validate
.github/custom-instructions.md
[error] 1-1: Frontmatter freshness validation failed: body changed but last_updated was not updated (2026-06-05).
[error] 1-1: Frontmatter freshness validation failed: body changed but version was not updated (v1.1).
docs/ISSUE_CREATION_GUIDE.md
[error] 1-1: Frontmatter freshness validation failed: body changed but last_updated was not updated (2026-06-03).
[error] 1-1: Frontmatter freshness validation failed: body changed but version was not updated (1.0.1).
docs/AUTOMATION.md
[error] 1-1: Frontmatter freshness validation failed: body changed but last_updated was not updated (2026-06-01).
[error] 1-1: Frontmatter freshness validation failed: body changed but version was not updated (v1.0.1).
🪛 GitHub Check: check
scripts/agents/includes/check-template-labels.js
[failure] 206-206:
Unnecessary escape character: [
🪛 GitHub Check: lint
scripts/agents/includes/check-template-labels.js
[failure] 206-206:
Unnecessary escape character: [
🪛 GitHub Check: Linting
scripts/agents/includes/check-template-labels.js
[failure] 206-206:
Unnecessary escape character: [
🪛 LanguageTool
.github/custom-instructions.md
[uncategorized] ~62-~62: The official name of this software platform is spelled with a capital “H”.
Context: ...te: - Canonical issue types = 35 (from .github/issue-types.yml). - Numbered templates...
(GITHUB)
🔇 Additional comments (1)
scripts/agents/includes/__tests__/check-template-labels.test.js (1)
1-5: Drop theeslint-env jest, nodesuggestion—ESLint isn’t flaggingrequireinscripts/agents/includes/__tests__/check-template-labels.test.js.
The current lint failure is instead the unrelatedno-useless-escapeerror inscripts/agents/includes/check-template-labels.js(:206:41).> Likely an incorrect or invalid review comment.
| if (typeof labelsValue === "string") { | ||
| return labelsValue | ||
| .split(",") | ||
| .map((label) => label.replace(/['"\[\]]/gu, "").trim()) |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify this specific lint failure is resolved
npm run lint:js -- scripts/agents/includes/check-template-labels.jsRepository: lightspeedwp/.github
Length of output: 6089
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE="scripts/agents/includes/check-template-labels.js"
echo "---- Current snippet around line 206 ----"
nl -ba "$FILE" | sed -n '190,220p'
echo "---- Rerun targeted lint ----"
npm run lint:js -- "$FILE"Repository: lightspeedwp/.github
Length of output: 167
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE="scripts/agents/includes/check-template-labels.js"
echo "---- Current snippet around line 206 (with awk line numbers) ----"
awk 'NR>=190 && NR<=220 {printf "%d:%s\n", NR, $0}' "$FILE"
echo "---- Rerun targeted lint ----"
npm run lint:js -- "$FILE"Repository: lightspeedwp/.github
Length of output: 6881
Fix the no-useless-escape regex at label normalisation (line 206)
Line 206 in scripts/agents/includes/check-template-labels.js still uses label.replace(/['"\[\]]/gu, ""), which keeps failing ESLint with no-useless-escape for the \[.
✅ Suggested patch
- .map((label) => label.replace(/['"\[\]]/gu, "").trim())
+ .map((label) => label.replace(/['"[\]]/gu, "").trim())🧰 Tools
🪛 ESLint
[error] 206-206: Unnecessary escape character: [.
(no-useless-escape)
🪛 GitHub Actions: CI / 0_check.txt
[error] 206-206: ESLint: Unnecessary escape character: [ (no-useless-escape)
🪛 GitHub Actions: CI / check
[error] 206-206: ESLint: Unnecessary escape character: [ (no-useless-escape).
🪛 GitHub Actions: CI • Unified Checks (Lint, Test, Validate) / 2_Linting.txt
[error] 206-206: ESLint (no-useless-escape): Unnecessary escape character: [ (step: npm run lint:js / eslint --fix)
🪛 GitHub Actions: CI • Unified Checks (Lint, Test, Validate) / Linting
[error] 206-206: ESLint: Unnecessary escape character: [ (no-useless-escape)
🪛 GitHub Actions: lint / 0_lint.txt
[error] 206-206: ESLint error: Unnecessary escape character: [. (no-useless-escape)
🪛 GitHub Actions: lint / lint
[error] 206-206: ESLint: Unnecessary escape character: [ (no-useless-escape)
🪛 GitHub Check: check
[failure] 206-206:
Unnecessary escape character: [
🪛 GitHub Check: lint
[failure] 206-206:
Unnecessary escape character: [
🪛 GitHub Check: Linting
[failure] 206-206:
Unnecessary escape character: [
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@scripts/agents/includes/check-template-labels.js` at line 206, The regex in
the label normalization call label.replace(/['"\[\]]/gu, "") triggers ESLint's
no-useless-escape for the escaped "["; update the regex used in
scripts/agents/includes/check-template-labels.js within the map callback (the
label.replace(...) call) to remove the unnecessary backslash before "[" and only
escape the closing bracket, e.g. use /['"[\]]/gu so the character class is valid
and ESLint no-useless-escape is satisfied.
Sources: Linters/SAST tools, Pipeline failures
🔍 Reviewer Summary for PR #893CI Status: ✅ Recommendations
|
13bcfe2 to
4f5bc09
Compare
4181311 to
04b4d5f
Compare
Linked issues
Changelog
Added
Changed
Fixed
Removed
Risk Assessment
How to Test
Prerequisites
npm cicompleted in the checkout.Test Steps
node scripts/agents/includes/check-template-labels.js.npx jest scripts/agents/includes/__tests__/check-template-labels.test.js --runInBand.docs/ISSUE_CREATION_GUIDE.mdand.github/custom-instructions.md.Expected Results
Edge Cases to Verify
Checklist (Global DoD / PR)