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

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 (67) hide show
  1. package/README.md +17 -1
  2. package/build/index.js +1072 -1016
  3. package/build/index.js.map +4 -4
  4. package/build/rules/enforce-bem-usage.js +5 -5
  5. package/build/rules/enforce-bem-usage.js.map +3 -3
  6. package/build/rules/no-deprecated-classes-slds2.js +2 -2
  7. package/build/rules/no-deprecated-classes-slds2.js.map +2 -2
  8. package/build/rules/v9/enforce-bem-usage.js +2 -2
  9. package/build/rules/v9/enforce-bem-usage.js.map +2 -2
  10. package/build/rules/v9/enforce-component-hook-naming-convention.js +2 -2
  11. package/build/rules/v9/enforce-component-hook-naming-convention.js.map +2 -2
  12. package/build/rules/v9/enforce-sds-to-slds-hooks.js +2 -2
  13. package/build/rules/v9/enforce-sds-to-slds-hooks.js.map +2 -2
  14. package/build/rules/v9/lwc-token-to-slds-hook.js +42 -3
  15. package/build/rules/v9/lwc-token-to-slds-hook.js.map +4 -4
  16. package/build/rules/v9/no-deprecated-slds-classes.js +2 -2
  17. package/build/rules/v9/no-deprecated-slds-classes.js.map +2 -2
  18. package/build/rules/v9/no-deprecated-tokens-slds1.js +2 -2
  19. package/build/rules/v9/no-deprecated-tokens-slds1.js.map +2 -2
  20. package/build/rules/v9/no-hardcoded-values/handlers/boxShadowHandler.js +49 -54
  21. package/build/rules/v9/no-hardcoded-values/handlers/boxShadowHandler.js.map +3 -3
  22. package/build/rules/v9/no-hardcoded-values/handlers/colorHandler.js +9 -2
  23. package/build/rules/v9/no-hardcoded-values/handlers/colorHandler.js.map +3 -3
  24. package/build/rules/v9/no-hardcoded-values/handlers/densityHandler.js +14 -3
  25. package/build/rules/v9/no-hardcoded-values/handlers/densityHandler.js.map +3 -3
  26. package/build/rules/v9/no-hardcoded-values/handlers/fontHandler.js +14 -3
  27. package/build/rules/v9/no-hardcoded-values/handlers/fontHandler.js.map +3 -3
  28. package/build/rules/v9/no-hardcoded-values/handlers/index.js +86 -90
  29. package/build/rules/v9/no-hardcoded-values/handlers/index.js.map +3 -3
  30. package/build/rules/v9/no-hardcoded-values/no-hardcoded-values-slds1.js +116 -96
  31. package/build/rules/v9/no-hardcoded-values/no-hardcoded-values-slds1.js.map +4 -4
  32. package/build/rules/v9/no-hardcoded-values/no-hardcoded-values-slds2.js +116 -96
  33. package/build/rules/v9/no-hardcoded-values/no-hardcoded-values-slds2.js.map +4 -4
  34. package/build/rules/v9/no-hardcoded-values/noHardcodedValueRule.js +110 -92
  35. package/build/rules/v9/no-hardcoded-values/noHardcodedValueRule.js.map +3 -3
  36. package/build/rules/v9/no-slds-class-overrides.js +2 -2
  37. package/build/rules/v9/no-slds-class-overrides.js.map +2 -2
  38. package/build/rules/v9/no-slds-namespace-for-custom-hooks.js +2 -2
  39. package/build/rules/v9/no-slds-namespace-for-custom-hooks.js.map +2 -2
  40. package/build/rules/v9/no-slds-var-without-fallback.js +121 -35
  41. package/build/rules/v9/no-slds-var-without-fallback.js.map +4 -4
  42. package/build/rules/v9/no-sldshook-fallback-for-lwctoken.js +2 -2
  43. package/build/rules/v9/no-sldshook-fallback-for-lwctoken.js.map +2 -2
  44. package/build/rules/v9/no-unsupported-hooks-slds2.js +2 -2
  45. package/build/rules/v9/no-unsupported-hooks-slds2.js.map +2 -2
  46. package/build/src/rules/v9/no-hardcoded-values/noHardcodedValueRule.d.ts +3 -1
  47. package/build/src/rules/v9/no-slds-var-without-fallback.d.ts +4 -0
  48. package/build/src/utils/css-utils.d.ts +19 -0
  49. package/build/src/utils/rule-utils.d.ts +8 -0
  50. package/build/src/utils/value-utils.d.ts +3 -2
  51. package/build/types/index.js.map +1 -1
  52. package/build/utils/boxShadowValueParser.js +4 -1
  53. package/build/utils/boxShadowValueParser.js.map +2 -2
  54. package/build/utils/color-lib-utils.js.map +1 -1
  55. package/build/utils/css-utils.js +108 -0
  56. package/build/utils/css-utils.js.map +4 -4
  57. package/build/utils/hardcoded-shared-utils.js +5 -2
  58. package/build/utils/hardcoded-shared-utils.js.map +3 -3
  59. package/build/utils/property-matcher.js +1 -1
  60. package/build/utils/property-matcher.js.map +2 -2
  61. package/build/utils/rule-utils.js +46 -0
  62. package/build/utils/rule-utils.js.map +7 -0
  63. package/build/utils/styling-hook-utils.js +4 -1
  64. package/build/utils/styling-hook-utils.js.map +2 -2
  65. package/build/utils/value-utils.js +6 -1
  66. package/build/utils/value-utils.js.map +2 -2
  67. package/package.json +1 -1
