@salesforce-ux/eslint-plugin-slds 0.5.3 → 1.0.0-internal-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/build/index.js +2309 -50
  2. package/build/index.js.map +4 -4
  3. package/build/rules/enforce-bem-usage.js +325 -85
  4. package/build/rules/enforce-bem-usage.js.map +4 -4
  5. package/build/rules/modal-close-button-issue.js +324 -179
  6. package/build/rules/modal-close-button-issue.js.map +4 -4
  7. package/build/rules/no-deprecated-classes-slds2.js +247 -53
  8. package/build/rules/no-deprecated-classes-slds2.js.map +4 -4
  9. package/build/rules/v9/enforce-bem-usage.js +236 -0
  10. package/build/rules/v9/enforce-bem-usage.js.map +7 -0
  11. package/build/rules/v9/enforce-component-hook-naming-convention.js +262 -0
  12. package/build/rules/v9/enforce-component-hook-naming-convention.js.map +7 -0
  13. package/build/rules/v9/enforce-sds-to-slds-hooks.js +260 -0
  14. package/build/rules/v9/enforce-sds-to-slds-hooks.js.map +7 -0
  15. package/build/rules/v9/lwc-token-to-slds-hook.js +330 -0
  16. package/build/rules/v9/lwc-token-to-slds-hook.js.map +7 -0
  17. package/build/rules/v9/no-deprecated-slds-classes.js +227 -0
  18. package/build/rules/v9/no-deprecated-slds-classes.js.map +7 -0
  19. package/build/rules/v9/no-deprecated-tokens-slds1.js +270 -0
  20. package/build/rules/v9/no-deprecated-tokens-slds1.js.map +7 -0
  21. package/build/rules/v9/no-hardcoded-values/handlers/boxShadowHandler.js +339 -0
  22. package/build/rules/v9/no-hardcoded-values/handlers/boxShadowHandler.js.map +7 -0
  23. package/build/rules/v9/no-hardcoded-values/handlers/colorHandler.js +348 -0
  24. package/build/rules/v9/no-hardcoded-values/handlers/colorHandler.js.map +7 -0
  25. package/build/rules/v9/no-hardcoded-values/handlers/densityHandler.js +344 -0
  26. package/build/rules/v9/no-hardcoded-values/handlers/densityHandler.js.map +7 -0
  27. package/build/rules/v9/no-hardcoded-values/handlers/fontHandler.js +388 -0
  28. package/build/rules/v9/no-hardcoded-values/handlers/fontHandler.js.map +7 -0
  29. package/build/rules/v9/no-hardcoded-values/handlers/index.js +834 -0
  30. package/build/rules/v9/no-hardcoded-values/handlers/index.js.map +7 -0
  31. package/build/rules/v9/no-hardcoded-values/no-hardcoded-values-slds1.js +1112 -0
  32. package/build/rules/v9/no-hardcoded-values/no-hardcoded-values-slds1.js.map +7 -0
  33. package/build/rules/v9/no-hardcoded-values/no-hardcoded-values-slds2.js +1112 -0
  34. package/build/rules/v9/no-hardcoded-values/no-hardcoded-values-slds2.js.map +7 -0
  35. package/build/rules/v9/no-hardcoded-values/noHardcodedValueRule.js +945 -0
  36. package/build/rules/v9/no-hardcoded-values/noHardcodedValueRule.js.map +7 -0
  37. package/build/rules/v9/no-slds-class-overrides.js +233 -0
  38. package/build/rules/v9/no-slds-class-overrides.js.map +7 -0
  39. package/build/rules/v9/no-slds-namespace-for-custom-hooks.js +250 -0
  40. package/build/rules/v9/no-slds-namespace-for-custom-hooks.js.map +7 -0
  41. package/build/rules/v9/no-slds-private-var.js +230 -0
  42. package/build/rules/v9/no-slds-private-var.js.map +7 -0
  43. package/build/rules/v9/no-slds-var-without-fallback.js +253 -0
  44. package/build/rules/v9/no-slds-var-without-fallback.js.map +7 -0
  45. package/build/rules/v9/no-sldshook-fallback-for-lwctoken.js +253 -0
  46. package/build/rules/v9/no-sldshook-fallback-for-lwctoken.js.map +7 -0
  47. package/build/rules/v9/no-unsupported-hooks-slds2.js +243 -0
  48. package/build/rules/v9/no-unsupported-hooks-slds2.js.map +7 -0
  49. package/build/rules/v9/reduce-annotations.js +234 -0
  50. package/build/rules/v9/reduce-annotations.js.map +7 -0
  51. package/build/src/rules/enforce-bem-usage.d.ts +17 -0
  52. package/build/{rules → src/rules}/modal-close-button-issue.d.ts +2 -1
  53. package/build/{rules → src/rules}/no-deprecated-classes-slds2.d.ts +2 -1
  54. package/build/src/rules/v9/enforce-bem-usage.d.ts +3 -0
  55. package/build/src/rules/v9/enforce-component-hook-naming-convention.d.ts +3 -0
  56. package/build/src/rules/v9/enforce-sds-to-slds-hooks.d.ts +3 -0
  57. package/build/src/rules/v9/lwc-token-to-slds-hook.d.ts +3 -0
  58. package/build/src/rules/v9/no-deprecated-slds-classes.d.ts +3 -0
  59. package/build/src/rules/v9/no-deprecated-tokens-slds1.d.ts +3 -0
  60. package/build/src/rules/v9/no-hardcoded-values/handlers/boxShadowHandler.d.ts +5 -0
  61. package/build/src/rules/v9/no-hardcoded-values/handlers/colorHandler.d.ts +7 -0
  62. package/build/src/rules/v9/no-hardcoded-values/handlers/densityHandler.d.ts +7 -0
  63. package/build/src/rules/v9/no-hardcoded-values/handlers/fontHandler.d.ts +6 -0
  64. package/build/src/rules/v9/no-hardcoded-values/handlers/index.d.ts +8 -0
  65. package/build/src/rules/v9/no-hardcoded-values/no-hardcoded-values-slds1.d.ts +3 -0
  66. package/build/src/rules/v9/no-hardcoded-values/no-hardcoded-values-slds2.d.ts +3 -0
  67. package/build/src/rules/v9/no-hardcoded-values/noHardcodedValueRule.d.ts +9 -0
  68. package/build/src/rules/v9/no-slds-class-overrides.d.ts +8 -0
  69. package/build/src/rules/v9/no-slds-namespace-for-custom-hooks.d.ts +3 -0
  70. package/build/src/rules/v9/no-slds-private-var.d.ts +3 -0
  71. package/build/src/rules/v9/no-slds-var-without-fallback.d.ts +3 -0
  72. package/build/src/rules/v9/no-sldshook-fallback-for-lwctoken.d.ts +3 -0
  73. package/build/src/rules/v9/no-unsupported-hooks-slds2.d.ts +3 -0
  74. package/build/src/rules/v9/reduce-annotations.d.ts +3 -0
  75. package/build/src/types/index.d.ts +26 -0
  76. package/build/src/utils/boxShadowValueParser.d.ts +17 -0
  77. package/build/src/utils/color-lib-utils.d.ts +18 -0
  78. package/build/src/utils/css-functions.d.ts +7 -0
  79. package/build/src/utils/css-utils.d.ts +7 -0
  80. package/build/src/utils/hardcoded-shared-utils.d.ts +60 -0
  81. package/build/src/utils/property-matcher.d.ts +23 -0
  82. package/build/src/utils/styling-hook-utils.d.ts +7 -0
  83. package/build/src/utils/value-utils.d.ts +40 -0
  84. package/build/types/index.js +18 -0
  85. package/build/types/index.js.map +7 -0
  86. package/build/types/yaml.d.js +1 -0
  87. package/build/types/yaml.d.js.map +7 -0
  88. package/build/utils/boxShadowValueParser.js +197 -0
  89. package/build/utils/boxShadowValueParser.js.map +7 -0
  90. package/build/utils/color-lib-utils.js +160 -0
  91. package/build/utils/color-lib-utils.js.map +7 -0
  92. package/build/utils/css-functions.js +68 -0
  93. package/build/utils/css-functions.js.map +7 -0
  94. package/build/utils/css-utils.js +33 -0
  95. package/build/utils/css-utils.js.map +7 -0
  96. package/build/utils/hardcoded-shared-utils.js +300 -0
  97. package/build/utils/hardcoded-shared-utils.js.map +7 -0
  98. package/build/utils/node.js +158 -0
  99. package/build/{rules/utils → utils}/node.js.map +2 -2
  100. package/build/utils/property-matcher.js +159 -0
  101. package/build/utils/property-matcher.js.map +7 -0
  102. package/build/utils/styling-hook-utils.js +80 -0
  103. package/build/utils/styling-hook-utils.js.map +7 -0
  104. package/build/utils/value-utils.js +65 -0
  105. package/build/utils/value-utils.js.map +7 -0
  106. package/package.json +9 -4
  107. package/src/config/rule-messages.yml +143 -0
  108. package/build/rules/enforce-bem-usage.d.ts +0 -28
  109. package/build/rules/utils/node.js +0 -197
  110. package/build/rules/utils/rule.d.ts +0 -7
  111. package/build/rules/utils/rule.js +0 -10
  112. package/build/rules/utils/rule.js.map +0 -7
  113. /package/build/{index.d.ts → src/index.d.ts} +0 -0
  114. /package/build/{rules → src}/utils/node.d.ts +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/rules/utils/node.ts", "../src/rules/enforce-bem-usage.ts", "../src/rules/no-deprecated-classes-slds2.ts", "../src/rules/utils/rule.ts", "../src/rules/modal-close-button-issue.ts", "../src/index.ts"],
