Skip to content

Commit b99ec14

Browse files
Copilotpethers
andauthored
fix: clarify eslint-local-rules comment about Literal vs Identifier check
Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
1 parent d3348f3 commit b99ec14

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

eslint-local-rules.cjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,10 @@ module.exports = {
5858
// NOTE: Template literals used as arguments to ID generator functions
5959
// (e.g., WIDGET_IDS.item(`some-${index}`)) are intentionally allowed
6060
// since the widget-scoped ID generators are designed to accept dynamic arguments.
61-
// Only flag template literals where all expressions are static literals
62-
// (e.g. `${"hello"}-suffix`). Template literals with variable references
63-
// (e.g. `${testId}-suffix`) are allowed as they use dynamic IDs.
61+
// Only flag template literals where all interpolated expressions are
62+
// static Literal nodes (e.g. `${"hello"}-suffix`). Template literals
63+
// with Identifier or other non-Literal expressions (e.g. `${testId}-suffix`)
64+
// pass this check and are allowed, since they represent dynamic IDs.
6465
if (
6566
attrValue &&
6667
attrValue.type === 'JSXExpressionContainer' &&

0 commit comments

Comments
 (0)