@@ -195,14 +195,14 @@ var lineBreakPattern = /\r\n|[\r\n\u2028\u2029]/u;
195
195
  var lineEndingPattern = new RegExp(lineBreakPattern.source, "gu");
196
196
 
197
197
  // src/rules/enforce-bem-usage.ts
198
- var import_next2 = __toESM(require("@salesforce-ux/sds-metadata/next"));
198
+ var import_sds_metadata2 = __toESM(require("@salesforce-ux/sds-metadata"));
199
199
  var import_rule_messages2 = __toESM(require_rule_messages());
200
200
 
201
201
  // src/rules/v9/enforce-bem-usage.ts
202
- var import_next = __toESM(require("@salesforce-ux/sds-metadata/next"));
202
+ var import_sds_metadata = __toESM(require("@salesforce-ux/sds-metadata"));
203
203
  var import_rule_messages = __toESM(require_rule_messages());
204
204
  var { type, description, url, messages } = import_rule_messages.default["enforce-bem-usage"];
205
- var bemMapping = import_next.default.bemNaming;
205
+ var bemMapping = import_sds_metadata.default.bemNaming;
206
206
  var enforce_bem_usage_default = {
207
207
  meta: {
208
208
  type,
@@ -242,8 +242,8 @@ var enforce_bem_usage_default = {
242
242
  };
243
243
 
244
244
  // src/rules/enforce-bem-usage.ts
245
- var bemMapping2 = import_next2.default.bemNaming;
246
- var deprecatedClasses = import_next2.default.deprecatedClasses;
245
+ var bemMapping2 = import_sds_metadata2.default.bemNaming;
246
+ var deprecatedClasses = import_sds_metadata2.default.deprecatedClasses;
247
247
  var ruleConfig = import_rule_messages2.default["enforce-bem-usage"];
248
248
  var { type: type2, description: description2, url: url2, messages: messages2 } = ruleConfig;
249
249
  var isDeprecatedClass = (className) => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["yaml-file:/Users/ritesh.kumar2/Documents/projects/stylelint-sds/packages/eslint-plugin-slds/src/config/rule-messages.yml", "../../src/utils/node.ts", "../../src/rules/enforce-bem-usage.ts", "../../src/rules/v9/enforce-bem-usage.ts"],
4
- "sourcesContent": ["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};", "// 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};", "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 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"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,6HAAAA,UAAAC,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA,MACf,2BAA2B;AAAA,QACzB,eAAe;AAAA,QACf,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,YAAY;AAAA,UACV,qBAAqB;AAAA,QACvB;AAAA,MACF;AAAA,MACA,8BAA8B;AAAA,QAC5B,eAAe;AAAA,QACf,OAAO;AAA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,cACT;AAAA,YACF,CAAC;AAAA,UACH;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAEA,WAAO;AAAA,MACL,KAAK;AAAA,IACP;AAAA,EACF;AACF;AAKA,IAAM,kBAAkB;AAAA,EACtB,MAAM;AAAA,IACJ,MAAAG;AAAA,IACA,MAAM;AAAA,MACJ,aAAa;AAAA,MACb,aAAAC;AAAA,MACA,KAAAC;AAAA,IACF;AAAA,IACA,SAAS;AAAA,IACT,UAAAC;AAAA,EACF;AAAA,EAEA,OAAO,SAAS;AACd,UAAM,WAAW,QAAQ,YAAY,QAAQ,YAAY;AAGzD,QAAI,SAAS,SAAS,MAAM,KAAK,SAAS,SAAS,OAAO,GAAG;AAG3D,UAAI;AAEF,eAAO,0BAAmB,OAAO,OAAO;AAAA,MAC1C,SAAS,OAAO;AAGd,eAAO,CAAC;AAAA,MACV;AAAA,IACF,OAAO;AAEL,aAAO,oBAAoB,OAAO,OAAO;AAAA,IAC3C;AAAA,EACF;AACF;AAEA,iBAAS;",
6
- "names": ["exports", "module", "import_next", "import_rule_messages", "ruleMessages", "metadata", "bemMapping", "metadata", "ruleMessages", "type", "description", "url", "messages"]
4
+ "sourcesContent": ["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};", "// 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};", "import { Rule } from 'eslint';\nimport { findAttr, isAttributesEmpty } from \"../utils/node\";\nimport metadata from '@salesforce-ux/sds-metadata';\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 metadata from '@salesforce-ux/sds-metadata';\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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,6HAAAA,UAAAC,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA,MACf,2BAA2B;AAAA,QACzB,eAAe;AAAA,QACf,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,YAAY;AAAA,UACV,qBAAqB;AAAA,QACvB;AAAA,MACF;AAAA,MACA,8BAA8B;AAAA,QAC5B,eAAe;AAAA,QACf,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,YAAY;AAAA,UACV,mBAAmB;AAAA,QACrB;AAAA,MACF;AAAA,MACA,8BAA8B;AAAA,QAC5B,eAAe;AAAA,QACf,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,YAAY;AAAA,UACV,mBAAmB;AAAA,UACnB,iBAAiB;AAAA,QACnB;AAAA,MACF;AAAA,MACA,6BAA6B;AAAA,QAC3B,eAAe;AAAA,QACf,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,YAAY;AAAA,UACV,sBAAsB;AAAA,QACxB;AAAA,MACF;AAAA,MACA,qBAAqB;AAAA,QACnB,eAAe;AAAA,QACf,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,YAAY;AAAA,UACV,iBAAiB;AAAA,UACjB,gBAAgB;AAAA,QAClB;AAAA,MACF;AAAA,MACA,4BAA4B;AAAA,QAC1B,eAAe;AAAA,QACf,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,YAAY;AAAA,UACV,yBAAyB;AAAA,UACzB,eAAe;AAAA,UACf,iBAAiB;AAAA,UACjB,iBAAiB;AAAA,UACjB,uBAAuB;AAAA,UACvB,uBAAuB;AAAA,QACzB;AAAA,MACF;AAAA,MACA,+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AAAA,YACvC;AAGA,kBAAM,WAAWA,YAAW,SAAS;AACrC,oBAAQ,OAAO;AAAA,cACb;AAAA,cACA,KAAK,EAAE,OAAO,UAAU,KAAK,OAAO;AAAA,cACpC,WAAW;AAAA,cACX,MAAM;AAAA,gBACJ,QAAQ;AAAA,gBACR;AAAA,cACF;AAAA,cACA,IAAI,OAAO;AACT,oBAAI,UAAU;AACZ,wBAAM,gBAAgB,UAAU,MAAM,MAAM;AAAA,oBAC1C;AAAA,oBACA;AAAA,kBACF;AACA,yBAAO,MAAM;AAAA,oBACX,CAAC,UAAU,MAAM,MAAM,CAAC,GAAG,UAAU,MAAM,MAAM,CAAC,CAAC;AAAA,oBACnD,GAAG,aAAa;AAAA,kBAClB;AAAA,gBACF;AACA,uBAAO;AAAA,cACT;AAAA,YACF,CAAC;AAAA,UACH;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAEA,WAAO;AAAA,MACL,KAAK;AAAA,IACP;AAAA,EACF;AACF;AAKA,IAAM,kBAAkB;AAAA,EACtB,MAAM;AAAA,IACJ,MAAAG;AAAA,IACA,MAAM;AAAA,MACJ,aAAa;AAAA,MACb,aAAAC;AAAA,MACA,KAAAC;AAAA,IACF;AAAA,IACA,SAAS;AAAA,IACT,UAAAC;AAAA,EACF;AAAA,EAEA,OAAO,SAAS;AACd,UAAM,WAAW,QAAQ,YAAY,QAAQ,YAAY;AAGzD,QAAI,SAAS,SAAS,MAAM,KAAK,SAAS,SAAS,OAAO,GAAG;AAG3D,UAAI;AAEF,eAAO,0BAAmB,OAAO,OAAO;AAAA,MAC1C,SAAS,OAAO;AAGd,eAAO,CAAC;AAAA,MACV;AAAA,IACF,OAAO;AAEL,aAAO,oBAAoB,OAAO,OAAO;AAAA,IAC3C;AAAA,EACF;AACF;AAEA,iBAAS;",
6
+ "names": ["exports", "module", "import_sds_metadata", "import_rule_messages", "ruleMessages", "metadata", "bemMapping", "metadata", "ruleMessages", "type", "description", "url", "messages"]
7
7
  }
@@ -195,9 +195,9 @@ var lineBreakPattern = /\r\n|[\r\n\u2028\u2029]/u;
195
195
  var lineEndingPattern = new RegExp(lineBreakPattern.source, "gu");
196
196
 
197
197
  // src/rules/no-deprecated-classes-slds2.ts
198
- var import_next = __toESM(require("@salesforce-ux/sds-metadata/next"));
198
+ var import_sds_metadata = __toESM(require("@salesforce-ux/sds-metadata"));
199
199
  var import_rule_messages = __toESM(require_rule_messages());
200
- var deprecatedClasses = import_next.default.deprecatedClasses;
200
+ var deprecatedClasses = import_sds_metadata.default.deprecatedClasses;
201
201
  var ruleConfig = import_rule_messages.default["no-deprecated-classes-slds2"];
202
202
  module.exports = {
203
203
  meta: {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["yaml-file:/Users/ritesh.kumar2/Documents/projects/stylelint-sds/packages/eslint-plugin-slds/src/config/rule-messages.yml", "../../src/utils/node.ts", "../../src/rules/no-deprecated-classes-slds2.ts"],
4
- "sourcesContent": ["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};", "// 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};", "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};"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,6HAAAA,UAAAC,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA,MACf,2BAA2B;AAAA,QACzB,eAAe;AAAA,QACf,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,YAAY;AAAA,UACV,qB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AQ,OAAO;AAAA,cACb;AAAA,cACA,KAAK,EAAE,OAAO,UAAU,KAAK,OAAO;AAAA,cACpC,WAAW;AAAA,cACX,MAAM;AAAA,gBACJ;AAAA,cACF;AAAA,YACF,CAAC;AAAA,UACH;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAEA,WAAO;AAAA,MACL,KAAK;AAAA,IACP;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["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};", "// 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};", "import { Rule } from 'eslint';\nimport { findAttr, isAttributesEmpty } from \"../utils/node\";\nimport metadata from '@salesforce-ux/sds-metadata';\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};"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,6HAAAA,UAAAC,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA,MACf,2BAA2B;AAAA,QACzB,eAAe;AAAA,QACf,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,YAAY;AAAA,UACV,qBAAqB;AAAA,QACvB;AAAA,MACF;AAAA,MACA,8BAA8B;AAAA,QAC5B,eAAe;AAAA,QACf,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,YAAY;AAAA,UACV,mBAAmB;AAAA,QACrB;AAAA,MACF;AAAA,MACA,8BAA8B;AAAA,QAC5B,eAAe;AAAA,QACf,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,YAAY;AAAA,UACV,mBAAmB;AAAA,UACnB,iBAAiB;AAAA,QACnB;AAAA,MACF;AAAA,MACA,6BAA6B;AAAA,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192
192
  default: () => enforce_bem_usage_default
193
193
  });
194
194
  module.exports = __toCommonJS(enforce_bem_usage_exports);
195
- var import_next = __toESM(require("@salesforce-ux/sds-metadata/next"));
195
+ var import_sds_metadata = __toESM(require("@salesforce-ux/sds-metadata"));
196
196
  var import_rule_messages = __toESM(require_rule_messages());
197
197
  var { type, description, url, messages } = import_rule_messages.default["enforce-bem-usage"];
198
- var bemMapping = import_next.default.bemNaming;
198
+ var bemMapping = import_sds_metadata.default.bemNaming;
199
199
  var enforce_bem_usage_default = {
200
200
  meta: {
201
201
  type,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["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"],
4
- "sourcesContent": ["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"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,6HAAAA,UAAAC,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA,MACf,2BAA2B;AAAA,QACzB,eAAe;AAAA,QACf,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,YAAY;AAAA,UACV,qBAAqB;AAAA,QACvB;AAAA,MACF;AAAA,MACA,8BAA8B;AAAA,QAC5B,eAAe;AAAA,QACf,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,YAAY;AAAA,UACV,mBAAmB;AAAA,QACrB;AAAA,MACF;AAAA,MACA,8BAA8B;AAAA,QAC5B,eAAe;AAAA,QACf,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,YAAY;AAAA,UACV,mBAAmB;AAAA,UACnB,iBAAiB;AAAA,QACnB;AAAA,MACF;AAAA,MACA,6BAA6B;AAAA,QAC3B,eAAe;AAAA,QACf,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,YAAY;AAAA,UACV,sBAAsB;AAAA,QACxB;AAAA,MACF;AAAA,MACA,qBAAqB;AAAA,QACnB,eAAe;AAAA,QACf,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,YAAY;AAAA,UACV,iBAAiB;AAAA,UACjB,gBAAgB;AAAA,QAClB;AAAA,MACF;AAAA,MACA,4BAA4B;AAAA,QAC1B,eAAe;AAAA,QACf,OAAO;AAAA,QACP,QAAQ;AAAA,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,MAAM,IAAI,QAAQ,EAAE;AAAA,cAC/C;AAAA,YACF,CAAC;AAAA,UACH;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["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';\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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A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A,QACf,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,YAAY;AAAA,UACV,oBAAoB;AAAA,QACtB;AAAA,MACF;AAAA,IACF;AAAA;AAAA;;;ACtJA;AAAA;AAAA;AAAA;AAAA;AACA,0BAAqB;AACrB,2BAAyB;AAEzB,IAAM,EAAE,MAAM,aAAa,KAAK,SAAS,IAAI,qBAAAC,QAAa,mBAAmB;AAE7E,IAAM,aAAa,oBAAAC,QAAS;AAE5B,IAAO,4BAAQ;AAAA,EACb,MAAM;AAAA,IACJ;AAAA,IACA,MAAM;AAAA,MACJ;AAAA,MACA,aAAa;AAAA,MACb;AAAA,IACF;AAAA,IACA,SAAS;AAAA,IACT;AAAA,EACF;AAAA,EAEA,OAAO,SAAS;AACd,WAAO;AAAA;AAAA,MAEL,sCAAsC,MAAM;AAC1C,cAAM,mBAAmB,QAAQ,WAAW,QAAQ,IAAI;AAGxD,cAAM,YAAY,iBAAiB,UAAU,CAAC;AAG9C,YAAI,aAAa,aAAa,YAAY;AACxC,gBAAM,WAAW,WAAW,SAAS;AACrC,cAAI,OAAO,aAAa,UAAU;AAChC,oBAAQ,OAAO;AAAA,cACb;AAAA,cACA,WAAW;AAAA,cACX,MAAM;AAAA,gBACJ,QAAQ;AAAA,gBACR;AAAA,cACF;AAAA,cACA,IAAI,OAAO;AACT,uBAAO,MAAM,YAAY,MAAM,IAAI,QAAQ,EAAE;AAAA,cAC/C;AAAA,YACF,CAAC;AAAA,UACH;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;",
6
6
  "names": ["exports", "module", "ruleMessages", "metadata"]
7
7
  }
@@ -192,11 +192,11 @@ __export(enforce_component_hook_naming_convention_exports, {
192
192
  default: () => enforce_component_hook_naming_convention_default
193
193
  });
194
194
  module.exports = __toCommonJS(enforce_component_hook_naming_convention_exports);
195
- var import_next = __toESM(require("@salesforce-ux/sds-metadata/next"));
195
+ var import_sds_metadata = __toESM(require("@salesforce-ux/sds-metadata"));
196
196
  var import_rule_messages = __toESM(require_rule_messages());
197
197
  var ruleConfig = import_rule_messages.default["enforce-component-hook-naming-convention"];
198
198
  var { type, description, url, messages } = ruleConfig;
199
- var slds1DeprecatedComponentHooks = import_next.default.slds1DeprecatedComponentHooks;
199
+ var slds1DeprecatedComponentHooks = import_sds_metadata.default.slds1DeprecatedComponentHooks;
200
200
  function shouldIgnoreDetection(hook) {
201
201
  return !hook.startsWith("--slds-c-") || !(hook in slds1DeprecatedComponentHooks);
202
202
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["yaml-file:/Users/ritesh.kumar2/Documents/projects/stylelint-sds/packages/eslint-plugin-slds/src/config/rule-messages.yml", "../../../src/rules/v9/enforce-component-hook-naming-convention.ts"],
4
- "sourcesContent": ["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 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"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,6HAAAA,UAAAC,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA,MACf,2BAA2B;AAAA,QACzB,eAAe;AAAA,QACf,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,YAAY;AAAA,UACV,qBAAqB;AAAA,QACvB;AAAA,MACF;AAAA,M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AA,EACF;AACF;",
4
+ "sourcesContent": ["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';\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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,6HAAAA,UAAAC,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA,MACf,2BAA2B;AAAA,QACzB,eAAe;AAAA,QACf,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,YAAY;AAAA,UACV,qBAAqB;AAAA,QACvB;AAAA,MACF;AAAA,MACA,8BAA8B;AAAA,QAC5B,eAAe;AAAA,QACf,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,YAAY;AAAA,UACV,mBAAmB;AAAA,QACrB;AAAA,MACF;AAAA,MACA,8BAA8B;AAAA,QAC5B,eAAe;AAAA,QACf,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,YAAY;AAAA,UACV,mBAAmB;AAAA,UACnB,iBAAiB;AAAA,QACnB;AAAA,MACF;AAAA,MACA,6BAA6B;AAAA,QAC3B,eAAe;AAAA,QACf,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,YAAY;AAAA,UACV,sBAAsB;AAAA,QACxB;AAAA,MACF;AAAA,MACA,qBAAqB;AAAA,QACnB,eAAe;AAAA,QAC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AAyF,MAAM;AAC7F,YAAI;AACJ,YAAI,aAAa;AAEjB,YAAI,KAAK,SAAS,eAAe;AAE/B,qBAAW,KAAK;AAAA,QAClB,WAAW,KAAK,SAAS,cAAc;AAErC,qBAAW,KAAK;AAAA,QAClB,OAAO;AACL;AAAA,QACF;AAGA,YAAI,sBAAsB,QAAQ,GAAG;AACnC;AAAA,QACF;AAEA,cAAM,iBAAiB,8BAA8B,QAAQ;AAE7D,gBAAQ,OAAO;AAAA,UACb,MAAM;AAAA,UACN,WAAW;AAAA,UACX,MAAM;AAAA,YACJ,UAAU;AAAA,YACV;AAAA,UACF;AAAA,UACA,IAAI,OAAO;AACT,gBAAI,KAAK,SAAS,eAAe;AAE/B,oBAAM,eAAe,QAAQ,WAAW,QAAQ,IAAI;AACpD,oBAAM,aAAa,aAAa,QAAQ,GAAG;AAC3C,oBAAM,qBAAqB,aAAa,UAAU,UAAU;AAC5D,qBAAO,MAAM,YAAY,MAAM,GAAG,cAAc,GAAG,kBAAkB,EAAE;AAAA,YACzE,WAAW,KAAK,SAAS,cAAc;AAErC,qBAAO,MAAM,YAAY,MAAM,cAAc;AAAA,YAC/C;AACA,mBAAO;AAAA,UACT;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACF;",
6
6
  "names": ["exports", "module", "ruleMessages", "metadata"]
7
7
  }
@@ -192,11 +192,11 @@ __export(enforce_sds_to_slds_hooks_exports, {
192
192
  default: () => enforce_sds_to_slds_hooks_default
193
193
  });
194
194
  module.exports = __toCommonJS(enforce_sds_to_slds_hooks_exports);
195
- var import_next = __toESM(require("@salesforce-ux/sds-metadata/next"));
195
+ var import_sds_metadata = __toESM(require("@salesforce-ux/sds-metadata"));
196
196
  var import_rule_messages = __toESM(require_rule_messages());
197
197
  var ruleConfig = import_rule_messages.default["enforce-sds-to-slds-hooks"];
198
198
  var { type, description, url, messages } = ruleConfig;
199
- var sldsPlusStylingHooks = import_next.default.sldsPlusStylingHooks;
199
+ var sldsPlusStylingHooks = import_sds_metadata.default.sldsPlusStylingHooks;
200
200
  var allSldsHooks = [...sldsPlusStylingHooks.global, ...sldsPlusStylingHooks.component];
201
201
  var toSldsToken = (sdsToken) => sdsToken.replace("--sds-", "--slds-");
202
202
  function shouldIgnoreDetection(sdsToken) {