4
- "sourcesContent": ["// THIS IS TAKEN FROM html-eslint\n\nimport { NODE_TYPES } from \"@html-eslint/parser\";\n\n\n/**\n * @param {TagNode | ScriptTagNode | StyleTagNode} node\n * @param {string} key\n * @returns {AttributeNode | undefined}\n */\nfunction findAttr(node, key) {\n return node.attributes.find(\n (attr) => attr.key && attr.key.value.toLowerCase() === key.toLowerCase()\n );\n}\n\n/**\n * Checks whether a node's attributes is empty or not.\n * @param {TagNode | ScriptTagNode | StyleTagNode} node\n * @returns {boolean}\n */\nfunction isAttributesEmpty(node) {\n return !node.attributes || node.attributes.length <= 0;\n}\n\n/**\n * Checks whether a node's all tokens are on the same line or not.\n * @param {AnyNode} node A node to check\n * @returns {boolean} `true` if a node's tokens are on the same line, otherwise `false`.\n */\nfunction isNodeTokensOnSameLine(node) {\n return node.loc.start.line === node.loc.end.line;\n}\n\n/**\n *\n * @param {Range} rangeA\n * @param {Range} rangeB\n * @returns {boolean}\n */\nfunction isRangesOverlap(rangeA, rangeB) {\n return rangeA[0] < rangeB[1] && rangeB[0] < rangeA[1];\n}\n\n/**\n * @param {(TextNode | CommentContentNode)['templates']} templates\n * @param {Range} range\n * @returns {boolean}\n */\nfunction isOverlapWithTemplates(templates, range) {\n return templates\n .filter((template) => template.isTemplate)\n .some((template) => isRangesOverlap(template.range, range));\n}\n\n/**\n *\n * @param {TextNode | CommentContentNode} node\n * @returns {LineNode[]}\n */\nfunction splitToLineNodes(node) {\n let start = node.range[0];\n let line = node.loc.start.line;\n const startCol = node.loc.start.column;\n /**\n * @type {LineNode[]}\n */\n const lineNodes = [];\n const templates = node.templates || [];\n /**\n *\n * @param {import(\"../../types\").Range} range\n */\n function shouldSkipIndentCheck(range) {\n const overlappedTemplates = templates.filter(\n (template) =>\n template.isTemplate && isRangesOverlap(template.range, range)\n );\n\n const isLineInTemplate = overlappedTemplates.some((template) => {\n return template.range[0] <= range[0] && template.range[1] >= range[1];\n });\n if (isLineInTemplate) {\n return true;\n }\n const isLineBeforeTemplate = overlappedTemplates.some((template) => {\n return template.range[0] <= range[0] && template.range[1] <= range[1];\n });\n if (isLineBeforeTemplate) {\n return true;\n }\n const isLineAfterTemplate = overlappedTemplates.some((template) => {\n return template.range[1] <= range[0];\n });\n if (isLineAfterTemplate) {\n return true;\n }\n return false;\n }\n\n node.value.split(\"\\n\").forEach((value, index) => {\n const columnStart = index === 0 ? startCol : 0;\n /**\n * @type {import(\"../../types\").Range}\n */\n const range = [start, start + value.length];\n const loc = {\n start: {\n line,\n column: columnStart,\n },\n end: {\n line,\n column: columnStart + value.length,\n },\n };\n /**\n * @type {LineNode}\n */\n const lineNode = {\n type: \"Line\",\n value,\n range,\n loc,\n skipIndentCheck: shouldSkipIndentCheck(range),\n };\n\n start += value.length + 1;\n line += 1;\n\n lineNodes.push(lineNode);\n });\n\n return lineNodes;\n}\n\n/**\n * Get location between two nodes.\n * @param {BaseNode} before A node placed in before\n * @param {BaseNode} after A node placed in after\n * @returns {Location} location between two nodes.\n */\nfunction getLocBetween(before, after) {\n return {\n start: before.loc.end,\n end: after.loc.start,\n };\n}\n\n/**\n * @param {AttributeValueNode} node\n * @return {boolean}\n */\nfunction isExpressionInTemplate(node) {\n if (node.type === NODE_TYPES.AttributeValue) {\n return node.value.indexOf(\"${\") === 0;\n }\n return false;\n}\n\n/**\n * @param {AnyNode} node\n * @returns {node is TagNode}\n */\nfunction isTag(node) {\n return node.type === NODE_TYPES.Tag;\n}\n\n/**\n * @param {AnyNode} node\n * @returns {node is CommentNode}\n */\nfunction isComment(node) {\n return node.type === NODE_TYPES.Comment;\n}\n\n/**\n * @param {AnyNode} node\n * @returns {node is TextNode}\n */\nfunction isText(node) {\n return node.type === NODE_TYPES.Text;\n}\n\nconst lineBreakPattern = /\\r\\n|[\\r\\n\\u2028\\u2029]/u;\nconst lineEndingPattern = new RegExp(lineBreakPattern.source, \"gu\");\n/**\n * @param {string} source\n * @returns {string[]}\n */\nfunction codeToLines(source) {\n return source.split(lineEndingPattern);\n}\n\n/**\n *\n * @param {AnyToken[]} tokens\n * @returns {((CommentContentNode | TextNode)['templates'][number])[]}\n */\nfunction getTemplateTokens(tokens) {\n return (\n []\n .concat(\n ...tokens\n // @ts-ignore\n .map((token) => token[\"templates\"] || [])\n )\n // @ts-ignore\n .filter((token) => token.isTemplate)\n );\n}\n\nexport {\n findAttr,\n isAttributesEmpty,\n isNodeTokensOnSameLine,\n splitToLineNodes,\n getLocBetween,\n isExpressionInTemplate,\n isTag,\n isComment,\n isText,\n isOverlapWithTemplates,\n codeToLines,\n isRangesOverlap,\n getTemplateTokens,\n};\n", "import { findAttr, isAttributesEmpty } from \"./utils/node\";\nimport metadata from '@salesforce-ux/sds-metadata';\nconst bemMapping = metadata.bemNaming;\nconst deprecatedClasses = metadata.deprecatedClasses;\n\n/**\n * Checks if a given className or its BEM mapped equivalent is deprecated.\n * \n * This function checks whether the provided className is included in the\n * `deprecatedClasses` list or if the BEM mapped class is deprecated.\n * \n * @param className - The class name to check for deprecation.\n * @returns A boolean indicating whether the className or its mapped version is deprecated.\n */\nconst isDeprecatedClass = (className : string) => {\n return (deprecatedClasses.includes(className) || deprecatedClasses.includes(bemMapping[className]))\n}\n\nexport = {\n meta: {\n type: \"problem\", // The rule type\n docs: {\n category: \"Stylistic Issues\",\n recommended: true,\n description: \"Replace BEM double-dash syntax in class names with single underscore syntax.\",\n url : \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#enforce-bem-usage\"\n },\n fixable: \"code\", // This rule can be fixed automatically\n schema: [\n {\n type: \"object\",\n properties: {\n pattern: { type: \"string\" }, // Regex pattern for BEM\n flags: { type: \"string\" }, // Regex flags\n },\n additionalProperties: false,\n },\n ],\n },\n\n create(context) { \n\n function check(node) {\n if (isAttributesEmpty(node)) {\n return;\n }\n const classAttr = findAttr(node, \"class\");\n if (classAttr && classAttr.value) {\n const classNames = classAttr.value.value.split(/\\s+/);\n classNames.forEach((className) => {\n if (className && className in bemMapping && !isDeprecatedClass(className)) {\n // Find the exact location of the problematic class name\n const classNameStart = classAttr.value.value.indexOf(className) + 7; // 7 here is for `class= \"`\n const classNameEnd = classNameStart + className.length;\n\n // Use the loc property to get line and column from the class attribute\n const startLoc = {\n line: classAttr.loc.start.line,\n column: classAttr.loc.start.column + classNameStart,\n };\n const endLoc = {\n line: classAttr.loc.start.line,\n column: classAttr.loc.start.column + classNameEnd,\n };\n\n // Check whether a fixed class is available\n const newValue = bemMapping[className];\n context.report({\n node,\n loc: { start: startLoc, end: endLoc },\n data: {\n actual: className,\n newValue\n },\n message: \"{{actual}} has been retired. Update it to the new name {{newValue}}.\",\n fix(fixer) {\n if (newValue) {\n const newClassValue = classAttr.value.value.replace(\n className,\n newValue\n );\n return fixer.replaceTextRange(\n [classAttr.value.range[0], classAttr.value.range[1]],\n `${newClassValue}`\n );\n }\n return null; // Ensure a return value even if no fix is applied\n },\n });\n }\n });\n }\n }\n\n return {\n Tag: check,\n };\n },\n};", "import { findAttr, isAttributesEmpty } from \"./utils/node\";\nimport metadata from '@salesforce-ux/sds-metadata';\nconst deprecatedClasses = metadata.deprecatedClasses;\n\nexport = {\n meta: {\n type: \"problem\", // The rule type\n docs: {\n category: \"Best Practices\",\n recommended: true,\n description: \"Replace classes that aren\u2019t available with SLDS 2 classes. See lightningdesignsystem.com for more info.\",\n url : \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-deprecated-classes-slds2\"\n },\n schema: [], // No additional options needed\n },\n\n create(context) {\n\n function check(node) {\n if (isAttributesEmpty(node)) {\n return;\n }\n\n const classAttr = findAttr(node, \"class\");\n if (classAttr && classAttr.value) {\n const classNames = classAttr.value.value.split(/\\s+/);\n classNames.forEach((className) => {\n if (className && deprecatedClasses.includes(className)) {\n // Find the exact location of the problematic class name\n const classNameStart = classAttr.value.value.indexOf(className) +7; // 7 here is for `class= \"`\n const classNameEnd = classNameStart + className.length;\n\n // Use the loc property to get line and column from the class attribute\n const startLoc = {\n line: classAttr.loc.start.line,\n column: classAttr.loc.start.column + classNameStart,\n };\n const endLoc = {\n line: classAttr.loc.start.line,\n column: classAttr.loc.start.column + classNameEnd,\n };\n \n \n context.report({\n node,\n loc: { start: startLoc, end: endLoc },\n data: {\n className,\n },\n message: \"The class {{className}} isn't available in SLDS 2. Update it to a class supported in SLDS 2. See lightningdesignsystem.com for more information.\",\n });\n }\n });\n }\n }\n\n return {\n Tag: check,\n };\n },\n};", "export const messages= {\n removeClass:\n \"Remove the slds-button_icon-inverse class from the modal close button in components that use the SLDS modal blueprint.\",\n changeVariant:\n \"Change the variant attribute value from bare-inverse to bare in <lightning-button-icon> or <lightning-icon>.\",\n removeVariant:\n \"Remove the variant attribute from the <lightning-icon> component inside the <button> element.\",\n ensureButtonClasses:\n \"Add or move slds-button and slds-button_icon to the class attribute of the <button> element or <lightning-button-icon> component.\",\n ensureSizeAttribute:\n \"To size icons properly, set the size attribute \u200Cto large in the <lightning-icon> and <lightning-button-icon> components.\",\n }", "import { findAttr, isAttributesEmpty } from \"./utils/node\";\nimport { messages } from \"./utils/rule\";\n\n// This rule specific to CVS, find more details here https://issues.salesforce.com/issue/a028c00000zh1iqAAA/modal-close-button-is-not-visible-with-the-new-white-background-after-winter-25-release\nexport = {\n meta: {\n type: \"problem\",\n docs: {\n category: \"Best Practices\",\n recommended: true,\n description: \"Update component attributes or CSS classes for the modal close button to comply with the modal component blueprint.\",\n url: \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#modal-close-button-issue\"\n },\n fixable: \"code\",\n schema: [],\n },\n\n create(context) {\n function check(node) {\n if (isAttributesEmpty(node)) {\n return;\n }\n\n const tagName = node.name;\n\n // \u2705 Scenario 1: Remove 'slds-button_icon-inverse' from <button> \n // (optional) when the parent of the button has class name `slds-modal`\n // and also button should have class `slds-modal__close`\n if (tagName === \"button\") {\n const classAttr = findAttr(node, \"class\");\n if (classAttr && classAttr.value) {\n const classList = classAttr.value.value.split(/\\s+/);\n\n // \u2705 Ensure button has \"slds-modal__close\" before proceeding\n if (!classList.includes(\"slds-modal__close\")) {\n return; // Stop execution if the class is missing\n }\n\n if (classList.includes(\"slds-button_icon-inverse\") || classList.includes(\"slds-button--icon-inverse\")) {\n const newClassList = classList\n .filter((cls) => (cls !== \"slds-button_icon-inverse\" && cls !== \"slds-button--icon-inverse\"))\n .join(\" \");\n context.report({\n node,\n loc: classAttr.loc,\n message: messages[\"removeClass\"],\n fix(fixer) { \n return fixer.replaceText(classAttr, // Replace the full attribute\n `class=\"${newClassList}\"` // Updated class list\n );\n },\n });\n }\n }\n }\n\n // \u2705 Scenario 2: Fix <lightning-button-icon> and this should have class `slds-modal__close`\n if (tagName === \"lightning-button-icon\" || tagName === \"lightning:buttonIcon\") {\n const variantAttr = findAttr(node, \"variant\");\n const sizeAttr = findAttr(node, \"size\");\n const classAttr = findAttr(node, \"class\");\n const iconClassAttr = findAttr(node, \"icon-class\"); // \uD83D\uDD0D Check for icon-class attribute\n \n function validateClassAttr(attribute, attrName) {\n if (attribute && attribute.value) {\n const classList = attribute.value.value.split(/\\s+/);\n\n // Irrespective of whether we are checking for class or icon-class we need to check whether the attribute is present or not.\n // \u2705 Ensure \"slds-modal__close\" exists before proceeding\n if(!classAttr?.value?.value?.includes(\"slds-modal__close\"))\n {\n return;\n }\n \n // \u2705 Ensure \"slds-modal__close\" exists before proceeding\n // if (!classList.includes(\"slds-modal__close\")) {\n // return; // Stop execution if the class is missing\n // }\n \n // Remove inverse classes\n if (classList.includes(\"slds-button_icon-inverse\") || classList.includes(\"slds-button--icon-inverse\")) {\n const newClassList = classList\n .filter((cls) => cls !== \"slds-button_icon-inverse\" && cls !== \"slds-button--icon-inverse\")\n .join(\" \");\n context.report({\n node,\n loc: attribute.loc,\n message: messages[\"removeClass\"],\n fix(fixer) {\n return fixer.replaceText(attribute, // Replace the full attribute\n `${attrName}=\"${newClassList}\"` // Correctly modifies the respective attribute\n );\n },\n });\n }\n \n // Ensure 'slds-button' and 'slds-button_icon' exist\n if (!classList.includes(\"slds-button\") || !classList.includes(\"slds-button_icon\")) {\n let newClassList;\n if(attrName === 'icon-class'){\n newClassList = [\n ...classList.filter((cls) => cls !== \"slds-button_icon-inverse\"),\n ].join(\" \");\n }else{\n newClassList = [\n \"slds-button\",\n \"slds-button_icon\",\n ...classList.filter((cls) => cls !== \"slds-button_icon-inverse\"),\n ].join(\" \");\n }\n context.report({\n node: attribute,\n loc: attribute.value.loc,\n message: messages[\"ensureButtonClasses\"],\n fix(fixer) {\n return fixer.replaceText(attribute.value, `${newClassList}`);\n },\n });}\n \n // Fix variant=\"bare-inverse\" to \"bare\"\n if (variantAttr && variantAttr.value && variantAttr.value.value === \"bare-inverse\") {\n context.report({\n node: variantAttr,\n message: messages[\"changeVariant\"],\n loc: variantAttr.value.loc,\n fix(fixer) {\n return fixer.replaceText(variantAttr.value, `bare`);\n },\n });\n }\n \n // Ensure size=\"large\" exists\n // if (!sizeAttr) {\n // context.report({\n // node,\n // message: messages[\"ensureSizeAttribute\"],\n // fix(fixer) {\n // if (variantAttr) {\n // return fixer.insertTextAfterRange([variantAttr.range[1], variantAttr.range[1]], ' size=\"large\"');\n // }\n // },\n // });\n // }\n }\n }\n \n // \u2705 Validate `class` and `icon-class` separately, maintaining their own attribute names\n validateClassAttr(classAttr, \"class\");\n validateClassAttr(iconClassAttr, \"icon-class\");\n }\n\n // \u2705 Scenario 3: Fix <lightning-icon> inside <button> & the class name of the parent name as button and it should have `slds-modal__close`\n if ((tagName === \"lightning-icon\" || tagName === \"lightning:icon\") && node.parent?.name === \"button\") {\n const parentClassAttr = findAttr(node.parent, \"class\");\n if (parentClassAttr && parentClassAttr.value) {\n const parentClassList = parentClassAttr.value.value.split(/\\s+/);\n\n // \u2705 Ensure the parent <button> has \"slds-modal__close\" before proceeding\n if (!parentClassList.includes(\"slds-modal__close\")) {\n return; // Stop execution if the class is missing\n }\n const variantAttr = findAttr(node, \"variant\");\n const sizeAttr = findAttr(node, \"size\");\n\n // Fix variant=\"bare-inverse\" to \"bare\"\n if (variantAttr && variantAttr.value && variantAttr.value.value === \"bare-inverse\") {\n context.report({\n node: variantAttr,\n message: messages[\"changeVariant\"],\n loc: variantAttr.value.loc,\n fix(fixer) {\n return fixer.replaceText(variantAttr.value, `bare`);\n },\n });\n }\n\n // // Remove variant attribute completely\n // if (variantAttr) {\n // context.report({\n // node: variantAttr,\n // messageId: \"removeVariant\",\n // fix(fixer) {\n // return fixer.remove(variantAttr);\n // },\n // });\n // }\n\n //Ensure size=\"large\" is set\n // if (!sizeAttr) {\n // context.report({\n // node,\n // message: messages[\"ensureSizeAttribute\"],\n // fix(fixer) {\n // //return fixer.insertTextAfter(node, ' size=\"large\"');\n // if(variantAttr)\n // {\n // return fixer.insertTextAfterRange([variantAttr.range[1], variantAttr.range[1]], ' size=\"large\"')\n // }\n // },\n // });\n // }\n }\n }\n }\n return {\n Tag: check,\n };\n },\n};", "// Unified ESLint plugin config for both v8 (legacy) and v9+ (flat)\n\nimport enforceBemUsage from './rules/enforce-bem-usage';\nimport noDeprecatedClassesSlds2 from './rules/no-deprecated-classes-slds2';\nimport modalCloseButtonIssue from './rules/modal-close-button-issue';\nimport htmlParser from \"@html-eslint/parser\";\n\nconst plugin = {\n meta: {\n name: \"@salesforce-ux/eslint-plugin-slds\",\n version: process.env.PLUGIN_VERSION\n },\n configs: {},\n rules: {\n \"enforce-bem-usage\": enforceBemUsage,\n \"no-deprecated-classes-slds2\": noDeprecatedClassesSlds2,\n \"modal-close-button-issue\": modalCloseButtonIssue\n }\n};\n\nObject.assign(plugin.configs, {\n // flat config format for ESLint v9+\n \"flat/recommended\": [\n {\n plugins: {\n \"@salesforce-ux/slds\": plugin,\n },\n rules: {\n \"@salesforce-ux/slds/enforce-bem-usage\": \"error\",\n \"@salesforce-ux/slds/no-deprecated-classes-slds2\": \"error\",\n \"@salesforce-ux/slds/modal-close-button-issue\": \"error\"\n },\n languageOptions: {\n parser: htmlParser,\n ecmaVersion: 2021,\n sourceType: \"module\"\n },\n files: [\"**/*.html\", \"**/*.cmp\"]\n }\n ],\n // legacy config for ESLint v8-\n recommended: {\n plugins: [\"@salesforce-ux/slds\"],\n rules: {\n \"@salesforce-ux/slds/enforce-bem-usage\": \"error\",\n \"@salesforce-ux/slds/no-deprecated-classes-slds2\": \"error\",\n \"@salesforce-ux/slds/modal-close-button-issue\": \"error\"\n },\n parser: htmlParser,\n parserOptions: {\n ecmaVersion: 2021,\n sourceType: \"module\"\n }\n }\n});\n\nmodule.exports = plugin;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,SAAS,SAAS,MAAM,KAAK;AAC3B,SAAO,KAAK,WAAW;AAAA,IACrB,CAAC,SAAS,KAAK,OAAO,KAAK,IAAI,MAAM,YAAY,MAAM,IAAI,YAAY;AAAA,EACzE;AACF;AAOA,SAAS,kBAAkB,MAAM;AAC/B,SAAO,CAAC,KAAK,cAAc,KAAK,WAAW,UAAU;AACvD;AAvBA,IAEA,eAsLM,kBACA;AAzLN;AAAA;AAEA,oBAA2B;AAsL3B,IAAM,mBAAmB;AACzB,IAAM,oBAAoB,IAAI,OAAO,iBAAiB,QAAQ,IAAI;AAAA;AAAA;;;ACzLlE;AAAA,mCAAAA,UAAAC,SAAA;AAAA;AACA,8BAAqB;AACrB,QAAM,aAAa,oBAAAC,QAAS;AAC5B,QAAM,oBAAoB,oBAAAA,QAAS;AAWnC,QAAM,oBAAoB,CAAC,cAAuB;AAChD,aAAQ,kBAAkB,SAAS,SAAS,KAAK,kBAAkB,SAAS,WAAW,SAAS,CAAC;AAAA,IACnG;AAEA,IAAAD,QAAA,UAAS;AAAA,MACP,MAAM;AAAA,QACJ,MAAM;AAAA;AAAA,QACN,MAAM;AAAA,UACJ,UAAU;AAAA,UACV,aAAa;AAAA,UACb,aAAa;AAAA,UACb,KAAM;AAAA,QACR;AAAA,QACA,SAAS;AAAA;AAAA,QACT,QAAQ;AAAA,UACN;AAAA,YACE,MAAM;AAAA,YACN,YAAY;AAAA,cACV,SAAS,EAAE,MAAM,SAAS;AAAA;AAAA,cAC1B,OAAO,EAAE,MAAM,SAAS;AAAA;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AAA;;;AC9MA,+BAA4B;AAC5B,yCAAqC;AACrC,sCAAkC;AAClC,IAAAC,iBAAuB;AAEvB,IAAM,SAAS;AAAA,EACb,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA,EACX;AAAA,EACA,SAAS,CAAC;AAAA,EACV,OAAO;AAAA,IACL,qBAAqB,yBAAAC;AAAA,IACrB,+BAA+B,mCAAAC;AAAA,IAC/B,4BAA4B,gCAAAC;AAAA,EAC9B;AACF;AAEA,OAAO,OAAO,OAAO,SAAS;AAAA;AAAA,EAE5B,oBAAoB;AAAA,IAClB;AAAA,MACE,SAAS;AAAA,QACP,uBAAuB;AAAA,MACzB;AAAA,MACA,OAAO;AAAA,QACL,yCAAyC;AAAA,QACzC,mDAAmD;AAAA,QACnD,gDAAgD;AAAA,MAClD;AAAA,MACA,iBAAiB;AAAA,QACf,QAAQ,eAAAC;AAAA,QACR,aAAa;AAAA,QACb,YAAY;AAAA,MACd;AAAA,MACA,OAAO,CAAC,aAAa,UAAU;AAAA,IACjC;AAAA,EACF;AAAA;AAAA,EAEA,aAAa;AAAA,IACX,SAAS,CAAC,qBAAqB;AAAA,IAC/B,OAAO;AAAA,MACL,yCAAyC;AAAA,MACzC,mDAAmD;AAAA,MACnD,gDAAgD;AAAA,IAClD;AAAA,IACA,QAAQ,eAAAA;AAAA,IACR,eAAe;AAAA,MACb,aAAa;AAAA,MACb,YAAY;AAAA,IACd;AAAA,EACF;AACF,CAAC;AAED,OAAO,UAAU;",
6
- "names": ["exports", "module", "metadata", "exports", "module", "metadata", "exports", "module", "import_parser", "enforceBemUsage", "noDeprecatedClassesSlds2", "modalCloseButtonIssue", "htmlParser"]
3
+ "sources": ["../src/utils/node.ts", "yaml-file:/Users/ritesh.kumar2/Documents/projects/stylelint-sds/packages/eslint-plugin-slds/src/config/rule-messages.yml", "../src/rules/v9/enforce-bem-usage.ts", "../src/rules/enforce-bem-usage.ts", "../src/rules/no-deprecated-classes-slds2.ts", "../src/rules/modal-close-button-issue.ts", "../src/index.ts", "../src/rules/v9/no-slds-class-overrides.ts", "../src/rules/v9/no-deprecated-slds-classes.ts", "../src/rules/v9/no-deprecated-tokens-slds1.ts", "../src/rules/v9/lwc-token-to-slds-hook.ts", "../src/rules/v9/enforce-sds-to-slds-hooks.ts", "../src/rules/v9/no-sldshook-fallback-for-lwctoken.ts", "../src/rules/v9/no-unsupported-hooks-slds2.ts", "../src/rules/v9/no-slds-var-without-fallback.ts", "../src/rules/v9/no-slds-namespace-for-custom-hooks.ts", "../src/rules/v9/enforce-component-hook-naming-convention.ts", "../src/rules/v9/reduce-annotations.ts", "../src/rules/v9/no-slds-private-var.ts", "../src/rules/v9/no-hardcoded-values/no-hardcoded-values-slds1.ts", "../src/utils/color-lib-utils.ts", "../src/utils/css-functions.ts", "../src/utils/property-matcher.ts", "../src/utils/hardcoded-shared-utils.ts", "../src/rules/v9/no-hardcoded-values/handlers/colorHandler.ts", "../src/utils/value-utils.ts", "../src/utils/styling-hook-utils.ts", "../src/rules/v9/no-hardcoded-values/handlers/densityHandler.ts", "../src/rules/v9/no-hardcoded-values/handlers/fontHandler.ts", "../src/utils/boxShadowValueParser.ts", "../src/rules/v9/no-hardcoded-values/handlers/boxShadowHandler.ts", "../src/rules/v9/no-hardcoded-values/noHardcodedValueRule.ts", "../src/rules/v9/no-hardcoded-values/no-hardcoded-values-slds2.ts", "../eslint.rules.internal.json"],
4
+ "sourcesContent": ["// THIS IS TAKEN FROM html-eslint\n\nimport { NODE_TYPES } from \"@html-eslint/parser\";\n\n\n/**\n * @param {TagNode | ScriptTagNode | StyleTagNode} node\n * @param {string} key\n * @returns {AttributeNode | undefined}\n */\nfunction findAttr(node, key) {\n return node.attributes.find(\n (attr) => attr.key && attr.key.value.toLowerCase() === key.toLowerCase()\n );\n}\n\n/**\n * Checks whether a node's attributes is empty or not.\n * @param {TagNode | ScriptTagNode | StyleTagNode} node\n * @returns {boolean}\n */\nfunction isAttributesEmpty(node) {\n return !node.attributes || node.attributes.length <= 0;\n}\n\n/**\n * Checks whether a node's all tokens are on the same line or not.\n * @param {AnyNode} node A node to check\n * @returns {boolean} `true` if a node's tokens are on the same line, otherwise `false`.\n */\nfunction isNodeTokensOnSameLine(node) {\n return node.loc.start.line === node.loc.end.line;\n}\n\n/**\n *\n * @param {Range} rangeA\n * @param {Range} rangeB\n * @returns {boolean}\n */\nfunction isRangesOverlap(rangeA, rangeB) {\n return rangeA[0] < rangeB[1] && rangeB[0] < rangeA[1];\n}\n\n/**\n * @param {(TextNode | CommentContentNode)['templates']} templates\n * @param {Range} range\n * @returns {boolean}\n */\nfunction isOverlapWithTemplates(templates, range) {\n return templates\n .filter((template) => template.isTemplate)\n .some((template) => isRangesOverlap(template.range, range));\n}\n\n/**\n *\n * @param {TextNode | CommentContentNode} node\n * @returns {LineNode[]}\n */\nfunction splitToLineNodes(node) {\n let start = node.range[0];\n let line = node.loc.start.line;\n const startCol = node.loc.start.column;\n /**\n * @type {LineNode[]}\n */\n const lineNodes = [];\n const templates = node.templates || [];\n /**\n *\n * @param {import(\"../../types\").Range} range\n */\n function shouldSkipIndentCheck(range) {\n const overlappedTemplates = templates.filter(\n (template) =>\n template.isTemplate && isRangesOverlap(template.range, range)\n );\n\n const isLineInTemplate = overlappedTemplates.some((template) => {\n return template.range[0] <= range[0] && template.range[1] >= range[1];\n });\n if (isLineInTemplate) {\n return true;\n }\n const isLineBeforeTemplate = overlappedTemplates.some((template) => {\n return template.range[0] <= range[0] && template.range[1] <= range[1];\n });\n if (isLineBeforeTemplate) {\n return true;\n }\n const isLineAfterTemplate = overlappedTemplates.some((template) => {\n return template.range[1] <= range[0];\n });\n if (isLineAfterTemplate) {\n return true;\n }\n return false;\n }\n\n node.value.split(\"\\n\").forEach((value, index) => {\n const columnStart = index === 0 ? startCol : 0;\n /**\n * @type {import(\"../../types\").Range}\n */\n const range = [start, start + value.length];\n const loc = {\n start: {\n line,\n column: columnStart,\n },\n end: {\n line,\n column: columnStart + value.length,\n },\n };\n /**\n * @type {LineNode}\n */\n const lineNode = {\n type: \"Line\",\n value,\n range,\n loc,\n skipIndentCheck: shouldSkipIndentCheck(range),\n };\n\n start += value.length + 1;\n line += 1;\n\n lineNodes.push(lineNode);\n });\n\n return lineNodes;\n}\n\n/**\n * Get location between two nodes.\n * @param {BaseNode} before A node placed in before\n * @param {BaseNode} after A node placed in after\n * @returns {Location} location between two nodes.\n */\nfunction getLocBetween(before, after) {\n return {\n start: before.loc.end,\n end: after.loc.start,\n };\n}\n\n/**\n * @param {AttributeValueNode} node\n * @return {boolean}\n */\nfunction isExpressionInTemplate(node) {\n if (node.type === NODE_TYPES.AttributeValue) {\n return node.value.indexOf(\"${\") === 0;\n }\n return false;\n}\n\n/**\n * @param {AnyNode} node\n * @returns {node is TagNode}\n */\nfunction isTag(node) {\n return node.type === NODE_TYPES.Tag;\n}\n\n/**\n * @param {AnyNode} node\n * @returns {node is CommentNode}\n */\nfunction isComment(node) {\n return node.type === NODE_TYPES.Comment;\n}\n\n/**\n * @param {AnyNode} node\n * @returns {node is TextNode}\n */\nfunction isText(node) {\n return node.type === NODE_TYPES.Text;\n}\n\nconst lineBreakPattern = /\\r\\n|[\\r\\n\\u2028\\u2029]/u;\nconst lineEndingPattern = new RegExp(lineBreakPattern.source, \"gu\");\n/**\n * @param {string} source\n * @returns {string[]}\n */\nfunction codeToLines(source) {\n return source.split(lineEndingPattern);\n}\n\n/**\n *\n * @param {AnyToken[]} tokens\n * @returns {((CommentContentNode | TextNode)['templates'][number])[]}\n */\nfunction getTemplateTokens(tokens) {\n return (\n []\n .concat(\n ...tokens\n // @ts-ignore\n .map((token) => token[\"templates\"] || [])\n )\n // @ts-ignore\n .filter((token) => token.isTemplate)\n );\n}\n\nexport {\n findAttr,\n isAttributesEmpty,\n isNodeTokensOnSameLine,\n splitToLineNodes,\n getLocBetween,\n isExpressionInTemplate,\n isTag,\n isComment,\n isText,\n isOverlapWithTemplates,\n codeToLines,\n isRangesOverlap,\n getTemplateTokens,\n};", "module.exports = {\n \"no-slds-class-overrides\": {\n \"description\": \"Create new custom CSS classes instead of overriding SLDS selectors\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-slds-class-overrides\",\n \"type\": \"problem\",\n \"messages\": {\n \"sldsClassOverride\": \"Overriding .{{className}} isn't supported. To differentiate SLDS and custom classes, create a CSS class in your namespace. Examples: myapp-input, myapp-button.\"\n }\n },\n \"no-deprecated-slds-classes\": {\n \"description\": \"Please replace the deprecated classes with a modern equivalent\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-deprecated-slds-classes\",\n \"type\": \"problem\",\n \"messages\": {\n \"deprecatedClass\": \"The class {{className}} is deprecated and not available in SLDS2. Please update to a supported class.\"\n }\n },\n \"no-deprecated-tokens-slds1\": {\n \"description\": \"Update outdated design tokens to SLDS 2 styling hooks with similar values. For more information, see Styling Hooks on lightningdesignsystem.com.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-deprecated-tokens-slds1\",\n \"type\": \"problem\",\n \"messages\": {\n \"deprecatedToken\": \"Consider removing {{oldValue}} or replacing it with {{newValue}}. Set the fallback to {{oldValue}}. For more info, see Styling Hooks on lightningdesignsystem.com.\",\n \"noReplacement\": \"Update outdated design tokens to SLDS 2 styling hooks with similar values. For more information, see Styling Hooks on lightningdesignsystem.com.\"\n }\n },\n \"enforce-sds-to-slds-hooks\": {\n \"description\": \"Convert your existing --sds styling hooks to --slds styling hooks. See lightningdesignsystem.com for more info.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#enforce-sds-to-slds-hooks\",\n \"type\": \"problem\",\n \"messages\": {\n \"replaceSdsWithSlds\": \"Replace {{oldValue}} with {{suggestedMatch}} styling hook.\"\n }\n },\n \"enforce-bem-usage\": {\n \"description\": \"Replace BEM double-dash syntax in class names with single underscore syntax\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#enforce-bem-usage\",\n \"type\": \"problem\",\n \"messages\": {\n \"bemDoubleDash\": \"{{actual}} has been retired. Update it to the new name {{newValue}}.\",\n \"fixBemNaming\": \"Update to correct BEM naming convention\"\n }\n },\n \"modal-close-button-issue\": {\n \"description\": \"Update component attributes or CSS classes for the modal close button to comply with the modal component blueprint\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#modal-close-button-issue\",\n \"type\": \"problem\",\n \"messages\": {\n \"modalCloseButtonIssue\": \"Update component attributes or CSS classes for the modal close button to comply with the modal component blueprint.\",\n \"removeClass\": \"Remove the slds-button_icon-inverse class from the modal close button in components that use the SLDS modal blueprint.\",\n \"changeVariant\": \"Change the variant attribute value from bare-inverse to bare in <lightning-button-icon> or <lightning-icon>.\",\n \"removeVariant\": \"Remove the variant attribute from the <lightning-icon> component inside the <button> element.\",\n \"ensureButtonClasses\": \"Add or move slds-button and slds-button_icon to the class attribute of the <button> element or <lightning-button-icon> component.\",\n \"ensureSizeAttribute\": \"To size icons properly, set the size attribute \u200Cto large in the <lightning-icon> and <lightning-button-icon> components.\"\n }\n },\n \"no-deprecated-classes-slds2\": {\n \"description\": \"Replace classes that aren't available with SLDS 2 classes\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-deprecated-classes-slds2\",\n \"type\": \"problem\",\n \"messages\": {\n \"deprecatedClass\": \"The class {{className}} isn't available in SLDS 2. Update it to a class supported in SLDS 2. See lightningdesignsystem.com for more information.\",\n \"updateToModernClass\": \"Replace deprecated class with modern equivalent\",\n \"checkDocumentation\": \"See lightningdesignsystem.com for SLDS 2 class alternatives\"\n }\n },\n \"lwc-token-to-slds-hook\": {\n \"description\": \"Replace the deprecated --lwc tokens with the latest --slds tokens. See lightningdesignsystem.com for more info.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#lwc-token-to-slds-hook\",\n \"type\": \"problem\",\n \"messages\": {\n \"errorWithReplacement\": \"The '{{oldValue}}' design token is deprecated. Replace it with '{{newValue}}'. For more info, see Global Styling Hooks on lightningdesignsystem.com.\",\n \"errorWithStyleHooks\": \"The '{{oldValue}}' design token is deprecated. Replace it with the SLDS 2 '{{newValue}}' styling hook and set the fallback to '{{oldValue}}'. For more info, see Global Styling Hooks on lightningdesignsystem.com.\",\n \"errorWithNoRecommendation\": \"The '{{oldValue}}' design token is deprecated. For more info, see the New Global Styling Hook Guidance on lightningdesignsystem.com.\"\n }\n },\n \"no-sldshook-fallback-for-lwctoken\": {\n \"description\": \"Avoid using --slds styling hooks as fallback values for --lwc tokens.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-sldshook-fallback-for-lwctoken\",\n \"type\": \"problem\",\n \"messages\": {\n \"unsupportedFallback\": \"Remove the {{sldsToken}} styling hook that is used as a fallback value for {{lwcToken}}.\"\n }\n },\n \"no-unsupported-hooks-slds2\": {\n \"description\": \"Identifies styling hooks that aren't present in SLDS 2. They must be replaced with styling hooks that have a similar effect, or they must be removed.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-unsupported-hooks-slds2\",\n \"type\": \"problem\",\n \"messages\": {\n \"deprecated\": \"The {{token}} styling hook isn't present in SLDS 2 and there's no equivalent replacement. Remove it or replace it with a styling hook with a similar effect.\"\n }\n },\n \"no-slds-var-without-fallback\": {\n \"description\": \"Add fallback values to SLDS styling hooks. The fallback values are used in Salesforce environments where styling hooks are unavailable.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-slds-var-without-fallback\",\n \"type\": \"problem\",\n \"messages\": {\n \"varWithoutFallback\": \"Your code uses the {{cssVar}} styling hook without a fallback value. Styling hooks are unavailable in some Salesforce environments. To render your component correctly in all environments, add this fallback value: var({{cssVar}}, {{recommendation}}). To make this fallback value brand-aware, use a branded design token instead of a static value. See Design Tokens on v1.lightningdesignsystem.com.\"\n }\n },\n \"no-slds-namespace-for-custom-hooks\": {\n \"description\": \"To differentiate custom styling hooks from SLDS styling hooks, create custom styling hooks in your namespace.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-slds-namespace-for-custom-hooks\",\n \"type\": \"problem\",\n \"messages\": {\n \"customHookNamespace\": \"Using the --slds namespace for {{token}} isn't supported. Create the custom styling hook in your namespace. Example: --myapp-{{tokenWithoutNamespace}}\"\n }\n },\n \"no-slds-private-var\": {\n \"description\": \"Some SLDS styling hooks are private and reserved only for internal Salesforce use. Private SLDS styling hooks have prefixes --_slds- and --slds-s-. For more information, look up private CSS in lightningdesignsystem.com.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-slds-private-var\",\n \"type\": \"problem\",\n \"messages\": {\n \"privateVar\": \"This styling hook is reserved for internal Salesforce use. Remove the --_slds- or \u2013slds-s private variable within selector {{prop}}. For more information, look up private CSS in lightningdesignsystem.com.\"\n }\n },\n \"enforce-component-hook-naming-convention\": {\n \"description\": \"Replace component styling hooks that use a deprecated naming convention.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#enforce-component-hook-naming-convention\",\n \"type\": \"problem\",\n \"messages\": {\n \"replace\": \"Replace the deprecated {{oldValue}} component styling hook with {{suggestedMatch}}.\"\n }\n },\n \"no-hardcoded-values-slds1\": {\n \"description\": \"Replace static values with SLDS 1 design tokens. For more information, look up design tokens on lightningdesignsystem.com.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-hardcoded-value\",\n \"type\": \"suggestion\",\n \"messages\": {\n \"hardcodedValue\": \"Replace the {{oldValue}} static value with an SLDS 1 styling hook: {{newValue}}.\",\n \"noReplacement\": \"There's no replacement styling hook for the {{oldValue}} static value. Remove the static value.\"\n }\n },\n \"no-hardcoded-values-slds2\": {\n \"description\": \"Replace static values with SLDS 2 styling hooks. For more information, look up design tokens on lightningdesignsystem.com.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-hardcoded-value\",\n \"type\": \"suggestion\",\n \"messages\": {\n \"hardcodedValue\": \"Consider replacing the {{oldValue}} static value with an SLDS 2 styling hook that has a similar value: {{newValue}}.\",\n \"noReplacement\": \"There's no replacement styling hook for the {{oldValue}} static value. Remove the static value.\"\n }\n },\n \"reduce-annotations\": {\n \"description\": \"Remove your annotations and update your code.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#reduce-annotations\",\n \"type\": \"problem\",\n \"messages\": {\n \"removeAnnotation\": \"Remove this annotation and update the code to SLDS best practices. For help, file an issue at https://github.com/salesforce-ux/slds-linter/\"\n }\n }\n};", "import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata/next';\nimport ruleMessages from '../../config/rule-messages.yml';\n\nconst { type, description, url, messages } = ruleMessages['enforce-bem-usage'];\n\nconst bemMapping = metadata.bemNaming;\n\nexport default {\n meta: {\n type,\n docs: {\n description,\n recommended: true,\n url,\n },\n fixable: 'code',\n messages,\n },\n \n create(context) {\n return {\n // Check all class selectors for BEM usage\n \"SelectorList Selector ClassSelector\"(node) {\n const cssClassSelector = context.sourceCode.getText(node);\n \n // Extract class name (remove the leading dot)\n const className = cssClassSelector.substring(1);\n \n // Check mapping data for this class name (matches Stylelint logic)\n if (className && className in bemMapping) {\n const newValue = bemMapping[className];\n if (typeof newValue === 'string') {\n context.report({\n node,\n messageId: 'bemDoubleDash',\n data: {\n actual: className,\n newValue,\n },\n fix(fixer) {\n return fixer.replaceText(node, `.${newValue}`);\n },\n });\n }\n }\n },\n };\n },\n} as Rule.RuleModule;\n", "import { Rule } from 'eslint';\nimport { findAttr, isAttributesEmpty } from \"../utils/node\";\nimport metadata from '@salesforce-ux/sds-metadata/next';\nimport ruleMessages from '../config/rule-messages.yml';\nimport enforceBemUsageCss from './v9/enforce-bem-usage';\n\nconst bemMapping = metadata.bemNaming;\nconst deprecatedClasses = metadata.deprecatedClasses;\nconst ruleConfig = ruleMessages['enforce-bem-usage'];\nconst { type, description, url, messages } = ruleConfig;\n/**\n * Checks if a given className or its BEM mapped equivalent is deprecated.\n * \n * This function checks whether the provided className is included in the\n * `deprecatedClasses` list or if the BEM mapped class is deprecated.\n * \n * @param className - The class name to check for deprecation.\n * @returns A boolean indicating whether the className or its mapped version is deprecated.\n */\nconst isDeprecatedClass = (className : string) => {\n return (deprecatedClasses.includes(className) || deprecatedClasses.includes(bemMapping[className]))\n}\n\nconst enforceBemUsageHtml = {\n create(context) { \n\n function check(node) {\n if (isAttributesEmpty(node)) {\n return;\n }\n const classAttr = findAttr(node, \"class\");\n if (classAttr && classAttr.value) {\n const classNames = classAttr.value.value.split(/\\s+/);\n classNames.forEach((className) => {\n if (className && className in bemMapping && !isDeprecatedClass(className)) {\n // Find the exact location of the problematic class name\n const classNameStart = classAttr.value.value.indexOf(className) + 7; // 7 here is for `class= \"`\n const classNameEnd = classNameStart + className.length;\n\n // Use the loc property to get line and column from the class attribute\n const startLoc = {\n line: classAttr.loc.start.line,\n column: classAttr.loc.start.column + classNameStart,\n };\n const endLoc = {\n line: classAttr.loc.start.line,\n column: classAttr.loc.start.column + classNameEnd,\n };\n\n // Check whether a fixed class is available\n const newValue = bemMapping[className];\n context.report({\n node,\n loc: { start: startLoc, end: endLoc },\n messageId: 'bemDoubleDash',\n data: {\n actual: className,\n newValue\n },\n fix(fixer) {\n if (newValue) {\n const newClassValue = classAttr.value.value.replace(\n className,\n newValue\n );\n return fixer.replaceTextRange(\n [classAttr.value.range[0], classAttr.value.range[1]],\n `${newClassValue}`\n );\n }\n return null; // Ensure a return value even if no fix is applied\n },\n });\n }\n });\n }\n }\n\n return {\n Tag: check,\n };\n },\n};\n\n\n\n// Create a hybrid rule that works for both HTML and CSS\nconst enforceBemUsage = {\n meta: {\n type,\n docs: {\n recommended: true,\n description,\n url\n },\n fixable: \"code\",\n messages\n },\n\n create(context) {\n const filename = context.filename || context.getFilename();\n \n // Check if we're in a CSS context\n if (filename.endsWith('.css') || filename.endsWith('.scss')) {\n // Try to detect if we have CSS support\n // In ESLint v9 with @eslint/css, we should have CSS AST support\n try {\n // Use CSS implementation (ESLint v9 with @eslint/css)\n return enforceBemUsageCss.create(context);\n } catch (error) {\n // If CSS implementation fails, likely ESLint v8 without CSS support\n // Return empty visitor to avoid errors\n return {};\n }\n } else {\n // Use HTML implementation (compatible with both ESLint v8 and v9)\n return enforceBemUsageHtml.create(context);\n }\n },\n};\n\nexport = enforceBemUsage;", "import { Rule } from 'eslint';\nimport { findAttr, isAttributesEmpty } from \"../utils/node\";\nimport metadata from '@salesforce-ux/sds-metadata/next';\nimport ruleMessages from '../config/rule-messages.yml';\n\nconst deprecatedClasses = metadata.deprecatedClasses;\nconst ruleConfig = ruleMessages['no-deprecated-classes-slds2'];\n\nexport = {\n meta: {\n type: ruleConfig.type,\n docs: {\n category: \"Best Practices\",\n recommended: true,\n description: ruleConfig.description,\n url: ruleConfig.url\n },\n schema: [],\n messages: ruleConfig.messages,\n },\n\n create(context) {\n\n function check(node) {\n if (isAttributesEmpty(node)) {\n return;\n }\n\n const classAttr = findAttr(node, \"class\");\n if (classAttr && classAttr.value) {\n const classNames = classAttr.value.value.split(/\\s+/);\n classNames.forEach((className) => {\n if (className && deprecatedClasses.includes(className)) {\n // Find the exact location of the problematic class name\n const classNameStart = classAttr.value.value.indexOf(className) +7; // 7 here is for `class= \"`\n const classNameEnd = classNameStart + className.length;\n\n // Use the loc property to get line and column from the class attribute\n const startLoc = {\n line: classAttr.loc.start.line,\n column: classAttr.loc.start.column + classNameStart,\n };\n const endLoc = {\n line: classAttr.loc.start.line,\n column: classAttr.loc.start.column + classNameEnd,\n };\n \n \n context.report({\n node,\n loc: { start: startLoc, end: endLoc },\n messageId: 'deprecatedClass',\n data: {\n className,\n },\n });\n }\n });\n }\n }\n\n return {\n Tag: check,\n };\n },\n};", "import { Rule } from 'eslint';\nimport { findAttr, isAttributesEmpty } from \"../utils/node\";\nimport ruleMessages from '../config/rule-messages.yml';\n\nconst ruleConfig = ruleMessages['modal-close-button-issue'];\n\n// This rule specific to CVS, find more details here https://issues.salesforce.com/issue/a028c00000zh1iqAAA/modal-close-button-is-not-visible-with-the-new-white-background-after-winter-25-release\nexport = {\n meta: {\n type: ruleConfig.type,\n docs: {\n category: \"Best Practices\",\n recommended: true,\n description: ruleConfig.description,\n url: ruleConfig.url\n },\n fixable: \"code\",\n schema: [],\n messages: ruleConfig.messages,\n },\n\n create(context) {\n function check(node) {\n if (isAttributesEmpty(node)) {\n return;\n }\n\n const tagName = node.name;\n\n // \u2705 Scenario 1: Remove 'slds-button_icon-inverse' from <button> \n // (optional) when the parent of the button has class name `slds-modal`\n // and also button should have class `slds-modal__close`\n if (tagName === \"button\") {\n const classAttr = findAttr(node, \"class\");\n if (classAttr && classAttr.value) {\n const classList = classAttr.value.value.split(/\\s+/);\n\n // \u2705 Ensure button has \"slds-modal__close\" before proceeding\n if (!classList.includes(\"slds-modal__close\")) {\n return; // Stop execution if the class is missing\n }\n\n if (classList.includes(\"slds-button_icon-inverse\") || classList.includes(\"slds-button--icon-inverse\")) {\n const newClassList = classList\n .filter((cls) => (cls !== \"slds-button_icon-inverse\" && cls !== \"slds-button--icon-inverse\"))\n .join(\" \");\n context.report({\n node,\n loc: classAttr.loc,\n messageId: \"removeClass\",\n fix(fixer) { \n return fixer.replaceText(classAttr, // Replace the full attribute\n `class=\"${newClassList}\"` // Updated class list\n );\n },\n });\n }\n }\n }\n\n // \u2705 Scenario 2: Fix <lightning-button-icon> and this should have class `slds-modal__close`\n if (tagName === \"lightning-button-icon\" || tagName === \"lightning:buttonIcon\") {\n const variantAttr = findAttr(node, \"variant\");\n const sizeAttr = findAttr(node, \"size\");\n const classAttr = findAttr(node, \"class\");\n const iconClassAttr = findAttr(node, \"icon-class\"); // \uD83D\uDD0D Check for icon-class attribute\n \n function validateClassAttr(attribute, attrName) {\n if (attribute && attribute.value) {\n const classList = attribute.value.value.split(/\\s+/);\n\n // Irrespective of whether we are checking for class or icon-class we need to check whether the attribute is present or not.\n // \u2705 Ensure \"slds-modal__close\" exists before proceeding\n if(!classAttr?.value?.value?.includes(\"slds-modal__close\"))\n {\n return;\n }\n \n // \u2705 Ensure \"slds-modal__close\" exists before proceeding\n // if (!classList.includes(\"slds-modal__close\")) {\n // return; // Stop execution if the class is missing\n // }\n \n // Remove inverse classes\n if (classList.includes(\"slds-button_icon-inverse\") || classList.includes(\"slds-button--icon-inverse\")) {\n const newClassList = classList\n .filter((cls) => cls !== \"slds-button_icon-inverse\" && cls !== \"slds-button--icon-inverse\")\n .join(\" \");\n context.report({\n node,\n loc: attribute.loc,\n messageId: \"removeClass\",\n fix(fixer) {\n return fixer.replaceText(attribute, // Replace the full attribute\n `${attrName}=\"${newClassList}\"` // Correctly modifies the respective attribute\n );\n },\n });\n }\n \n // Ensure 'slds-button' and 'slds-button_icon' exist\n if (!classList.includes(\"slds-button\") || !classList.includes(\"slds-button_icon\")) {\n let newClassList;\n if(attrName === 'icon-class'){\n newClassList = [\n ...classList.filter((cls) => cls !== \"slds-button_icon-inverse\"),\n ].join(\" \");\n }else{\n newClassList = [\n \"slds-button\",\n \"slds-button_icon\",\n ...classList.filter((cls) => cls !== \"slds-button_icon-inverse\"),\n ].join(\" \");\n }\n context.report({\n node: attribute,\n loc: attribute.value.loc,\n messageId: \"ensureButtonClasses\",\n fix(fixer) {\n return fixer.replaceText(attribute.value, `${newClassList}`);\n },\n });}\n \n // Fix variant=\"bare-inverse\" to \"bare\"\n if (variantAttr && variantAttr.value && variantAttr.value.value === \"bare-inverse\") {\n context.report({\n node: variantAttr,\n messageId: \"changeVariant\",\n loc: variantAttr.value.loc,\n fix(fixer) {\n return fixer.replaceText(variantAttr.value, `bare`);\n },\n });\n }\n \n // Ensure size=\"large\" exists\n // if (!sizeAttr) {\n // context.report({\n // node,\n // message: messages[\"ensureSizeAttribute\"],\n // fix(fixer) {\n // if (variantAttr) {\n // return fixer.insertTextAfterRange([variantAttr.range[1], variantAttr.range[1]], ' size=\"large\"');\n // }\n // },\n // });\n // }\n }\n }\n \n // \u2705 Validate `class` and `icon-class` separately, maintaining their own attribute names\n validateClassAttr(classAttr, \"class\");\n validateClassAttr(iconClassAttr, \"icon-class\");\n }\n\n // \u2705 Scenario 3: Fix <lightning-icon> inside <button> & the class name of the parent name as button and it should have `slds-modal__close`\n if ((tagName === \"lightning-icon\" || tagName === \"lightning:icon\") && node.parent?.name === \"button\") {\n const parentClassAttr = findAttr(node.parent, \"class\");\n if (parentClassAttr && parentClassAttr.value) {\n const parentClassList = parentClassAttr.value.value.split(/\\s+/);\n\n // \u2705 Ensure the parent <button> has \"slds-modal__close\" before proceeding\n if (!parentClassList.includes(\"slds-modal__close\")) {\n return; // Stop execution if the class is missing\n }\n const variantAttr = findAttr(node, \"variant\");\n const sizeAttr = findAttr(node, \"size\");\n\n // Fix variant=\"bare-inverse\" to \"bare\"\n if (variantAttr && variantAttr.value && variantAttr.value.value === \"bare-inverse\") {\n context.report({\n node: variantAttr,\n messageId: \"changeVariant\",\n loc: variantAttr.value.loc,\n fix(fixer) {\n return fixer.replaceText(variantAttr.value, `bare`);\n },\n });\n }\n\n // // Remove variant attribute completely\n // if (variantAttr) {\n // context.report({\n // node: variantAttr,\n // messageId: \"removeVariant\",\n // fix(fixer) {\n // return fixer.remove(variantAttr);\n // },\n // });\n // }\n\n //Ensure size=\"large\" is set\n // if (!sizeAttr) {\n // context.report({\n // node,\n // message: messages[\"ensureSizeAttribute\"],\n // fix(fixer) {\n // //return fixer.insertTextAfter(node, ' size=\"large\"');\n // if(variantAttr)\n // {\n // return fixer.insertTextAfterRange([variantAttr.range[1], variantAttr.range[1]], ' size=\"large\"')\n // }\n // },\n // });\n // }\n }\n }\n }\n return {\n Tag: check,\n };\n },\n};", "// Unified ESLint plugin config for both v8 (legacy) and v9+ (flat)\n\nimport enforceBemUsage from './rules/enforce-bem-usage';\nimport noDeprecatedClassesSlds2 from './rules/no-deprecated-classes-slds2';\nimport modalCloseButtonIssue from './rules/modal-close-button-issue';\nimport noSldsClassOverrides from './rules/v9/no-slds-class-overrides';\nimport noDeprecatedSldsClasses from './rules/v9/no-deprecated-slds-classes';\nimport noDeprecatedTokensSlds1 from './rules/v9/no-deprecated-tokens-slds1';\nimport lwcTokenToSldsHook from './rules/v9/lwc-token-to-slds-hook';\nimport enforceSdsToSldsHooks from './rules/v9/enforce-sds-to-slds-hooks';\nimport noSldshookFallbackForLwctoken from './rules/v9/no-sldshook-fallback-for-lwctoken';\nimport noUnsupportedHooksSlds2 from './rules/v9/no-unsupported-hooks-slds2';\nimport noSldsVarWithoutFallback from './rules/v9/no-slds-var-without-fallback';\nimport noSldsNamespaceForCustomHooks from './rules/v9/no-slds-namespace-for-custom-hooks';\nimport enforceComponentHookNamingConvention from './rules/v9/enforce-component-hook-naming-convention';\nimport reduceAnnotations from './rules/v9/reduce-annotations';\nimport noSldsPrivateVar from './rules/v9/no-slds-private-var';\nimport noHardcodedValuesSlds1 from './rules/v9/no-hardcoded-values/no-hardcoded-values-slds1';\nimport noHardcodedValuesSlds2 from './rules/v9/no-hardcoded-values/no-hardcoded-values-slds2';\n\n\nimport htmlParser from \"@html-eslint/parser\";\nimport cssPlugin from \"@eslint/css\";\n\n// Import rule configurations based on persona\nimport ruleConfigs from '../eslint.rules.internal.json';\n\nconst rules = {\n \"enforce-bem-usage\": enforceBemUsage,\n \"no-deprecated-classes-slds2\": noDeprecatedClassesSlds2,\n \"modal-close-button-issue\": modalCloseButtonIssue,\n \"no-slds-class-overrides\": noSldsClassOverrides,\n \"no-deprecated-slds-classes\": noDeprecatedSldsClasses,\n \"no-deprecated-tokens-slds1\": noDeprecatedTokensSlds1,\n \"lwc-token-to-slds-hook\": lwcTokenToSldsHook,\n \"enforce-sds-to-slds-hooks\": enforceSdsToSldsHooks,\n \"no-sldshook-fallback-for-lwctoken\": noSldshookFallbackForLwctoken,\n \"no-unsupported-hooks-slds2\": noUnsupportedHooksSlds2,\n \"no-slds-var-without-fallback\": noSldsVarWithoutFallback,\n \"no-slds-namespace-for-custom-hooks\": noSldsNamespaceForCustomHooks,\n \"enforce-component-hook-naming-convention\": enforceComponentHookNamingConvention,\n \"no-slds-private-var\": noSldsPrivateVar,\n \"no-hardcoded-values-slds1\": noHardcodedValuesSlds1,\n \"no-hardcoded-values-slds2\": noHardcodedValuesSlds2,\n \"reduce-annotations\": reduceAnnotations\n};\n\nconst plugin = {\n meta: {\n name: \"@salesforce-ux/eslint-plugin-slds\",\n version: process.env.PLUGIN_VERSION\n },\n rules,\n configs: {}\n};\n\nObject.assign(plugin.configs, {\n // Flat config for ESLint v9+\n \"flat/recommended\": [\n // HTML/Component config\n {\n files: [\"**/*.html\", \"**/*.cmp\"],\n languageOptions: {\n parser: htmlParser,\n ecmaVersion: 2021,\n sourceType: \"module\"\n },\n plugins: {\n \"@salesforce-ux/slds\": plugin\n },\n rules: ruleConfigs.html\n },\n // CSS config - Standard CSS files\n {\n files: [\"**/*.{css,scss}\"],\n language: \"css/css\",\n ...cssPlugin.configs.recommended,\n languageOptions: {\n tolerant: true // Allow recoverable parsing errors for SCSS syntax\n },\n plugins: {\n css: cssPlugin,\n \"@salesforce-ux/slds\": plugin\n },\n rules: ruleConfigs.css\n }\n ],\n // legacy config for ESLint v8-\n recommended: {\n plugins: [\"@salesforce-ux/slds\"],\n rules: ruleConfigs.html,\n parser: htmlParser,\n parserOptions: {\n ecmaVersion: 2021,\n sourceType: \"module\"\n }\n }\n});\n\nmodule.exports = plugin;\n", "/**\n * @fileoverview Rule to disallow overriding SLDS CSS classes\n * Compatible with @eslint/css parser for ESLint v9\n * Maintains full parity with stylelint version behavior\n */\n\nimport { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata/next';\nimport ruleMessages from '../../config/rule-messages.yml';\n\nconst ruleConfig = ruleMessages['no-slds-class-overrides'];\n\n// Get SLDS classes from metadata (same as stylelint version)\nconst sldsClasses = metadata.sldsPlusClasses;\nconst sldsClassesSet = new Set(sldsClasses);\n\nexport default {\n meta: {\n type: ruleConfig.type,\n docs: {\n description: ruleConfig.description,\n recommended: true, //useful for plugin recommended configs\n url: ruleConfig.url,\n },\n fixable: null,\n hasSuggestions: false,\n schema: [],\n messages: ruleConfig.messages,\n },\n \n create(context) {\n return {\n // For no-slds-class-overrides: Only flags classes at selector end\n \"SelectorList Selector\"(node) {\n // Get the last ClassSelector in this selector (the one at the end)\n const classSelectorNode = node.children.filter((child) => child.type === \"ClassSelector\").at(-1);\n \n if (classSelectorNode) {\n const className = classSelectorNode.name;\n \n // Check if it's an SLDS class that exists in metadata\n if (className && \n className.startsWith('slds-') && \n sldsClassesSet.has(className)) {\n context.report({\n node: classSelectorNode,\n messageId: 'sldsClassOverride',\n data: { className },\n });\n }\n }\n },\n };\n },\n} as Rule.RuleModule; ", "import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata/next';\nimport ruleMessages from '../../config/rule-messages.yml';\n\nconst {type, description, url, messages} = ruleMessages['no-deprecated-slds-classes'];\n\nconst deprecatedClasses = metadata.deprecatedClasses;\nconst deprecatedClassesSet = new Set(deprecatedClasses);\n\nexport default {\n meta: {\n type,\n docs: {\n description,\n recommended: true,\n url,\n },\n messages,\n },\n \n create(context) {\n return {\n // For no-deprecated-slds-classes: Check all class selectors for deprecated classes\n \"SelectorList Selector ClassSelector\"(node) {\n const cssClassSelector = context.sourceCode.getText(node);\n \n // Extract class name (remove the leading dot)\n const className = cssClassSelector.substring(1);\n \n // Check if it's a deprecated SLDS class\n if (className && deprecatedClassesSet.has(className)) {\n context.report({\n node,\n messageId: 'deprecatedClass',\n data: { className },\n });\n }\n },\n };\n },\n} as Rule.RuleModule;\n", "import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata/next';\nimport ruleMessages from '../../config/rule-messages.yml';\n\nconst ruleConfig = ruleMessages['no-deprecated-tokens-slds1'];\nconst { type, description, url, messages } = ruleConfig;\n\n// Get token mapping from metadata (Aura tokens to LWC tokens)\nconst tokenMapping = metadata.auraToLwcTokensMapping;\n\nexport default {\n meta: {\n type,\n docs: {\n description: description,\n recommended: true,\n url,\n },\n fixable: 'code',\n messages,\n },\n \n create(context) {\n /**\n * Check if a token should be ignored (not in mapping or not LWC token)\n */\n function shouldIgnoreDetection(token: string): boolean {\n return (!(token in tokenMapping) || !tokenMapping[token].startsWith('--lwc-'));\n }\n\n /**\n * Generate replacement suggestion for deprecated token\n */\n function generateReplacement(tokenName: string, originalFunctionCall: string): string | null {\n if (shouldIgnoreDetection(tokenName)) {\n return null;\n }\n const recommendation = tokenMapping[tokenName];\n return `var(${recommendation}, ${originalFunctionCall})`;\n }\n\n function handleTokenFunction(node, functionName) {\n // Get the token name from the identifier\n const tokenName = context.sourceCode.getText(node);\n \n // Skip if token should be ignored\n if (shouldIgnoreDetection(tokenName)) {\n return;\n }\n\n // Create original function call - mirroring stylelint's approach\n const originalFunctionCall = `${functionName}(${tokenName})`;\n const replacement = generateReplacement(tokenName, originalFunctionCall);\n \n if (replacement) {\n // Report with replacement suggestion\n context.report({\n node,\n messageId: 'deprecatedToken',\n data: { \n oldValue: originalFunctionCall,\n newValue: replacement\n },\n fix(fixer) {\n // Use node position to avoid multiple replacements of same token\n const sourceCode = context.sourceCode.getText();\n const tokenFunctionCall = `${functionName}(${tokenName})`;\n const nodeOffset = node.loc.start.offset;\n \n // Search backwards from the node position to find the function start\n const searchStart = Math.max(0, nodeOffset - functionName.length - 1);\n const searchEnd = nodeOffset + tokenName.length + 1;\n const searchArea = sourceCode.substring(searchStart, searchEnd);\n \n const functionCallIndex = searchArea.indexOf(tokenFunctionCall);\n if (functionCallIndex !== -1) {\n const actualStart = searchStart + functionCallIndex;\n const actualEnd = actualStart + tokenFunctionCall.length;\n return fixer.replaceTextRange([actualStart, actualEnd], replacement);\n }\n return null;\n }\n });\n } else {\n // Report without specific replacement\n context.report({\n node,\n messageId: 'noReplacement',\n });\n }\n }\n\n return {\n \"Function[name='token'] Identifier\"(node) {\n handleTokenFunction(node, 'token');\n },\n \"Function[name='t'] Identifier\"(node) {\n handleTokenFunction(node, 't');\n },\n };\n\n },\n} as Rule.RuleModule;\n", "import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata/next';\nimport ruleMessages from '../../config/rule-messages.yml';\n\nconst ruleConfig = ruleMessages['lwc-token-to-slds-hook'];\nconst { type, description, url, messages } = ruleConfig;\n\nconst lwcToSlds = metadata.lwcToSlds;\n\n// Replacement category enum to match Stylelint version\nenum ReplacementCategory {\n EMPTY = 'empty',\n SLDS_TOKEN = 'slds_token',\n ARRAY = 'array',\n RAW_VALUE = 'raw_value'\n}\n\nfunction shouldIgnoreDetection(lwcToken: string): boolean {\n // Ignore if entry not found in the list or the token is marked to use further\n return (\n !lwcToken.startsWith('--lwc-') ||\n !(lwcToken in lwcToSlds) ||\n lwcToSlds[lwcToken].continueToUse\n );\n}\n\nfunction categorizeReplacement(recommendation: string | string[]): ReplacementCategory {\n if (!recommendation || recommendation === '--') {\n return ReplacementCategory.EMPTY;\n }\n if (Array.isArray(recommendation)) {\n return ReplacementCategory.ARRAY;\n }\n if (typeof recommendation === 'string' && recommendation.startsWith('--slds-')) {\n return ReplacementCategory.SLDS_TOKEN;\n }\n return ReplacementCategory.RAW_VALUE;\n}\n\nfunction getRecommendation(lwcToken: string) {\n const oldValue = lwcToken;\n const recommendation = lwcToSlds[oldValue]?.replacement || '';\n const replacementCategory = categorizeReplacement(recommendation);\n const hasRecommendation = oldValue in lwcToSlds && replacementCategory !== ReplacementCategory.EMPTY;\n return { hasRecommendation, recommendation, replacementCategory };\n}\n\nfunction getReportMessage(cssVar: string, replacementCategory: ReplacementCategory, recommendation: string | string[]): { messageId: string, data: any } {\n if (!recommendation) {\n // Found a deprecated token but don't have any alternate recommendation then just report user to follow docs\n return {\n messageId: 'errorWithNoRecommendation',\n data: { oldValue: cssVar }\n };\n } else if (replacementCategory === ReplacementCategory.ARRAY) {\n return {\n messageId: 'errorWithStyleHooks',\n data: { oldValue: cssVar, newValue: (recommendation as string[]).join(' or ') }\n };\n } else if (replacementCategory === ReplacementCategory.SLDS_TOKEN) {\n return {\n messageId: 'errorWithStyleHooks',\n data: { oldValue: cssVar, newValue: recommendation as string }\n };\n } else {\n return {\n messageId: 'errorWithReplacement',\n data: { oldValue: cssVar, newValue: recommendation as string }\n };\n }\n}\n\nexport default {\n meta: {\n type,\n docs: {\n description,\n recommended: true,\n url,\n },\n fixable: 'code',\n messages,\n },\n \n create(context) {\n function reportAndFix(node, oldValue, suggestedMatch, messageId, data) {\n let fixFunction = null;\n \n // Only provide fix if we have a concrete suggestion\n if (suggestedMatch) {\n fixFunction = (fixer) => {\n // For Declaration nodes, use the offset from loc info\n if (node.type === \"Declaration\") {\n const sourceCode = context.sourceCode;\n const fullText = sourceCode.getText();\n const nodeOffset = node.loc.start.offset;\n \n // The property name appears at the start of the Declaration\n const propertyStart = nodeOffset;\n const propertyEnd = propertyStart + oldValue.length;\n \n // Verify we're replacing the right text\n const textAtPosition = fullText.substring(propertyStart, propertyEnd);\n if (textAtPosition === oldValue) {\n return fixer.replaceTextRange([propertyStart, propertyEnd], suggestedMatch);\n }\n } else {\n // For var() function replacements, we need to replace the entire function call\n const sourceCode = context.sourceCode;\n const fullText = sourceCode.getText();\n \n // Find the var() function call that contains this identifier\n const varFunctionCall = `var(${oldValue})`;\n const nodeOffset = node.loc.start.offset;\n \n // Search backwards to find the 'var(' part\n const searchStart = Math.max(0, nodeOffset - 4); // 'var('.length = 4\n const searchEnd = nodeOffset + oldValue.length + 1; // +1 for closing ')'\n const searchArea = fullText.substring(searchStart, searchEnd);\n \n const functionCallIndex = searchArea.indexOf(varFunctionCall);\n if (functionCallIndex !== -1) {\n const actualStart = searchStart + functionCallIndex;\n const actualEnd = actualStart + varFunctionCall.length;\n return fixer.replaceTextRange([actualStart, actualEnd], suggestedMatch);\n }\n }\n return null;\n };\n }\n\n context.report({\n node,\n messageId,\n data,\n fix: fixFunction\n });\n }\n\n return {\n // CSS custom property declarations: --lwc-* properties\n \"Declaration[property=/^--lwc-/]\"(node) {\n const property = node.property;\n \n if (shouldIgnoreDetection(property)) {\n return;\n }\n\n const { hasRecommendation, recommendation, replacementCategory } = getRecommendation(property);\n const { messageId, data } = getReportMessage(property, replacementCategory, recommendation);\n \n // Only provide auto-fix for SLDS token replacements\n const suggestedMatch = (hasRecommendation && replacementCategory === ReplacementCategory.SLDS_TOKEN) \n ? recommendation as string \n : null;\n \n reportAndFix(node, property, suggestedMatch, messageId, data);\n },\n\n // LWC tokens inside var() functions: var(--lwc-*)\n \"Function[name='var'] Identifier[name=/^--lwc-/]\"(node) {\n const tokenName = node.name;\n \n if (shouldIgnoreDetection(tokenName)) {\n return;\n }\n\n const { hasRecommendation, recommendation, replacementCategory } = getRecommendation(tokenName);\n const { messageId, data } = getReportMessage(tokenName, replacementCategory, recommendation);\n \n let suggestedMatch: string | null = null;\n \n if (hasRecommendation) {\n if (replacementCategory === ReplacementCategory.SLDS_TOKEN) {\n // Create the replacement in the format: var(--slds-token, var(--lwc-token))\n // This matches the Stylelint rule's behavior for SLDS tokens\n const originalVarCall = `var(${tokenName})`;\n suggestedMatch = `var(${recommendation}, ${originalVarCall})`;\n } else if (replacementCategory === ReplacementCategory.RAW_VALUE) {\n suggestedMatch = recommendation as string;\n }\n }\n\n reportAndFix(node, tokenName, suggestedMatch, messageId, data);\n },\n };\n },\n} as Rule.RuleModule;\n", "import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata/next';\nimport ruleMessages from '../../config/rule-messages.yml';\n\nconst ruleConfig = ruleMessages['enforce-sds-to-slds-hooks'];\nconst { type, description, url, messages } = ruleConfig;\n\nconst sldsPlusStylingHooks = metadata.sldsPlusStylingHooks;\n\n// Generate values to hooks mapping using only global hooks\n// shared hooks are private/ undocumented APIs, so they should not be recommended to customers\n// Ref this thread: https://salesforce-internal.slack.com/archives/C071J0Q3FNV/p1743010620921339?thread_ts=1743009353.385429&cid=C071J0Q3FNV\nconst allSldsHooks = [...sldsPlusStylingHooks.global, ...sldsPlusStylingHooks.component];\n\nconst toSldsToken = (sdsToken: string) => sdsToken.replace('--sds-', '--slds-');\n\nfunction shouldIgnoreDetection(sdsToken: string) {\n // Ignore if entry not found in the list\n return (\n !sdsToken.startsWith('--sds-') || !allSldsHooks.includes(toSldsToken(sdsToken))\n );\n}\n\nexport default {\n meta: {\n type,\n docs: {\n description,\n recommended: true,\n url,\n },\n fixable: 'code',\n messages,\n },\n \n create(context) {\n function reportAndFix(node, oldValue, suggestedMatch) {\n context.report({\n node,\n messageId: 'replaceSdsWithSlds',\n data: { oldValue, suggestedMatch },\n fix(fixer) {\n // For Declaration nodes, use the offset from loc info\n if (node.type === \"Declaration\") {\n const sourceCode = context.sourceCode;\n const fullText = sourceCode.getText();\n const nodeOffset = node.loc.start.offset;\n \n // The property name appears at the start of the Declaration\n const propertyStart = nodeOffset;\n const propertyEnd = propertyStart + oldValue.length;\n \n // Verify we're replacing the right text\n const textAtPosition = fullText.substring(propertyStart, propertyEnd);\n if (textAtPosition === oldValue) {\n return fixer.replaceTextRange([propertyStart, propertyEnd], suggestedMatch);\n }\n }\n \n // For Identifier nodes (inside var() functions), simple replacement works\n return fixer.replaceText(node, suggestedMatch);\n }\n });\n }\n\n return {\n // CSS custom property declarations: --sds-* properties\n \"Declaration[property=/^--sds-/]\"(node) {\n const property = node.property;\n \n if (shouldIgnoreDetection(property)) {\n return;\n }\n\n const suggestedMatch = toSldsToken(property);\n reportAndFix(node, property, suggestedMatch);\n },\n\n // SDS tokens inside var() functions: var(--sds-*)\n \"Function[name='var'] Identifier[name=/^--sds-/]\"(node) {\n const tokenName = node.name;\n \n if (shouldIgnoreDetection(tokenName)) {\n return;\n }\n\n const suggestedMatch = toSldsToken(tokenName);\n reportAndFix(node, tokenName, suggestedMatch);\n }\n };\n },\n} as Rule.RuleModule;\n", "import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata/next';\nimport ruleMessages from '../../config/rule-messages.yml';\n\nconst ruleConfig = ruleMessages['no-sldshook-fallback-for-lwctoken'];\nconst { type, description, url, messages } = ruleConfig;\n\nconst sldsPlusStylingHooks = metadata.sldsPlusStylingHooks;\n\n// Generate values to hooks mapping using only global hooks\n// shared hooks are private/ undocumented APIs, so they should not be recommended to customers\n// Ref this thread: https://salesforce-internal.slack.com/archives/C071J0Q3FNV/p1743010620921339?thread_ts=1743009353.385429&cid=C071J0Q3FNV\nconst allSldsHooks = [...sldsPlusStylingHooks.global, ...sldsPlusStylingHooks.component];\nconst allSldsHooksSet = new Set(allSldsHooks);\n\n/**\n * Check if using an SLDS hook as fallback for LWC token is unsupported\n */\nfunction hasUnsupportedFallback(lwcToken: string, sldsToken: string): boolean {\n // Convert --sds- to --slds- if needed\n const normalizedSldsToken = sldsToken.replace('--sds-', '--slds-');\n \n return lwcToken.startsWith('--lwc-') \n && normalizedSldsToken.startsWith('--slds-') \n && allSldsHooksSet.has(normalizedSldsToken);\n}\n\nexport default {\n meta: {\n type,\n docs: {\n description,\n recommended: true,\n url,\n },\n messages,\n },\n \n create(context) {\n return {\n // Handle LWC tokens inside var() functions: var(--lwc-*, ...)\n \"Function[name='var'] Identifier[name=/^--lwc-/]\"(node) {\n const lwcToken = node.name;\n \n // Get the var() function node that contains this identifier\n const varFunctionNode = context.sourceCode.getAncestors(node).at(-1);\n if (!varFunctionNode) return;\n \n //access children to find fallback\n const varFunctionChildren = (varFunctionNode as any).children;\n if (!varFunctionChildren) return;\n \n // Find comma operator and the Raw node after it\n let foundComma = false;\n let fallbackRawNode = null;\n \n for (const child of varFunctionChildren) {\n if (child.type === 'Operator' && child.value === ',') {\n foundComma = true;\n continue;\n }\n if (foundComma && child.type === 'Raw') {\n fallbackRawNode = child;\n break;\n }\n }\n \n if (!fallbackRawNode) return;\n \n // Extract SLDS token from the Raw node value\n const fallbackValue = fallbackRawNode.value.trim();\n const varMatch = fallbackValue.match(/var\\(([^,)]+)/);\n if (!varMatch) return;\n \n const sldsToken = varMatch[1];\n \n if (hasUnsupportedFallback(lwcToken, sldsToken)) {\n context.report({\n node,\n messageId: 'unsupportedFallback',\n data: { lwcToken, sldsToken }\n });\n }\n }\n };\n },\n} as Rule.RuleModule;\n", "import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata/next';\nimport ruleMessages from '../../config/rule-messages.yml';\n\nconst ruleConfig = ruleMessages['no-unsupported-hooks-slds2'];\nconst { type, description, url, messages } = ruleConfig;\n\nconst deprecatedHooks = new Set(metadata.deprecatedStylingHooks);\n\nfunction shouldIgnoreDetection(sldsHook: string): boolean {\n return !deprecatedHooks.has(sldsHook);\n}\n\nexport default {\n meta: {\n type,\n docs: {\n description,\n recommended: true,\n url,\n },\n messages,\n },\n \n create(context) {\n function reportDeprecatedHook(node, token: string) {\n context.report({\n node,\n messageId: 'deprecated',\n data: { token }\n });\n }\n\n return {\n // Handle CSS custom property declarations (left-side usage): --slds-* properties\n // Example: .THIS { --slds-g-link-color: #f73650; }\n \"Declaration[property=/^--s(lds|ds)-/]\"(node) {\n const property = node.property;\n \n if (shouldIgnoreDetection(property)) {\n return;\n }\n \n reportDeprecatedHook(node, property);\n },\n\n // Handle SLDS/SDS hooks inside var() functions (right-side usage): var(--slds-*)\n // Example: .THIS .demo { border-top: 1px solid var(--slds-g-color-border-brand-1); }\n \"Function[name='var'] Identifier[name=/^--s(lds|ds)-/]\"(node) {\n const tokenName = node.name;\n \n if (shouldIgnoreDetection(tokenName)) {\n return;\n }\n \n reportDeprecatedHook(node, tokenName);\n },\n };\n },\n} as Rule.RuleModule;\n", "import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata/next';\nimport ruleMessages from '../../config/rule-messages.yml';\n\nconst ruleConfig = ruleMessages['no-slds-var-without-fallback'];\nconst { type, description, url, messages } = ruleConfig;\n\n// Access the slds1ExcludedVars property from metadata\nconst sldsVariables = metadata.slds1ExcludedVars || {};\n\n/**\n * Check if a CSS variable name starts with --slds-\n */\nfunction isSldsCssVariable(cssVar: string): boolean {\n return cssVar.startsWith('--slds-');\n}\n\n/**\n * Checks if a var() function has a fallback value by looking for an Operator node with value \",\"\n */\nfunction hasFallbackValue(varFunctionNode: any): boolean {\n if (!varFunctionNode || !varFunctionNode.children) return false;\n \n // Look for an Operator node with value \",\" which indicates a fallback parameter\n return varFunctionNode.children.some((child: any) => \n child.type === 'Operator' && child.value === ','\n );\n}\n\nexport default {\n meta: {\n type,\n docs: {\n description,\n recommended: true,\n url,\n },\n fixable: 'code',\n messages,\n },\n \n create(context) {\n function reportAndFix(node, cssVar, fallbackValue) {\n context.report({\n node,\n messageId: 'varWithoutFallback',\n data: { cssVar, recommendation: fallbackValue },\n fix(fixer) {\n // Get the var() function node that contains this identifier\n const varFunctionNode = context.sourceCode.getAncestors(node).at(-1);\n \n // Replace the entire var() function with one that includes the fallback\n const varWithFallback = `var(${cssVar}, ${fallbackValue})`;\n return fixer.replaceText(varFunctionNode, varWithFallback);\n }\n });\n }\n\n return {\n // Handle SLDS tokens inside var() functions: var(--slds-*)\n \"Function[name='var'] Identifier[name=/^--slds-/]\"(node) {\n const cssVar = node.name;\n \n if (!isSldsCssVariable(cssVar)) {\n return;\n }\n\n // Get the var() function node that contains this identifier\n const varFunctionNode = context.sourceCode.getAncestors(node).at(-1);\n \n if (hasFallbackValue(varFunctionNode)) {\n return;\n }\n\n // Check if we have a fallback value for this SLDS variable\n const fallbackValue = sldsVariables[cssVar];\n \n if (!fallbackValue) {\n return;\n }\n\n reportAndFix(node, cssVar, fallbackValue);\n }\n };\n },\n} as Rule.RuleModule;\n", "import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata/next';\nimport ruleMessages from '../../config/rule-messages.yml';\n\nconst ruleConfig = ruleMessages['no-slds-namespace-for-custom-hooks'];\nconst { type, description, url, messages } = ruleConfig;\n\nconst sldsPlusStylingHooks = metadata.sldsPlusStylingHooks;\n\n// Generate values to hooks mapping using only global hooks\n// shared hooks are private/ undocumented APIs, so they should not be recommended to customers\n// Ref this thread: https://salesforce-internal.slack.com/archives/C071J0Q3FNV/p1743010620921339?thread_ts=1743009353.385429&cid=C071J0Q3FNV\nconst allSldsHooks = [...sldsPlusStylingHooks.global, ...sldsPlusStylingHooks.component];\n\nconst toSldsToken = (sdsToken: string) => sdsToken.replace('--sds-', '--slds-');\n\nfunction shouldIgnoreDetection(sdsToken: string): boolean {\n // Ignore if entry found in the list or not starts with reserved namespace\n if (sdsToken.startsWith('--sds-') || sdsToken.startsWith('--slds-')) {\n return allSldsHooks.includes(toSldsToken(sdsToken));\n }\n return true;\n}\n\nexport default {\n meta: {\n type,\n docs: {\n description,\n recommended: true,\n url,\n },\n messages,\n },\n \n create(context) {\n function reportViolation(node, token: string) {\n const tokenWithoutNamespace = token.replace('--slds-', '').replace('--sds-', '');\n \n context.report({\n node,\n messageId: 'customHookNamespace',\n data: { \n token,\n tokenWithoutNamespace\n }\n });\n }\n\n return {\n // CSS custom property declarations: --slds-* and --sds-* properties\n \"Declaration[property=/^--s(lds|ds)-/]\"(node) {\n const property = node.property;\n \n if (shouldIgnoreDetection(property)) {\n return;\n }\n \n reportViolation(node, property);\n },\n\n // SLDS/SDS tokens inside var() functions: var(--slds-*) or var(--sds-*)\n \"Function[name='var'] Identifier[name=/^--s(lds|ds)-/]\"(node) {\n const tokenName = node.name;\n \n if (shouldIgnoreDetection(tokenName)) {\n return;\n }\n \n reportViolation(node, tokenName);\n },\n };\n },\n} as Rule.RuleModule;\n", "import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata/next';\nimport ruleMessages from '../../config/rule-messages.yml';\n\nconst ruleConfig = ruleMessages['enforce-component-hook-naming-convention'];\nconst { type, description, url, messages } = ruleConfig;\n\nconst slds1DeprecatedComponentHooks = metadata.slds1DeprecatedComponentHooks;\n\n/**\n * Check if using a deprecated component hook that should be replaced\n */\nfunction shouldIgnoreDetection(hook: string): boolean {\n // Ignore if entry not found in the list\n return (\n !hook.startsWith('--slds-c-') || !(hook in slds1DeprecatedComponentHooks)\n );\n}\n\nexport default {\n meta: {\n type,\n docs: {\n description,\n recommended: true,\n url,\n },\n fixable: 'code',\n messages,\n },\n \n create(context) {\n return {\n /*\n * Handle component hooks in CSS declarations\n * Limitation: For example:\n * .testClass{\n * --slds-c-accordion-section-color-background: var(--slds-c-accordion-section-color-border);\n * }\n * var in value is not detected, because eslint treats above statement as custom property assignment \n * and value treated as raw string, not parsed into function nodes\n */\n \"Declaration[property=/^--slds-c-/], Function[name='var'] Identifier[name=/^--slds-c-/]\"(node) {\n let hookName: string;\n let reportNode = node;\n \n if (node.type === \"Declaration\") {\n // CSS custom property declaration: --slds-c-...\n hookName = node.property;\n } else if (node.type === \"Identifier\") {\n // Inside var() function: var(--slds-c-...)\n hookName = node.name;\n } else {\n return;\n }\n\n // Skip if hook should be ignored\n if (shouldIgnoreDetection(hookName)) {\n return;\n }\n\n const suggestedMatch = slds1DeprecatedComponentHooks[hookName];\n \n context.report({\n node: reportNode,\n messageId: 'replace',\n data: { \n oldValue: hookName,\n suggestedMatch: suggestedMatch\n },\n fix(fixer) {\n if (node.type === \"Declaration\") {\n // Replace the property name in CSS declaration\n const originalText = context.sourceCode.getText(node);\n const colonIndex = originalText.indexOf(':');\n const valuePartWithColon = originalText.substring(colonIndex);\n return fixer.replaceText(node, `${suggestedMatch}${valuePartWithColon}`);\n } else if (node.type === \"Identifier\") {\n // Replace the identifier name in var() function\n return fixer.replaceText(node, suggestedMatch);\n }\n return null;\n }\n });\n }\n };\n },\n} as Rule.RuleModule;\n", "import { Rule } from 'eslint';\nimport ruleMessages from '../../config/rule-messages.yml';\n\nconst ruleConfig = ruleMessages['reduce-annotations'];\nconst { type, description, url, messages } = ruleConfig;\n\n// SLDS validator annotations to detect and flag for removal\nconst SLDS_ANNOTATIONS = [\n \"@sldsValidatorIgnoreNextLine\", \n \"@sldsValidatorAllow\", \n \"@sldsValidatorIgnore\"\n];\n\nexport default {\n meta: {\n type,\n docs: {\n description,\n recommended: true,\n url,\n },\n messages,\n },\n \n create(context) {\n return {\n StyleSheet(node) {\n const sourceCode = context.sourceCode;\n \n let comments = (sourceCode as any)?.comments || [];\n\n comments.forEach(comment => {\n const commentContent = comment.value.trim();\n \n const matchingAnnotation = SLDS_ANNOTATIONS.find(annotation => \n commentContent.startsWith(annotation)\n );\n \n if (matchingAnnotation) {\n context.report({\n node: comment,\n messageId: 'removeAnnotation'\n });\n }\n });\n },\n };\n },\n} as Rule.RuleModule;\n", "import { Rule } from 'eslint';\nimport ruleMessages from '../../config/rule-messages.yml';\n\nconst ruleConfig = ruleMessages['no-slds-private-var'];\nconst { type, description, url, messages } = ruleConfig;\n\nexport default {\n meta: {\n type,\n docs: {\n description,\n recommended: true,\n url,\n },\n fixable: 'code',\n messages\n },\n \n create(context) {\n return {\n // Handle CSS custom properties (declarations starting with --)\n \"Declaration\"(node) {\n // Check if this is a custom property declaration\n if (node.property && typeof node.property === 'string' && node.property.startsWith('--_slds-')) {\n context.report({\n node,\n messageId: 'privateVar',\n data: { prop: node.property },\n fix(fixer) {\n // Auto-fix: replace --_slds- with --slds-\n const newProperty = node.property.replace('--_slds-', '--slds-');\n const sourceCode = context.sourceCode.getText(node);\n const fixedCode = sourceCode.replace(node.property, newProperty);\n return fixer.replaceText(node, fixedCode);\n }\n });\n }\n },\n };\n },\n} as Rule.RuleModule;\n", "import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata/next';\nimport ruleMessages from '../../../config/rule-messages.yml';\nimport { defineNoHardcodedValueRule } from './noHardcodedValueRule';\n\nconst ruleConfig = ruleMessages['no-hardcoded-values-slds1'];\nconst { type, description, url, messages } = ruleConfig;\n\nconst valueToStylinghook = metadata.valueToStylingHooksSlds;\n\nexport default defineNoHardcodedValueRule({\n ruleConfig,\n valueToStylinghook,\n}) as Rule.RuleModule;\n\n", "//stylelint-sds/packages/stylelint-plugin-slds/src/utils/color-lib-utils.ts\nimport { ValueToStylingHooksMapping, ValueToStylingHookEntry } from '@salesforce-ux/sds-metadata/next';\nimport chroma from 'chroma-js';\nimport { generate } from '@eslint/css-tree';\nimport { isCssColorFunction } from './css-functions';\n\nconst LAB_THRESHOLD = 25; // Adjust this to set how strict the matching should be\n\nconst isHardCodedColor = (color: string): boolean => {\n const colorRegex =\n /\\b(rgb|rgba)\\((\\s*\\d{1,3}\\s*,\\s*){2,3}\\s*(0|1|0?\\.\\d+)\\s*\\)|#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})\\b|[a-zA-Z]+/g;\n return colorRegex.test(color);\n};\n\nconst isHexCode = (color: string): boolean => {\n const hexPattern = /^#(?:[0-9a-fA-F]{3}){1,2}$/; // Pattern for #RGB or #RRGGBB\n return hexPattern.test(color);\n};\n\n// Convert a named color or hex code into a hex format using chroma-js\nconst convertToHex = (color: string): string | null => {\n try {\n // Try converting the color using chroma-js, which handles both named and hex colors\n return chroma(color).hex();\n } catch (e) {\n // If chroma can't process the color, it's likely invalid\n return null;\n }\n};\n\n// Find the closest color hook using LAB distance\nconst findClosestColorHook = (\n color: string,\n supportedColors:ValueToStylingHooksMapping,\n cssProperty: string\n): string[] => {\n const returnStylingHooks: string[] = [];\n const closestHooksWithSameProperty: { name: string; distance: number }[] = [];\n const closestHooksWithoutSameProperty: { name: string; distance: number }[] =\n [];\n const closestHooksWithAllProperty: { name: string; distance: number }[] =\n [];\n const labColor = chroma(color).lab();\n\n Object.entries(supportedColors).forEach(([sldsValue, data]) => {\n if (sldsValue && isHexCode(sldsValue)) {\n const hooks = data as ValueToStylingHookEntry[]; // Get the hooks for the sldsValue\n\n hooks.forEach((hook) => {\n const labSupportedColor = chroma(sldsValue).lab();\n const distance = (JSON.stringify(labColor) === JSON.stringify(labSupportedColor)) ? 0\n : chroma.distance(chroma.lab(...labColor), chroma.lab(...labSupportedColor), \"lab\");\n // Check if the hook has the same property\n if (hook.properties.includes(cssProperty)) {\n // Add to same property hooks if within threshold\n if (distance <= LAB_THRESHOLD) {\n closestHooksWithSameProperty.push({ name: hook.name, distance });\n }\n } \n // Check for the universal selector\n else if ( hook.properties.includes(\"*\") ){\n // Add to same property hooks if within threshold\n if (distance <= LAB_THRESHOLD) {\n closestHooksWithAllProperty.push({ name: hook.name, distance });\n }\n }\n else {\n // Add to different property hooks if within threshold\n if (distance <= LAB_THRESHOLD) {\n closestHooksWithoutSameProperty.push({ name: hook.name, distance });\n }\n }\n });\n }\n });\n\n// Group hooks by their priority\nconst closesthookGroups = [\n { hooks: closestHooksWithSameProperty, distance: 0 },\n { hooks: closestHooksWithAllProperty, distance: 0 },\n { hooks: closestHooksWithSameProperty, distance: Infinity }, // For hooks with distance > 0\n { hooks: closestHooksWithAllProperty, distance: Infinity },\n { hooks: closestHooksWithoutSameProperty, distance: Infinity },\n];\n\nfor (const group of closesthookGroups) {\n // Filter hooks based on the distance condition\n const filteredHooks = group.hooks.filter(h => \n group.distance === 0 ? h.distance === 0 : h.distance > 0\n );\n\n if (returnStylingHooks.length < 1 && filteredHooks.length > 0) {\n filteredHooks.sort((a, b) => a.distance - b.distance);\n returnStylingHooks.push(...filteredHooks.slice(0, 5).map((h) => h.name));\n }\n}\n\n\n return Array.from(new Set(returnStylingHooks));\n};\n\n/**\n * This method is usefull to identify all possible css color values.\n * - names colors\n * - 6,8 digit hex\n * - rgb and rgba\n * - hsl and hsla\n */\nconst isValidColor = (val:string):boolean => chroma.valid(val);\n\n/**\n * Extract color value from CSS AST node\n */\nconst extractColorValue = (node: any): string | null => {\n let colorValue: string | null = null;\n \n switch (node.type) {\n case 'Hash':\n colorValue = `#${node.value}`;\n break;\n case 'Identifier':\n colorValue = node.name;\n break;\n case 'Function':\n // Only extract color functions\n if (isCssColorFunction(node.name)) {\n colorValue = generate(node);\n }\n break;\n }\n \n return colorValue && isValidColor(colorValue) ? colorValue : null;\n};\n\nexport { findClosestColorHook, convertToHex, isHexCode, isHardCodedColor, isValidColor, extractColorValue };\n", "//stylelint-sds/packages/stylelint-plugin-slds/src/utils/css-functions.ts\n/**\n * Complete list of CSS functions that should be preserved/recognized\n */\nconst CSS_FUNCTIONS = [\n 'attr',\n 'calc',\n 'color-mix',\n 'conic-gradient',\n 'counter',\n 'cubic-bezier',\n 'linear-gradient',\n 'max',\n 'min',\n 'radial-gradient',\n 'repeating-conic-gradient',\n 'repeating-linear-gradient',\n 'repeating-radial-gradient',\n 'var'\n ];\n \n \n const CSS_MATH_FUNCTIONS = ['calc', 'min', 'max'];\n \n \n const RGB_COLOR_FUNCTIONS = ['rgb', 'rgba', 'hsl', 'hsla'];\n \n /**\n * Regex for matching any CSS function (for general detection)\n * Matches function names within other text\n */\n const cssFunctionsRegex = new RegExp(`(?:${CSS_FUNCTIONS.join('|')})`);\n \n \n const cssFunctionsExactRegex = new RegExp(`^(?:${CSS_FUNCTIONS.join('|')})$`);\n \n \n const cssMathFunctionsRegex = new RegExp(`^(?:${CSS_MATH_FUNCTIONS.join('|')})$`);\n \n export function containsCssFunction(value: string): boolean {\n return cssFunctionsRegex.test(value);\n }\n \n /**\n * Check if a value is exactly a CSS function name\n */\n export function isCssFunction(value: string): boolean {\n return cssFunctionsExactRegex.test(value);\n }\n \n export function isCssMathFunction(value: string): boolean {\n return cssMathFunctionsRegex.test(value);\n }\n \n export function isCssColorFunction(value: string): boolean {\n return RGB_COLOR_FUNCTIONS.includes(value);\n }", "///stylelint-sds/packages/stylelint-plugin-slds/src/utils/property-matcher.ts\n/**\n * Check if any of the hook properties match the provided cssProperty using wildcard matching.\n * @param hookProperties - Array of property patterns (can contain wildcards like `*`)\n * @param cssProperty - The CSS property to be checked\n * @returns true if a match is found, otherwise false\n */\nexport function matchesCssProperty(\n hookProperties: string[],\n cssProperty: string\n): boolean {\n return hookProperties.some((propertyPattern: string) => {\n const regexPattern = new RegExp(\n '^' + propertyPattern.replace(/\\*/g, '.*') + '$'\n );\n return regexPattern.test(cssProperty);\n });\n}\n\n// Directions & Corners\nconst DIRECTION_VALUES = '(?:top|right|bottom|left|inline|block|inline-start|inline-end|start|end|block-start|block-end)';\nconst CORNER_VALUES = '(?:top-left|top-right|bottom-right|bottom-left|start-start|start-end|end-start|end-end)';\nconst INSET_VALUES = '(?:inline|block|inline-start|inline-end|block-start|block-end)';\n\n\n// Pre-compiled regex patterns for better performance\nconst BORDER_COLOR_REGEX = new RegExp(`^border(?:-${DIRECTION_VALUES})?-color$`);\nconst BORDER_WIDTH_REGEX = new RegExp(`^border(?:-${DIRECTION_VALUES})?-width$`);\nconst MARGIN_REGEX = new RegExp(`^margin(?:-${DIRECTION_VALUES})?$`);\nconst PADDING_REGEX = new RegExp(`^padding(?:-${DIRECTION_VALUES})?$`);\nconst BORDER_RADIUS_REGEX = new RegExp(`^border(?:-${CORNER_VALUES})?-radius$`);\nconst INSET_REGEX = new RegExp(`^inset(?:-${INSET_VALUES})?$`);\n\nexport function isBorderColorProperty(cssProperty: string): boolean {\n return BORDER_COLOR_REGEX.test(cssProperty);\n}\n\nexport function isBorderWidthProperty(cssProperty: string): boolean {\n return BORDER_WIDTH_REGEX.test(cssProperty);\n}\n\nexport function isMarginProperty(cssProperty: string): boolean {\n return MARGIN_REGEX.test(cssProperty);\n}\n\nexport function isPaddingProperty(cssProperty: string): boolean {\n return PADDING_REGEX.test(cssProperty);\n}\n\nexport function isBorderRadius(cssProperty: string): boolean {\n return BORDER_RADIUS_REGEX.test(cssProperty);\n}\n\nexport function isDimensionProperty(cssProperty: string): boolean {\n return ['width', 'height', 'min-width', 'max-width', 'min-height', 'max-height'].includes(cssProperty);\n}\n\nexport function isInsetProperty(cssProperty: string): boolean {\n return INSET_REGEX.test(cssProperty);\n}\n\nexport const fontProperties = [\n 'font',\n 'font-size', \n 'font-weight'\n];\n\nexport const colorProperties = [\n 'color',\n 'fill',\n 'background',\n 'background-color',\n 'stroke',\n 'border',\n 'border*',\n 'border*-color',\n 'outline',\n 'outline-color',\n];\n\nexport const densificationProperties = [\n 'border*',\n 'margin*',\n 'padding*',\n 'width',\n 'height',\n 'min-width',\n 'max-width',\n 'min-height',\n 'max-height',\n 'inset',\n 'top',\n 'right',\n 'left',\n 'bottom',\n 'outline',\n 'outline-width',\n 'line-height'\n]; \n\n/**\n * Convert property patterns to CSS AST selector patterns\n * Handles wildcards (*) and creates proper ESLint CSS selector syntax\n */\nexport function toSelector(properties: string[]): string {\n const selectorParts = properties.map(prop => {\n if (prop.includes('*')) {\n // Convert wildcards to regex patterns for CSS AST selectors\n const regexPattern = prop.replace(/\\*/g, '.*');\n return `Declaration[property=/${regexPattern}$/]`;\n } else {\n // Exact property match\n return `Declaration[property='${prop}']`;\n }\n });\n \n return selectorParts.join(', ');\n}\n\nexport function resolvePropertyToMatch(cssProperty:string){\n const propertyToMatch = cssProperty.toLowerCase();\n if(propertyToMatch === 'outline' || propertyToMatch === 'outline-width' || isBorderWidthProperty(propertyToMatch)){\n return 'border-width';\n } else if(isMarginProperty(propertyToMatch)){\n return 'margin';\n } else if(isPaddingProperty(propertyToMatch)){\n return 'padding';\n } else if(isBorderRadius(propertyToMatch)){\n return 'border-radius';\n } else if(isDimensionProperty(propertyToMatch)){\n // Stylinghooks includes only width as property to match, for all other dimensions we need to match width\n return 'width';\n } else if(isInsetProperty(propertyToMatch)){\n // Stylinghooks includes only top/left/right/bottom as property to match, for all other insets we need to match top\n return 'top';\n } else if(cssProperty === 'background' || cssProperty === 'background-color'){\n return 'background-color';\n } else if(cssProperty === 'outline' || cssProperty === 'outline-color' || isBorderColorProperty(cssProperty)){\n return 'border-color';\n }\n return propertyToMatch;\n}", "import { parse, walk } from '@eslint/css-tree';\nimport type { HandlerContext } from '../types';\nimport type { ParsedUnitValue } from './value-utils';\nimport { extractColorValue } from './color-lib-utils';\nimport { isCssFunction } from './css-functions';\n\n/**\n * Common replacement data structure used by both color and density handlers\n */\nexport interface ReplacementInfo {\n start: number;\n end: number;\n replacement: string; // Full CSS var: var(--hook, fallback)\n displayValue: string; // Just the hook: --hook\n hasHook: boolean;\n}\n\n/**\n * Position information from CSS tree parsing\n */\nexport interface PositionInfo {\n start?: { offset: number; line: number; column: number };\n end?: { offset: number; line: number; column: number };\n}\n\n/**\n * Generic callback for processing values with position information\n */\nexport type ValueCallback<T> = (value: T, positionInfo?: PositionInfo) => void;\n\n/**\n * Known valid font-weight values\n */\nconst FONT_WEIGHTS = [\n 'normal',\n 'bold', \n 'bolder',\n 'lighter',\n '100',\n '200', \n '300',\n '400',\n '500',\n '600',\n '700',\n '800',\n '900'\n];\n\n/**\n * Check if a value is a known font-weight\n */\nexport function isKnownFontWeight(value: string | number): boolean {\n const stringValue = value.toString();\n return FONT_WEIGHTS.includes(stringValue.toLowerCase());\n}\n\n/**\n * Generic shorthand auto-fix handler\n * Handles the common logic for reconstructing shorthand values with replacements\n */\nexport function handleShorthandAutoFix(\n declarationNode: any,\n context: HandlerContext,\n valueText: string,\n replacements: ReplacementInfo[]\n) {\n // Sort replacements by position for proper reconstruction\n const sortedReplacements = replacements.sort((a, b) => a.start - b.start);\n \n // Check if we can apply auto-fix (at least one value has a hook)\n const hasAnyHooks = sortedReplacements.some(r => r.hasHook);\n const canAutoFix = hasAnyHooks;\n\n // Report each individual value\n sortedReplacements.forEach(({ start, end, replacement, displayValue, hasHook }) => {\n const originalValue = valueText.substring(start, end);\n const valueStartColumn = declarationNode.value.loc.start.column;\n const valueColumn = valueStartColumn + start;\n \n // Create precise error location for this value\n const { loc: { start: locStart, end: locEnd } } = declarationNode.value;\n const reportNode = {\n ...declarationNode.value,\n loc: {\n ...declarationNode.value.loc,\n start: {\n ...locStart,\n column: valueColumn\n },\n end: {\n ...locEnd,\n column: valueColumn + originalValue.length\n }\n }\n };\n\n if (hasHook) {\n // Create auto-fix for the entire shorthand value\n const fix = canAutoFix ? (fixer: any) => {\n // Reconstruct the entire value with all replacements\n let newValue = valueText;\n \n // Apply replacements from right to left to maintain string positions\n for (let i = sortedReplacements.length - 1; i >= 0; i--) {\n const { start: rStart, end: rEnd, replacement: rReplacement } = sortedReplacements[i];\n newValue = newValue.substring(0, rStart) + rReplacement + newValue.substring(rEnd);\n }\n \n return fixer.replaceText(declarationNode.value, newValue);\n } : undefined;\n\n context.context.report({\n node: reportNode,\n messageId: 'hardcodedValue',\n data: {\n oldValue: originalValue,\n newValue: displayValue\n },\n fix\n });\n } else {\n // No hook available\n context.context.report({\n node: reportNode,\n messageId: 'noReplacement',\n data: {\n oldValue: originalValue\n }\n });\n }\n });\n}\n\n/**\n * Generic CSS tree traversal with position tracking\n * Always provides position information since both handlers need it\n */\nexport function forEachValue<T>(\n valueText: string,\n extractValue: (node: any) => T | null,\n shouldSkipNode: (node: any) => boolean,\n callback: (value: T, positionInfo: PositionInfo) => void\n): void {\n if (!valueText || typeof valueText !== 'string') {\n return;\n }\n\n try {\n const ast = parse(valueText, { context: 'value' as const, positions: true });\n \n walk(ast, {\n enter(node: any) {\n // Skip nodes efficiently using this.skip\n if (shouldSkipNode(node)) {\n return this.skip;\n }\n \n const value = extractValue(node);\n if (value !== null) {\n const positionInfo: PositionInfo = {\n start: node.loc?.start,\n end: node.loc?.end\n };\n callback(value, positionInfo);\n }\n }\n });\n } catch (error) {\n // Silently handle parse errors\n return;\n }\n}\n\n/**\n * Check if color node should be skipped during traversal\n */\nfunction shouldSkipColorNode(node: any): boolean {\n return node.type === 'Function' && isCssFunction(node.name);\n}\n\n/**\n * Check if dimension node should be skipped during traversal\n * Skip all function nodes by default\n */\nfunction shouldSkipDimensionNode(node: any): boolean {\n return node.type === 'Function';\n}\n\n/**\n * Extract dimension value from CSS AST node\n * Returns structured data with number and unit to eliminate regex parsing\n */\nfunction extractDimensionValue(valueNode: any, cssProperty?: string): ParsedUnitValue | null {\n if (!valueNode) return null;\n \n switch (valueNode.type) {\n case 'Dimension':\n // Dimensions: 16px, 1rem -> extract value and unit directly from AST\n const numValue = Number(valueNode.value);\n if (numValue === 0) return null; // Skip zero values\n \n const unit = valueNode.unit.toLowerCase();\n if (unit !== 'px' && unit !== 'rem' && unit !== '%') return null; // Support px, rem, and % units\n \n return {\n number: numValue,\n unit: unit as 'px' | 'rem' | '%'\n };\n \n case 'Number':\n // Numbers: 400, 1.5 -> treat as unitless (font-weight, line-height, etc.)\n const numberValue = Number(valueNode.value);\n if (numberValue === 0) return null; // Skip zero values\n \n return {\n number: numberValue,\n unit: null\n };\n \n case 'Percentage':\n // Percentage values: 100%, 50% -> extract value and add % unit\n const percentValue = Number(valueNode.value);\n if (percentValue === 0) return null; // Skip zero values\n \n return {\n number: percentValue,\n unit: '%'\n };\n \n case 'Value':\n // Value wrapper - extract from first child\n return valueNode.children?.[0] ? extractDimensionValue(valueNode.children[0], cssProperty) : null;\n }\n \n return null;\n}\n\n/**\n * Specialized color value traversal\n * Handles color-specific extraction and skipping logic\n */\nexport function forEachColorValue(\n valueText: string,\n callback: (colorValue: string, positionInfo: PositionInfo) => void\n): void {\n forEachValue(valueText, extractColorValue, shouldSkipColorNode, callback);\n}\n\n/**\n * Specialized density value traversal\n * Handles dimension-specific extraction and skipping logic\n */\nexport function forEachDensityValue(\n valueText: string,\n cssProperty: string,\n callback: (parsedDimension: ParsedUnitValue, positionInfo: PositionInfo) => void\n): void {\n forEachValue(\n valueText, \n (node) => extractDimensionValue(node, cssProperty), \n shouldSkipDimensionNode, \n callback\n );\n}\n\n/**\n * Extract font-related values from CSS AST node\n * Handles font-size and font-weight values\n */\nfunction extractFontValue(node: any): ParsedUnitValue | null {\n if (!node) return null;\n \n switch (node.type) {\n case 'Dimension':\n // Font-size: 16px, 1rem, etc.\n const numValue = Number(node.value);\n if (numValue <= 0) return null; // Skip zero/negative values\n \n const unit = node.unit.toLowerCase();\n if (unit !== 'px' && unit !== 'rem' && unit !== '%') return null;\n \n return {\n number: numValue,\n unit: unit as 'px' | 'rem' | '%'\n };\n \n case 'Number':\n // Font-weight: 400, 700, etc.\n const numberValue = Number(node.value);\n if (numberValue <= 0) {\n return null; // Skip zero/negative values\n }\n \n // Only accept known font-weight values for unitless numbers\n if (!isKnownFontWeight(numberValue)) {\n return null; // Skip values that aren't valid font-weights\n }\n \n return {\n number: numberValue,\n unit: null\n };\n \n case 'Identifier':\n // Font-weight keywords: normal, bold, etc.\n const namedValue = node.name.toLowerCase();\n \n // Only accept known font-weight keywords\n if (!isKnownFontWeight(namedValue)) {\n return null;\n }\n \n // Convert known keywords to numeric values\n if (namedValue === 'normal') {\n return { number: 400, unit: null };\n }\n \n // For other keywords (bolder, lighter), we can't determine exact numeric value\n // but we know they're valid font-weight values\n return { number: namedValue, unit: null };\n \n case 'Percentage':\n // Percentage values for font-size\n const percentValue = Number(node.value);\n if (percentValue === 0) return null; // Skip zero values\n \n return {\n number: percentValue,\n unit: '%'\n };\n \n case 'Value':\n // Value wrapper - extract from first child\n return node.children?.[0] ? extractFontValue(node.children[0]) : null;\n }\n \n return null;\n}\n\n/**\n * Check if font node should be skipped during traversal\n * Skip all function nodes by default\n */\nfunction shouldSkipFontNode(node: any): boolean {\n return node.type === 'Function';\n}\n\n/**\n * Specialized font value traversal\n * Handles font-specific extraction and skipping logic\n */\nexport function forEachFontValue(\n valueText: string,\n callback: (fontValue: ParsedUnitValue, positionInfo: PositionInfo) => void\n): void {\n forEachValue(valueText, extractFontValue, shouldSkipFontNode, callback);\n}\n", "import { findClosestColorHook, convertToHex, isValidColor } from '../../../../utils/color-lib-utils';\nimport { resolvePropertyToMatch } from '../../../../utils/property-matcher';\nimport type { HandlerContext, DeclarationHandler } from '../../../../types';\n\n// Import shared utilities for common logic\nimport { \n handleShorthandAutoFix, \n forEachColorValue,\n type ReplacementInfo,\n type PositionInfo\n} from '../../../../utils/hardcoded-shared-utils';\n\n/**\n * Handle color declarations using CSS tree parsing\n * Supports shorthand properties like background, border, etc. \n * Uses css-tree for reliable AST-based parsing + chroma-js validation\n */\nexport const handleColorDeclaration: DeclarationHandler = (node: any, context: HandlerContext) => {\n const cssProperty = node.property.toLowerCase();\n const valueText = context.sourceCode.getText(node.value);\n const replacements: ReplacementInfo[] = [];\n \n forEachColorValue(valueText, (colorValue, positionInfo) => {\n if (colorValue !== 'transparent' && isValidColor(colorValue)) {\n const replacement = createColorReplacement(colorValue, cssProperty, context, positionInfo, valueText);\n if (replacement) {\n replacements.push(replacement);\n }\n }\n });\n \n // Apply shorthand auto-fix once all values are processed\n handleShorthandAutoFix(node, context, valueText, replacements);\n};\n\n\n\n\n\n/**\n * Create color replacement info for shorthand auto-fix\n * Returns replacement data or null if no valid replacement\n */\nfunction createColorReplacement(\n colorValue: string,\n cssProperty: string,\n context: HandlerContext,\n positionInfo: PositionInfo,\n originalValueText?: string\n): ReplacementInfo | null {\n if (!positionInfo?.start) {\n return null;\n }\n\n const hexValue = convertToHex(colorValue);\n if (!hexValue) {\n return null;\n }\n\n const propToMatch = resolvePropertyToMatch(cssProperty);\n const closestHooks = findClosestColorHook(hexValue, context.valueToStylinghook, propToMatch);\n\n // Use position information directly from CSS tree (already 0-based offsets)\n const start = positionInfo.start.offset;\n const end = positionInfo.end.offset;\n \n // Extract the original value from the CSS text to preserve spacing\n const originalValue = originalValueText ? originalValueText.substring(start, end) : colorValue;\n\n if (closestHooks.length === 1) {\n // Has a single hook replacement - should provide autofix\n return {\n start,\n end,\n replacement: `var(${closestHooks[0]}, ${colorValue})`,\n displayValue: closestHooks[0],\n hasHook: true\n };\n } else if (closestHooks.length > 1) {\n // Multiple hooks - still has hooks, but no auto-fix\n return {\n start,\n end,\n replacement: originalValue, // Use original value to preserve spacing\n displayValue: closestHooks.join(', '),\n hasHook: true // \u2190 THE FIX: Multiple hooks still means \"has hooks\"\n };\n } else {\n // No hooks - keep original value\n return {\n start,\n end,\n replacement: originalValue, // Use original value to preserve spacing\n displayValue: originalValue,\n hasHook: false\n };\n }\n}\n\n\n\n\n\n", "// Simplified value parsing\n\n/**\n * Checks if a value is a CSS global value.\n *\n * CSS global values are special keywords that can be used for any CSS property and have a universal meaning:\n * - initial: Resets the property to its initial value as defined by the CSS specification.\n * - inherit: Inherits the value from the parent element.\n * - unset: Acts as inherit if the property is inheritable, otherwise acts as initial.\n * - revert: Rolls back the property to the value established by the user-agent or user styles.\n * - revert-layer: Rolls back the property to the value established by the previous cascade layer.\n *\n * All CSS properties accept these global values, including but not limited to:\n * - color\n * - background\n * - font-size\n * - margin\n * - padding\n * - border\n * - display\n * - position\n * - z-index\n * - and many more\n *\n * These values are part of the CSS standard and are not considered violations, even if a rule would otherwise flag a value as invalid or non-design-token. They are always allowed for any property.\n *\n * @param value The CSS value to check.\n * @returns True if the value is a CSS global value, false otherwise.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/initial\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/inherit\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/unset\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/revert\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/revert-layer\n */\nexport function isGlobalValue(value: string): boolean {\n return value === 'initial' || value === 'inherit' || value === 'unset' || value === 'revert' || value === 'revert-layer';\n }\n\nexport type ParsedUnitValue = {\n unit: 'px' | 'rem' | '%' | null;\n number: number;\n} | null;\n\nexport function parseUnitValue(value: string): ParsedUnitValue {\n if (!value) return null;\n \n // Simple regex to parse number and unit\n const match = value.match(/^(-?\\d*\\.?\\d+)(px|rem|%)?$/);\n if (!match) return null;\n \n const number = parseFloat(match[1]);\n const unit = match[2] ? (match[2] as 'px' | 'rem' | '%') : null; // Keep unitless values as null\n \n if (isNaN(number)) return null;\n \n return { number, unit };\n}\n\nexport function toAlternateUnitValue(numberVal: number, unitType: 'px' | 'rem' | '%' | null): ParsedUnitValue {\n if (unitType === 'px') {\n let floatValue = parseFloat(`${numberVal / 16}`);\n if (!isNaN(floatValue)) {\n return {\n unit: 'rem',\n number: parseFloat(floatValue.toFixed(4))\n }\n }\n } else if (unitType === 'rem') {\n const intValue = parseInt(`${numberVal * 16}`);\n if (!isNaN(intValue)) {\n return {\n unit: 'px',\n number: intValue\n }\n }\n }\n // For unitless values (font-weight, etc.), no alternate unit conversion\n return null;\n}", "import type { ValueToStylingHookEntry, ValueToStylingHooksMapping } from '@salesforce-ux/sds-metadata/next';\nimport { ParsedUnitValue, parseUnitValue, toAlternateUnitValue } from './value-utils';\n\nfunction isValueMatch(valueToMatch: ParsedUnitValue, sldsValue: ParsedUnitValue): boolean {\n if (!valueToMatch || !sldsValue) {\n return false;\n }\n return valueToMatch.unit == sldsValue.unit && valueToMatch.number === sldsValue.number;\n}\n\n/**\n * Get styling hooks for a density value using structured data from CSS AST\n * Eliminates regex parsing by accepting pre-parsed dimension data\n */\nexport function getStylingHooksForDensityValue(\n parsedValue: ParsedUnitValue,\n supportedStylinghooks: ValueToStylingHooksMapping,\n cssProperty: string\n): string[] {\n if (!parsedValue) return [];\n \n const alternateValue = toAlternateUnitValue(parsedValue.number, parsedValue.unit);\n const matchedHooks = [];\n\n for (const [sldsValue, hooks] of Object.entries(supportedStylinghooks)) {\n // parsing SLDS metadata values\n const parsedSldsValue = parseUnitValue(sldsValue);\n if (isValueMatch(parsedValue, parsedSldsValue) || (alternateValue && isValueMatch(alternateValue, parsedSldsValue))) {\n hooks\n .filter((hook: ValueToStylingHookEntry) => hook.properties.includes(cssProperty))\n .forEach((hook) => matchedHooks.push(hook.name));\n }\n }\n return matchedHooks;\n}", "import { getStylingHooksForDensityValue } from '../../../../utils/styling-hook-utils';\nimport { resolvePropertyToMatch } from '../../../../utils/property-matcher';\nimport type { ParsedUnitValue } from '../../../../utils/value-utils';\nimport type { HandlerContext, DeclarationHandler } from '../../../../types';\n\n\n\n// Import shared utilities for common logic\nimport { \n handleShorthandAutoFix, \n forEachDensityValue,\n type ReplacementInfo,\n type PositionInfo\n} from '../../../../utils/hardcoded-shared-utils';\n\n/**\n * Handle density/sizing declarations using CSS tree parsing\n * Supports shorthand properties like padding, margin, etc.\n * Uses css-tree for reliable AST-based parsing\n */\nexport const handleDensityDeclaration: DeclarationHandler = (node: any, context: HandlerContext) => {\n const cssProperty = node.property.toLowerCase();\n const valueText = context.sourceCode.getText(node.value);\n const replacements: ReplacementInfo[] = [];\n \n forEachDensityValue(valueText, cssProperty, (parsedDimension, positionInfo) => {\n if (parsedDimension) {\n const replacement = createDimensionReplacement(parsedDimension, cssProperty, context, positionInfo);\n if (replacement) {\n replacements.push(replacement);\n }\n }\n });\n \n // Apply shorthand auto-fix once all values are processed\n handleShorthandAutoFix(node, context, valueText, replacements);\n};\n\n\n\n/**\n * Create dimension replacement info for shorthand auto-fix\n * Returns replacement data or null if no valid replacement\n */\nfunction createDimensionReplacement(\n parsedDimension: ParsedUnitValue,\n cssProperty: string,\n context: HandlerContext,\n positionInfo: PositionInfo\n): ReplacementInfo | null {\n if (!parsedDimension || !positionInfo?.start) {\n return null;\n }\n\n const rawValue = parsedDimension.unit \n ? `${parsedDimension.number}${parsedDimension.unit}`\n : parsedDimension.number.toString();\n\n const propToMatch = resolvePropertyToMatch(cssProperty);\n const closestHooks = getStylingHooksForDensityValue(parsedDimension, context.valueToStylinghook, propToMatch);\n\n // Use position information directly from CSS tree (already 0-based offsets)\n const start = positionInfo.start.offset;\n const end = positionInfo.end.offset;\n\n if (closestHooks.length === 1) {\n // Has a single hook replacement\n return {\n start,\n end,\n replacement: `var(${closestHooks[0]}, ${rawValue})`,\n displayValue: closestHooks[0],\n hasHook: true\n };\n } else if (closestHooks.length > 1) {\n // Multiple hooks - still has hooks, but no auto-fix\n return {\n start,\n end,\n replacement: rawValue,\n displayValue: closestHooks.join(', '),\n hasHook: true\n };\n } else {\n // No hook or multiple hooks - keep original value\n return {\n start,\n end,\n replacement: rawValue,\n displayValue: rawValue,\n hasHook: false\n };\n }\n}\n\n\n\n", "import { getStylingHooksForDensityValue } from '../../../../utils/styling-hook-utils';\nimport { resolvePropertyToMatch } from '../../../../utils/property-matcher';\nimport type { ParsedUnitValue } from '../../../../utils/value-utils';\nimport type { HandlerContext, DeclarationHandler } from '../../../../types';\n\n// Import shared utilities for common logic\nimport { \n handleShorthandAutoFix, \n forEachFontValue,\n isKnownFontWeight,\n type ReplacementInfo,\n type PositionInfo\n} from '../../../../utils/hardcoded-shared-utils';\n\n/**\n * Handle font declarations including shorthand property\n * Uses css-tree for reliable AST-based parsing\n */\nexport const handleFontDeclaration: DeclarationHandler = (node: any, context: HandlerContext) => {\n const cssProperty = node.property.toLowerCase();\n const valueText = context.sourceCode.getText(node.value);\n const replacements: ReplacementInfo[] = [];\n \n forEachFontValue(valueText, (fontValue, positionInfo) => {\n if (fontValue && isValidFontValue(fontValue, cssProperty)) {\n const replacement = createFontReplacement(fontValue, cssProperty, context, positionInfo);\n if (replacement) {\n replacements.push(replacement);\n }\n }\n });\n \n // Apply shorthand auto-fix once all values are processed\n handleShorthandAutoFix(node, context, valueText, replacements);\n};\n\n/**\n * Validate font value based on property type or value characteristics for shorthand\n * Only accepts what we explicitly handle in createFontReplacement\n */\nfunction isValidFontValue(fontValue: ParsedUnitValue, cssProperty: string): boolean {\n if (cssProperty === 'font-size') {\n // Font-size: must have units (unitless font-size values are generally invalid in CSS)\n return !!fontValue.unit;\n } else if (cssProperty === 'font-weight') {\n // Font-weight: must be unitless and a known font-weight value\n return !fontValue.unit && isKnownFontWeight(fontValue.number);\n } else if (cssProperty === 'font') {\n // Font shorthand: determine validation based on value characteristics\n if (!fontValue.unit && isKnownFontWeight(fontValue.number)) {\n // This is a font-weight value\n return true;\n } else if (fontValue.unit) {\n // font-size\n return true;\n } else {\n // Unitless value that's not a known font-weight - invalid\n return false;\n }\n }\n \n // For other font properties, reject extracted values\n return false;\n}\n\nfunction createFontReplacement(\n fontValue: ParsedUnitValue,\n cssProperty: string,\n context: HandlerContext,\n positionInfo: PositionInfo\n): ReplacementInfo | null {\n if (!positionInfo?.start) {\n return null;\n }\n\n const rawValue = fontValue.unit \n ? `${fontValue.number}${fontValue.unit}`\n : fontValue.number.toString();\n\n // Font-specific property resolution\n // Font-weight: unitless known font-weight values, otherwise font-size\n const propToMatch = (!fontValue.unit && isKnownFontWeight(fontValue.number)) \n ? resolvePropertyToMatch('font-weight')\n : resolvePropertyToMatch('font-size');\n\n const closestHooks = getStylingHooksForDensityValue(fontValue, context.valueToStylinghook, propToMatch);\n\n // Use position information directly from CSS tree (already 0-based offsets)\n const start = positionInfo.start.offset;\n const end = positionInfo.end.offset;\n\n if (closestHooks.length === 1) {\n // Has a single hook replacement - should provide autofix\n return {\n start,\n end,\n replacement: `var(${closestHooks[0]}, ${rawValue})`,\n displayValue: closestHooks[0],\n hasHook: true\n };\n } else if (closestHooks.length > 1) {\n // Multiple hooks - still has hooks, but no auto-fix\n return {\n start,\n end,\n replacement: rawValue,\n displayValue: closestHooks.join(', '),\n hasHook: true\n };\n } else {\n // No hooks - keep original value\n return {\n start,\n end,\n replacement: rawValue,\n displayValue: rawValue,\n hasHook: false\n };\n }\n}\n\n", "import { parse, walk, generate } from '@eslint/css-tree';\nimport { isValidColor } from './color-lib-utils';\nimport { parseUnitValue, type ParsedUnitValue } from './value-utils';\nimport { isCssColorFunction } from './css-functions';\n\nexport interface BoxShadowValue {\n offsetX?: string;\n offsetY?: string;\n blurRadius?: string;\n spreadRadius?: string;\n color?: string;\n inset?: boolean;\n}\n\ninterface ShadowParts {\n lengthParts: string[];\n colorParts: string[];\n inset: boolean;\n}\n\n/**\n * Check if a CSS tree node represents a color value\n */\nfunction isColorValue(node: any): boolean {\n if (!node) return false;\n \n switch (node.type) {\n case 'Hash':\n return true; // #hex colors\n case 'Identifier':\n return isValidColor(node.name);\n case 'Function':\n return isCssColorFunction(node.name.toLowerCase());\n default:\n return false;\n }\n}\n\n/**\n * Check if a CSS tree node represents a length value\n */\nfunction isLengthValue(node: any): boolean {\n if (!node) return false;\n \n switch (node.type) {\n case 'Dimension':\n // Use existing unit parsing to validate the unit\n const dimensionStr = `${node.value}${node.unit}`;\n return parseUnitValue(dimensionStr) !== null;\n case 'Number':\n // Zero values without units are valid lengths\n return Number(node.value) === 0;\n default:\n return false;\n }\n}\n\n/**\n * Check if a CSS tree node represents the 'inset' keyword\n */\nfunction isInsetKeyword(node: any): boolean {\n return node?.type === 'Identifier' && node.name.toLowerCase() === 'inset';\n}\n\n/**\n * Extract shadow parts from CSS tree nodes\n */\nfunction extractShadowParts(valueText: string): ShadowParts[] {\n const shadows: ShadowParts[] = [];\n let currentShadow: ShadowParts = {\n lengthParts: [],\n colorParts: [],\n inset: false\n };\n\n try {\n const ast = parse(valueText, { context: 'value' as const });\n \n walk(ast, {\n enter(node: any) {\n // Skip nested function content for now\n if (node.type === 'Function') {\n return this.skip;\n }\n \n if (isInsetKeyword(node)) {\n currentShadow.inset = true;\n } else if (isLengthValue(node)) {\n currentShadow.lengthParts.push(generate(node));\n } else if (isColorValue(node)) {\n currentShadow.colorParts.push(generate(node));\n }\n }\n });\n \n // Add the current shadow if it has any content\n if (currentShadow.lengthParts.length > 0 || currentShadow.colorParts.length > 0 || currentShadow.inset) {\n shadows.push(currentShadow);\n }\n \n } catch (error) {\n return [];\n }\n\n return shadows;\n}\n\n/**\n * Parse box-shadow value into structured format\n * Simplified version for ESLint v9 compatibility\n */\nexport function parseBoxShadowValue(value: string): BoxShadowValue[] {\n // Handle multiple shadows separated by commas\n const shadowStrings = value.split(',').map(s => s.trim());\n const allShadows: BoxShadowValue[] = [];\n \n for (const shadowString of shadowStrings) {\n const shadows = extractShadowParts(shadowString);\n \n const parsedShadows = shadows.map((shadow) => {\n /**\n * Box-shadow syntax:\n * Two, three, or four <length> values:\n * - offset-x offset-y [blur-radius] [spread-radius]\n * Optionally: inset keyword and color value\n */\n const shadowValue: BoxShadowValue = {};\n \n // Map length parts to shadow properties\n const lengthProps = ['offsetX', 'offsetY', 'blurRadius', 'spreadRadius'] as const;\n lengthProps.forEach((prop, index) => {\n if (shadow.lengthParts.length > index) {\n shadowValue[prop] = shadow.lengthParts[index];\n }\n });\n \n // Add color if present\n if (shadow.colorParts.length > 0) {\n shadowValue.color = shadow.colorParts[0];\n }\n \n // Add inset flag if present\n if (shadow.inset) {\n shadowValue.inset = true;\n }\n \n return shadowValue;\n });\n \n allShadows.push(...parsedShadows);\n }\n \n return allShadows;\n}\n\n/**\n * Normalize length value for comparison\n */\nfunction normalizeLengthValue(value: string | undefined): string {\n if (!value) return '0px';\n if (value === '0') return '0px';\n return value;\n}\n\n/**\n * Check if two parsed box-shadow values match\n */\nexport function isBoxShadowMatch(parsedCssValue: BoxShadowValue[], parsedValueHook: BoxShadowValue[]): boolean {\n // If the number of shadows doesn't match, they're not equal\n if (parsedCssValue.length !== parsedValueHook.length) {\n return false;\n }\n\n // Compare each shadow in the array\n for (let i = 0; i < parsedCssValue.length; i++) {\n const cssShadow = parsedCssValue[i];\n const hookShadow = parsedValueHook[i];\n\n // Compare color and inset properties\n if (cssShadow.color !== hookShadow.color || cssShadow.inset !== hookShadow.inset) {\n return false;\n }\n\n // Compare length properties\n const lengthProps = ['offsetX', 'offsetY', 'blurRadius', 'spreadRadius'] as const;\n for (const prop of lengthProps) {\n if (normalizeLengthValue(cssShadow[prop]) !== normalizeLengthValue(hookShadow[prop])) {\n return false;\n }\n }\n }\n\n return true;\n}\n", "import type { HandlerContext, DeclarationHandler } from '../../../../types';\nimport type { ValueToStylingHooksMapping } from '@salesforce-ux/sds-metadata/next';\nimport { parseBoxShadowValue, isBoxShadowMatch, type BoxShadowValue } from '../../../../utils/boxShadowValueParser';\n\n// Import shared utilities for common logic\nimport { \n handleShorthandAutoFix, \n type ReplacementInfo,\n type PositionInfo\n} from '../../../../utils/hardcoded-shared-utils';\n\n/**\n * Check if a CSS value contains CSS variables (var() functions)\n */\nfunction containsCssVariable(valueText: string): boolean {\n return valueText.includes('var(');\n}\n\n/**\n * Handle box-shadow declarations using CSS tree parsing\n */\nexport const handleBoxShadowDeclaration: DeclarationHandler = (node: any, context: HandlerContext) => {\n const cssProperty = node.property.toLowerCase();\n const valueText = context.sourceCode.getText(node.value);\n \n // Skip if the value contains CSS variables\n if (containsCssVariable(valueText)) {\n return;\n }\n \n // Box-shadow uses complete value matching, not individual value extraction\n const replacements: ReplacementInfo[] = [];\n \n // Parse and find matching hooks for the complete box-shadow value\n const parsedCssValue = parseAndValidateBoxShadow(valueText);\n if (parsedCssValue) {\n const shadowHooks = getBoxShadowHooks(context.valueToStylinghook);\n const closestHooks = findMatchingBoxShadowHooks(parsedCssValue, shadowHooks);\n \n // Create position info for the entire box-shadow value\n // hardcoded position is needed for string manipulation, not error reporting\n const positionInfo: PositionInfo = {\n start: { offset: 0, line: 1, column: 1 },\n end: { offset: valueText.length, line: 1, column: valueText.length + 1 }\n };\n \n const replacement = createBoxShadowReplacement(\n valueText,\n closestHooks,\n context,\n positionInfo\n );\n \n if (replacement) {\n replacements.push(replacement);\n }\n }\n \n // Apply shorthand auto-fix once processing is complete\n handleShorthandAutoFix(node, context, valueText, replacements);\n};\n\n\n/**\n * Extract box-shadow hook entries from styling hooks mapping\n */\nfunction getBoxShadowHooks(supportedStylinghooks: ValueToStylingHooksMapping): Array<[string, string[]]> {\n return Object.entries(supportedStylinghooks).filter(([key, value]) => {\n return value.some((hook) => hook.properties.includes('box-shadow'));\n }).map(([key, value]) => {\n return [key, value.map((hook) => hook.name)];\n });\n}\n\n/**\n * Parse and validate box-shadow value\n */\nfunction parseAndValidateBoxShadow(cssValue: string): BoxShadowValue[] | null {\n const parsedCssValue = parseBoxShadowValue(cssValue).filter((shadow) => Object.keys(shadow).length > 0);\n if (parsedCssValue.length === 0) {\n return null;\n }\n return parsedCssValue;\n}\n\n/**\n * Find matching hooks for a parsed box-shadow value\n */\nfunction findMatchingBoxShadowHooks(\n parsedCssValue: BoxShadowValue[], \n shadowHooks: Array<[string, string[]]>\n): string[] {\n // Try to find a matching hook for the complete box-shadow value\n for (const [shadowHookValue, closestHooks] of shadowHooks) {\n const parsedHookValue = parseAndValidateBoxShadow(shadowHookValue);\n \n if (parsedHookValue && isBoxShadowMatch(parsedCssValue, parsedHookValue)) {\n return closestHooks;\n }\n }\n \n return []; // No matching hooks found\n}\n\n/**\n * Create box-shadow replacement info for shorthand auto-fix\n * Returns replacement data or null if no valid replacement\n */\nfunction createBoxShadowReplacement(\n originalValue: string,\n hooks: string[],\n context: HandlerContext,\n positionInfo: PositionInfo\n): ReplacementInfo | null {\n if (!positionInfo?.start) {\n return null;\n }\n\n // Use position information directly from CSS tree (already 0-based offsets)\n const start = positionInfo.start.offset;\n const end = positionInfo.end.offset;\n\n if (hooks.length === 1) {\n // Has a single hook replacement - should provide autofix\n return {\n start,\n end,\n replacement: `var(${hooks[0]}, ${originalValue})`,\n displayValue: hooks[0],\n hasHook: true\n };\n } else if (hooks.length > 1) {\n // Multiple hooks - still has hooks, but no auto-fix\n return {\n start,\n end,\n replacement: originalValue,\n displayValue: hooks.join(', '),\n hasHook: true\n };\n } else {\n // No hooks - keep original value\n return {\n start,\n end,\n replacement: originalValue,\n displayValue: originalValue,\n hasHook: false\n };\n }\n}\n", "import { Rule } from 'eslint';\n\nimport { \n handleColorDeclaration, \n handleDensityDeclaration,\n handleFontDeclaration,\n handleBoxShadowDeclaration\n} from './handlers/index';\nimport { colorProperties, densificationProperties, fontProperties, toSelector } from '../../../utils/property-matcher';\nimport type { RuleConfig, HandlerContext } from '../../../types';\n\n\n\n/**\n * Creates the shared no-hardcoded-value rule implementation for ESLint v9\n * Supports color, density, and font properties including font shorthand\n * Uses property-matcher.ts to ensure comprehensive coverage without missing properties\n * Complex cases like box-shadow will be handled in future iterations\n */\nexport function defineNoHardcodedValueRule(config: RuleConfig): Rule.RuleModule {\n const { ruleConfig } = config;\n const { type, description, url, messages } = ruleConfig;\n\n return {\n meta: {\n type,\n docs: {\n description,\n recommended: true,\n url,\n },\n fixable: 'code',\n messages,\n },\n \n create(context) {\n // Create handler context\n const handlerContext: HandlerContext = {\n valueToStylinghook: config.valueToStylinghook,\n context,\n sourceCode: context.sourceCode\n };\n \n const colorOnlySelector = toSelector(colorProperties);\n const densityOnlySelector = toSelector(densificationProperties);\n const fontDensitySelector = toSelector(fontProperties);\n\n // Find overlapping properties that need both handlers\n // This includes exact matches and wildcard pattern matches\n const overlappingProperties = colorProperties.filter(colorProp => {\n return densificationProperties.some(densityProp => {\n if (densityProp === colorProp) {\n return true; // Exact match\n }\n if (densityProp.includes('*')) {\n // Check if colorProp matches the wildcard pattern\n const regexPattern = new RegExp('^' + densityProp.replace(/\\*/g, '.*') + '$');\n return regexPattern.test(colorProp);\n }\n return false;\n });\n });\n const overlappingSet = new Set(overlappingProperties);\n \n // Create property lists excluding overlaps to avoid triple processing\n const colorOnlyProps = colorProperties.filter(prop => !overlappingSet.has(prop));\n const densityOnlyProps = densificationProperties.filter(prop => !overlappingSet.has(prop));\n \n // Define CSS AST selectors and their handlers\n const visitors: Record<string, (node: any) => void> = {};\n \n // Color-only properties (excluding overlaps)\n if (colorOnlyProps.length > 0) {\n const colorOnlySelector = toSelector(colorOnlyProps);\n visitors[colorOnlySelector] = (node: any) => {\n handleColorDeclaration(node, handlerContext);\n };\n }\n\n // Density-only properties (excluding overlaps)\n if (densityOnlyProps.length > 0) {\n const densityOnlySelector = toSelector(densityOnlyProps);\n visitors[densityOnlySelector] = (node: any) => {\n handleDensityDeclaration(node, handlerContext);\n };\n }\n \n // Font shorthand property, Font density properties (font-size, font-weight)\n visitors[fontDensitySelector] = (node: any) => {\n handleFontDeclaration(node, handlerContext);\n };\n \n // Box-shadow property - special case requiring complete value matching\n visitors['Declaration[property=\"box-shadow\"]'] = (node: any) => {\n handleBoxShadowDeclaration(node, handlerContext);\n };\n\n // For overlapping properties, run both handlers\n if (overlappingProperties.length > 0) {\n const overlappingSelector = toSelector(overlappingProperties);\n visitors[overlappingSelector] = (node: any) => {\n handleColorDeclaration(node, handlerContext);\n handleDensityDeclaration(node, handlerContext);\n };\n }\n\n return visitors;\n }\n };\n}", "import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata/next';\nimport ruleMessages from '../../../config/rule-messages.yml';\nimport { defineNoHardcodedValueRule } from './noHardcodedValueRule';\n\nconst ruleConfig = ruleMessages['no-hardcoded-values-slds2'];\nconst { type, description, url, messages } = ruleConfig;\n\nconst valueToStylinghook = metadata.valueToStylingHooksCosmos;\n\nexport default defineNoHardcodedValueRule({\n ruleConfig,\n valueToStylinghook,\n}) as Rule.RuleModule;\n\n", "{\n \"css\": {\n \"@salesforce-ux/slds/no-slds-class-overrides\": \"warn\",\n \"@salesforce-ux/slds/no-deprecated-slds-classes\": \"warn\",\n \"@salesforce-ux/slds/no-deprecated-tokens-slds1\": \"error\",\n \"@salesforce-ux/slds/lwc-token-to-slds-hook\": \"error\",\n \"@salesforce-ux/slds/enforce-sds-to-slds-hooks\": \"warn\",\n \"@salesforce-ux/slds/no-sldshook-fallback-for-lwctoken\": \"warn\",\n \"@salesforce-ux/slds/no-unsupported-hooks-slds2\": \"warn\",\n \"@salesforce-ux/slds/no-slds-var-without-fallback\": \"warn\",\n \"@salesforce-ux/slds/no-slds-namespace-for-custom-hooks\": \"warn\",\n \"@salesforce-ux/slds/enforce-component-hook-naming-convention\": \"error\",\n \"@salesforce-ux/slds/no-slds-private-var\": \"warn\",\n \"@salesforce-ux/slds/no-hardcoded-values-slds1\": \"error\",\n \"@salesforce-ux/slds/no-hardcoded-values-slds2\": \"warn\",\n \"@salesforce-ux/slds/reduce-annotations\": \"warn\"\n },\n \"html\": {\n \"@salesforce-ux/slds/enforce-bem-usage\": \"error\",\n \"@salesforce-ux/slds/no-deprecated-classes-slds2\": \"error\",\n \"@salesforce-ux/slds/modal-close-button-issue\": \"error\"\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,SAAS,SAAS,MAAM,KAAK;AAC3B,SAAO,KAAK,WAAW;AAAA,IACrB,CAAC,SAAS,KAAK,OAAO,KAAK,IAAI,MAAM,YAAY,MAAM,IAAI,YAAY;AAAA,EACzE;AACF;AAOA,SAAS,kBAAkB,MAAM;AAC/B,SAAO,CAAC,KAAK,cAAc,KAAK,WAAW,UAAU;AACvD;AAvBA,IAEA,eAsLM,kBACA;AAzLN;AAAA;AAEA,oBAA2B;AAsL3B,IAAM,mBAAmB;AACzB,IAAM,oBAAoB,IAAI,OAAO,iBAAiB,QAAQ,IAAI;AAAA;AAAA;;;ACzLlE;AAAA,6HAAAA,UAAAC,SAAA;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6BAA6B;AAAA,EAC7B,6BAA6B;AAAA,EAC7B,sBAAsB;AACxB;AAEA,IAAM,SAAS;AAAA,EACb,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA,EACX;AAAA,EACA;AAAA,EACA,SAAS,CAAC;AACZ;AAEA,OAAO,OAAO,OAAO,SAAS;AAAA;AAAA,EAE5B,oBAAoB;AAAA;AAAA,IAElB;AAAA,MACE,OAAO,CAAC,aAAa,UAAU;AAAA,MAC/B,iBAAiB;AAAA,QACf,QAAQ,eAAAC;AAAA,QACR,aAAa;AAAA,QACb,YAAY;AAAA,MACd;AAAA,MACA,SAAS;AAAA,QACP,uBAAuB;AAAA,MACzB;AAAA,MACA,OAAO,8BAAY;AAAA,IACrB;AAAA;AAAA,IAEA;AAAA,MACE,OAAO,CAAC,iBAAiB;AAAA,MACzB,UAAU;AAAA,MACV,GAAG,WAAAC,QAAU,QAAQ;AAAA,MACrB,iBAAiB;AAAA,QACf,UAAU;AAAA;AAAA,MACZ;AAAA,MACA,SAAS;AAAA,QACP,KAAK,WAAAA;AAAA,QACL,uBAAuB;AAAA,MACzB;AAAA,MACA,OAAO,8BAAY;AAAA,IACrB;AAAA,EACF;AAAA;AAAA,EAEA,aAAa;AAAA,IACX,SAAS,CAAC,qBAAqB;AAAA,IAC/B,OAAO,8BAAY;AAAA,IACnB,QAAQ,eAAAD;AAAA,IACR,eAAe;AAAA,MACb,aAAa;AAAA,MACb,YAAY;AAAA,IACd;AAAA,EACF;AACF,CAAC;AAED,OAAO,UAAU;",
6
+ "names": ["exports", "module", "ruleMessages", "metadata", "exports", "module", "import_next", "import_rule_messages", "bemMapping", "metadata", "deprecatedClasses", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "enforceBemUsage", "exports", "module", "import_next", "import_rule_messages", "deprecatedClasses", "metadata", "ruleConfig", "ruleMessages", "exports", "module", "import_rule_messages", "ruleConfig", "ruleMessages", "import_next", "import_rule_messages", "ruleMessages", "metadata", "import_next", "import_rule_messages", "type", "description", "url", "messages", "ruleMessages", "metadata", "import_next", "import_rule_messages", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "metadata", "shouldIgnoreDetection", "import_next", "import_rule_messages", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "metadata", "type", "description", "url", "messages", "import_next", "import_rule_messages", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "metadata", "shouldIgnoreDetection", "import_next", "import_rule_messages", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "sldsPlusStylingHooks", "metadata", "allSldsHooks", "import_next", "import_rule_messages", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "metadata", "shouldIgnoreDetection", "import_next", "import_rule_messages", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "metadata", "import_next", "import_rule_messages", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "sldsPlusStylingHooks", "metadata", "allSldsHooks", "toSldsToken", "shouldIgnoreDetection", "import_next", "import_rule_messages", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "metadata", "shouldIgnoreDetection", "import_rule_messages", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "import_rule_messages", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "import_next", "import_rule_messages", "chroma", "import_css_tree", "import_css_tree", "ruleConfig", "type", "description", "url", "messages", "colorOnlySelector", "densityOnlySelector", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "metadata", "import_next", "import_rule_messages", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "valueToStylinghook", "metadata", "import_parser", "enforceBemUsage", "noDeprecatedClassesSlds2", "modalCloseButtonIssue", "htmlParser", "cssPlugin"]
7
7
  }