@salesforce-ux/eslint-plugin-slds 1.0.6 → 1.0.7
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.
- package/README.md +27 -0
- package/build/index.js +25 -19
- package/build/index.js.map +3 -3
- package/eslint.config.mjs +2 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,6 +27,8 @@ module.exports = {
|
|
|
27
27
|
|
|
28
28
|
### ESLint v9+ (Flat Config)
|
|
29
29
|
|
|
30
|
+
#### Basic Configuration
|
|
31
|
+
|
|
30
32
|
```javascript
|
|
31
33
|
// eslint.config.js
|
|
32
34
|
const { defineConfig } = require('eslint/config');
|
|
@@ -42,6 +44,31 @@ module.exports = defineConfig([
|
|
|
42
44
|
]);
|
|
43
45
|
```
|
|
44
46
|
|
|
47
|
+
#### Using with Other Plugins
|
|
48
|
+
|
|
49
|
+
To use the ESLint plugin with other plugins, add the `sldsCssPlugin()` helper function to the `eslint.config.mjs` configuration file. The `sldsCssPlugin()` function returns an object that contains the configurations for the ESLint plugin. This makes it easy to combine the ESLint plugin with other plugins while maintaining all the required dependencies.
|
|
50
|
+
|
|
51
|
+
For example, to use the ESLint plugin with the CSS plugin, add the CSS plugin configuration to the object containing the ESLint plugin configuration.
|
|
52
|
+
|
|
53
|
+
```javascript
|
|
54
|
+
// eslint.config.mjs
|
|
55
|
+
import { defineConfig } from 'eslint/config';
|
|
56
|
+
import css from '@eslint/css';
|
|
57
|
+
import { sldsCssPlugin } from '@salesforce-ux/eslint-plugin-slds';
|
|
58
|
+
|
|
59
|
+
export default defineConfig([
|
|
60
|
+
{
|
|
61
|
+
files: ['**/*.css'],
|
|
62
|
+
language: 'css/css',
|
|
63
|
+
plugins: {
|
|
64
|
+
css: css,
|
|
65
|
+
...sldsCssPlugin()
|
|
66
|
+
},
|
|
67
|
+
extends: ['@salesforce-ux/slds/recommended', 'css/recommended']
|
|
68
|
+
}
|
|
69
|
+
]);
|
|
70
|
+
```
|
|
71
|
+
|
|
45
72
|
## Migrate to the Latest Version
|
|
46
73
|
|
|
47
74
|
By default, the latest version of the plugin supports legacy and flat config systems.
|
package/build/index.js
CHANGED
|
@@ -2308,6 +2308,7 @@ var no_hardcoded_values_slds2_default = defineNoHardcodedValueRule({
|
|
|
2308
2308
|
|
|
2309
2309
|
// src/index.ts
|
|
2310
2310
|
var import_parser2 = __toESM(require("@html-eslint/parser"));
|
|
2311
|
+
var import_css = __toESM(require("@eslint/css"));
|
|
2311
2312
|
|
|
2312
2313
|
// eslint.rules.json
|
|
2313
2314
|
var eslint_rules_default = {
|
|
@@ -2355,30 +2356,29 @@ var rules = {
|
|
|
2355
2356
|
var plugin = {
|
|
2356
2357
|
meta: {
|
|
2357
2358
|
name: "@salesforce-ux/eslint-plugin-slds",
|
|
2358
|
-
version: "1.0.
|
|
2359
|
+
version: "1.0.7"
|
|
2359
2360
|
},
|
|
2360
2361
|
rules,
|
|
2361
2362
|
configs: {}
|
|
2362
2363
|
};
|
|
2363
|
-
var
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
sldsRules: { ...eslint_rules_default.css }
|
|
2379
|
-
}
|
|
2364
|
+
var baseCssConfigWithPlugin = {
|
|
2365
|
+
files: ["**/*.{css,scss}"],
|
|
2366
|
+
language: "css/css",
|
|
2367
|
+
languageOptions: {
|
|
2368
|
+
tolerant: true
|
|
2369
|
+
// Allow recoverable parsing errors for SCSS syntax
|
|
2370
|
+
},
|
|
2371
|
+
plugins: {
|
|
2372
|
+
css: import_css.default,
|
|
2373
|
+
"@salesforce-ux/slds": plugin
|
|
2374
|
+
},
|
|
2375
|
+
rules: eslint_rules_default.css,
|
|
2376
|
+
settings: {
|
|
2377
|
+
// Pass rules configuration to context for runtime access
|
|
2378
|
+
sldsRules: { ...eslint_rules_default.css }
|
|
2380
2379
|
}
|
|
2381
|
-
|
|
2380
|
+
};
|
|
2381
|
+
var cssConfigArray = [baseCssConfigWithPlugin];
|
|
2382
2382
|
var htmlConfigArray = [
|
|
2383
2383
|
// HTML/Component config
|
|
2384
2384
|
{
|
|
@@ -2410,5 +2410,11 @@ Object.assign(plugin.configs, {
|
|
|
2410
2410
|
}
|
|
2411
2411
|
}
|
|
2412
2412
|
});
|
|
2413
|
+
function sldsCssPlugin() {
|
|
2414
|
+
return {
|
|
2415
|
+
...baseCssConfigWithPlugin.plugins
|
|
2416
|
+
};
|
|
2417
|
+
}
|
|
2413
2418
|
module.exports = plugin;
|
|
2419
|
+
module.exports.sldsCssPlugin = sldsCssPlugin;
|
|
2414
2420
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/utils/node.ts", "yaml-file:rule-messages.yml", "../src/rules/v9/enforce-bem-usage.ts", "../src/rules/enforce-bem-usage.ts", "../src/rules/no-deprecated-classes-slds2.ts", "../src/rules/modal-close-button-issue.ts", "../src/index.ts", "../src/rules/v9/no-slds-class-overrides.ts", "../src/rules/v9/no-deprecated-slds-classes.ts", "../src/rules/v9/no-deprecated-tokens-slds1.ts", "../src/rules/v9/lwc-token-to-slds-hook.ts", "../src/utils/hardcoded-shared-utils.ts", "../src/utils/value-utils.ts", "../src/utils/color-lib-utils.ts", "../src/utils/css-functions.ts", "../src/utils/css-utils.ts", "../src/rules/v9/enforce-sds-to-slds-hooks.ts", "../src/rules/v9/no-sldshook-fallback-for-lwctoken.ts", "../src/rules/v9/no-unsupported-hooks-slds2.ts", "../src/rules/v9/no-slds-var-without-fallback.ts", "../src/rules/v9/no-slds-namespace-for-custom-hooks.ts", "../src/rules/v9/enforce-component-hook-naming-convention.ts", "../src/rules/v9/reduce-annotations.ts", "../src/rules/v9/no-slds-private-var.ts", "../src/rules/v9/no-hardcoded-values/no-hardcoded-values-slds1.ts", "../src/utils/property-matcher.ts", "../src/rules/v9/no-hardcoded-values/handlers/colorHandler.ts", "../src/utils/styling-hook-utils.ts", "../src/rules/v9/no-hardcoded-values/handlers/densityHandler.ts", "../src/rules/v9/no-hardcoded-values/handlers/fontHandler.ts", "../src/utils/boxShadowValueParser.ts", "../src/rules/v9/no-hardcoded-values/handlers/boxShadowHandler.ts", "../src/utils/rule-utils.ts", "../src/rules/v9/no-hardcoded-values/noHardcodedValueRule.ts", "../src/rules/v9/no-hardcoded-values/no-hardcoded-values-slds2.ts", "../eslint.rules.json"],
|
|
4
|
-
"sourcesContent": ["// THIS IS TAKEN FROM html-eslint\n\nimport { NODE_TYPES } from \"@html-eslint/parser\";\n\n\n/**\n * @param {TagNode | ScriptTagNode | StyleTagNode} node\n * @param {string} key\n * @returns {AttributeNode | undefined}\n */\nfunction findAttr(node, key) {\n return node.attributes.find(\n (attr) => attr.key && attr.key.value.toLowerCase() === key.toLowerCase()\n );\n}\n\n/**\n * Checks whether a node's attributes is empty or not.\n * @param {TagNode | ScriptTagNode | StyleTagNode} node\n * @returns {boolean}\n */\nfunction isAttributesEmpty(node) {\n return !node.attributes || node.attributes.length <= 0;\n}\n\n/**\n * Checks whether a node's all tokens are on the same line or not.\n * @param {AnyNode} node A node to check\n * @returns {boolean} `true` if a node's tokens are on the same line, otherwise `false`.\n */\nfunction isNodeTokensOnSameLine(node) {\n return node.loc.start.line === node.loc.end.line;\n}\n\n/**\n *\n * @param {Range} rangeA\n * @param {Range} rangeB\n * @returns {boolean}\n */\nfunction isRangesOverlap(rangeA, rangeB) {\n return rangeA[0] < rangeB[1] && rangeB[0] < rangeA[1];\n}\n\n/**\n * @param {(TextNode | CommentContentNode)['templates']} templates\n * @param {Range} range\n * @returns {boolean}\n */\nfunction isOverlapWithTemplates(templates, range) {\n return templates\n .filter((template) => template.isTemplate)\n .some((template) => isRangesOverlap(template.range, range));\n}\n\n/**\n *\n * @param {TextNode | CommentContentNode} node\n * @returns {LineNode[]}\n */\nfunction splitToLineNodes(node) {\n let start = node.range[0];\n let line = node.loc.start.line;\n const startCol = node.loc.start.column;\n /**\n * @type {LineNode[]}\n */\n const lineNodes = [];\n const templates = node.templates || [];\n /**\n *\n * @param {import(\"../../types\").Range} range\n */\n function shouldSkipIndentCheck(range) {\n const overlappedTemplates = templates.filter(\n (template) =>\n template.isTemplate && isRangesOverlap(template.range, range)\n );\n\n const isLineInTemplate = overlappedTemplates.some((template) => {\n return template.range[0] <= range[0] && template.range[1] >= range[1];\n });\n if (isLineInTemplate) {\n return true;\n }\n const isLineBeforeTemplate = overlappedTemplates.some((template) => {\n return template.range[0] <= range[0] && template.range[1] <= range[1];\n });\n if (isLineBeforeTemplate) {\n return true;\n }\n const isLineAfterTemplate = overlappedTemplates.some((template) => {\n return template.range[1] <= range[0];\n });\n if (isLineAfterTemplate) {\n return true;\n }\n return false;\n }\n\n node.value.split(\"\\n\").forEach((value, index) => {\n const columnStart = index === 0 ? startCol : 0;\n /**\n * @type {import(\"../../types\").Range}\n */\n const range = [start, start + value.length];\n const loc = {\n start: {\n line,\n column: columnStart,\n },\n end: {\n line,\n column: columnStart + value.length,\n },\n };\n /**\n * @type {LineNode}\n */\n const lineNode = {\n type: \"Line\",\n value,\n range,\n loc,\n skipIndentCheck: shouldSkipIndentCheck(range),\n };\n\n start += value.length + 1;\n line += 1;\n\n lineNodes.push(lineNode);\n });\n\n return lineNodes;\n}\n\n/**\n * Get location between two nodes.\n * @param {BaseNode} before A node placed in before\n * @param {BaseNode} after A node placed in after\n * @returns {Location} location between two nodes.\n */\nfunction getLocBetween(before, after) {\n return {\n start: before.loc.end,\n end: after.loc.start,\n };\n}\n\n/**\n * @param {AttributeValueNode} node\n * @return {boolean}\n */\nfunction isExpressionInTemplate(node) {\n if (node.type === NODE_TYPES.AttributeValue) {\n return node.value.indexOf(\"${\") === 0;\n }\n return false;\n}\n\n/**\n * @param {AnyNode} node\n * @returns {node is TagNode}\n */\nfunction isTag(node) {\n return node.type === NODE_TYPES.Tag;\n}\n\n/**\n * @param {AnyNode} node\n * @returns {node is CommentNode}\n */\nfunction isComment(node) {\n return node.type === NODE_TYPES.Comment;\n}\n\n/**\n * @param {AnyNode} node\n * @returns {node is TextNode}\n */\nfunction isText(node) {\n return node.type === NODE_TYPES.Text;\n}\n\nconst lineBreakPattern = /\\r\\n|[\\r\\n\\u2028\\u2029]/u;\nconst lineEndingPattern = new RegExp(lineBreakPattern.source, \"gu\");\n/**\n * @param {string} source\n * @returns {string[]}\n */\nfunction codeToLines(source) {\n return source.split(lineEndingPattern);\n}\n\n/**\n *\n * @param {AnyToken[]} tokens\n * @returns {((CommentContentNode | TextNode)['templates'][number])[]}\n */\nfunction getTemplateTokens(tokens) {\n return (\n []\n .concat(\n ...tokens\n // @ts-ignore\n .map((token) => token[\"templates\"] || [])\n )\n // @ts-ignore\n .filter((token) => token.isTemplate)\n );\n}\n\nexport {\n findAttr,\n isAttributesEmpty,\n isNodeTokensOnSameLine,\n splitToLineNodes,\n getLocBetween,\n isExpressionInTemplate,\n isTag,\n isComment,\n isText,\n isOverlapWithTemplates,\n codeToLines,\n isRangesOverlap,\n getTemplateTokens,\n};", "module.exports = {\n \"no-slds-class-overrides\": {\n \"description\": \"Create new custom CSS classes instead of overriding SLDS selectors\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-slds-class-overrides\",\n \"type\": \"problem\",\n \"messages\": {\n \"sldsClassOverride\": \"Overriding .{{className}} isn't supported. To differentiate SLDS and custom classes, create a CSS class in your namespace. Examples: myapp-input, myapp-button.\"\n }\n },\n \"no-deprecated-slds-classes\": {\n \"description\": \"Please replace the deprecated classes with a modern equivalent\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-deprecated-slds-classes\",\n \"type\": \"problem\",\n \"messages\": {\n \"deprecatedClass\": \"The class {{className}} is deprecated and not available in SLDS2. Please update to a supported class.\"\n }\n },\n \"no-deprecated-tokens-slds1\": {\n \"description\": \"Update outdated design tokens to SLDS 2 styling hooks with similar values. For more information, see Styling Hooks on lightningdesignsystem.com.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-deprecated-tokens-slds1\",\n \"type\": \"problem\",\n \"messages\": {\n \"deprecatedToken\": \"Consider removing {{oldValue}} or replacing it with {{newValue}}. Set the fallback to {{oldValue}}. For more info, see Styling Hooks on lightningdesignsystem.com.\",\n \"noReplacement\": \"Update outdated design tokens to SLDS 2 styling hooks with similar values. For more information, see Styling Hooks on lightningdesignsystem.com.\"\n }\n },\n \"enforce-sds-to-slds-hooks\": {\n \"description\": \"Convert your existing --sds styling hooks to --slds styling hooks. See lightningdesignsystem.com for more info.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#enforce-sds-to-slds-hooks\",\n \"type\": \"problem\",\n \"messages\": {\n \"replaceSdsWithSlds\": \"Replace {{oldValue}} with {{suggestedMatch}} styling hook.\"\n }\n },\n \"enforce-bem-usage\": {\n \"description\": \"Replace BEM double-dash syntax in class names with single underscore syntax\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#enforce-bem-usage\",\n \"type\": \"problem\",\n \"messages\": {\n \"bemDoubleDash\": \"{{actual}} has been retired. Update it to the new name {{newValue}}.\",\n \"fixBemNaming\": \"Update to correct BEM naming convention\"\n }\n },\n \"modal-close-button-issue\": {\n \"description\": \"Update component attributes or CSS classes for the modal close button to comply with the modal component blueprint\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#modal-close-button-issue\",\n \"type\": \"problem\",\n \"messages\": {\n \"modalCloseButtonIssue\": \"Update component attributes or CSS classes for the modal close button to comply with the modal component blueprint.\",\n \"removeClass\": \"Remove the slds-button_icon-inverse class from the modal close button in components that use the SLDS modal blueprint.\",\n \"changeVariant\": \"Change the variant attribute value from bare-inverse to bare in <lightning-button-icon> or <lightning-icon>.\",\n \"removeVariant\": \"Remove the variant attribute from the <lightning-icon> component inside the <button> element.\",\n \"ensureButtonClasses\": \"Add or move slds-button and slds-button_icon to the class attribute of the <button> element or <lightning-button-icon> component.\",\n \"ensureSizeAttribute\": \"To size icons properly, set the size attribute \u200Cto large in the <lightning-icon> and <lightning-button-icon> components.\"\n }\n },\n \"no-deprecated-classes-slds2\": {\n \"description\": \"Replace classes that aren't available with SLDS 2 classes\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-deprecated-classes-slds2\",\n \"type\": \"problem\",\n \"messages\": {\n \"deprecatedClass\": \"The class {{className}} isn't available in SLDS 2. Update it to a class supported in SLDS 2. See lightningdesignsystem.com for more information.\",\n \"updateToModernClass\": \"Replace deprecated class with modern equivalent\",\n \"checkDocumentation\": \"See lightningdesignsystem.com for SLDS 2 class alternatives\"\n }\n },\n \"lwc-token-to-slds-hook\": {\n \"description\": \"Replace the deprecated --lwc tokens with the latest --slds tokens. See lightningdesignsystem.com for more info.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#lwc-token-to-slds-hook\",\n \"type\": \"problem\",\n \"messages\": {\n \"errorWithReplacement\": \"The '{{oldValue}}' design token is deprecated. Replace it with '{{newValue}}'. For more info, see Global Styling Hooks on lightningdesignsystem.com.\",\n \"errorWithStyleHooks\": \"The '{{oldValue}}' design token is deprecated. Replace it with the SLDS 2 '{{newValue}}' styling hook and set the fallback to '{{oldValue}}'. For more info, see Global Styling Hooks on lightningdesignsystem.com.\",\n \"errorWithNoRecommendation\": \"The '{{oldValue}}' design token is deprecated. For more info, see the New Global Styling Hook Guidance on lightningdesignsystem.com.\"\n }\n },\n \"no-sldshook-fallback-for-lwctoken\": {\n \"description\": \"Avoid using --slds styling hooks as fallback values for --lwc tokens.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-sldshook-fallback-for-lwctoken\",\n \"type\": \"problem\",\n \"messages\": {\n \"unsupportedFallback\": \"Remove the {{sldsToken}} styling hook that is used as a fallback value for {{lwcToken}}.\"\n }\n },\n \"no-unsupported-hooks-slds2\": {\n \"description\": \"Identifies styling hooks that aren't present in SLDS 2. They must be replaced with styling hooks that have a similar effect, or they must be removed.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-unsupported-hooks-slds2\",\n \"type\": \"problem\",\n \"messages\": {\n \"deprecated\": \"The {{token}} styling hook isn't present in SLDS 2 and there's no equivalent replacement. Remove it or replace it with a styling hook with a similar effect.\"\n }\n },\n \"no-slds-var-without-fallback\": {\n \"description\": \"Add fallback values to SLDS styling hooks. The fallback values are used in Salesforce environments where styling hooks are unavailable.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-slds-var-without-fallback\",\n \"type\": \"problem\",\n \"messages\": {\n \"varWithoutFallback\": \"Your code uses the {{cssVar}} styling hook without a fallback value. Styling hooks are unavailable in some Salesforce environments. To render your component correctly in all environments, add this fallback value: var({{cssVar}}, {{recommendation}}). To make this fallback value brand-aware, use a branded design token instead of a static value. See Design Tokens on v1.lightningdesignsystem.com.\"\n }\n },\n \"no-slds-namespace-for-custom-hooks\": {\n \"description\": \"To differentiate custom styling hooks from SLDS styling hooks, create custom styling hooks in your namespace.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-slds-namespace-for-custom-hooks\",\n \"type\": \"problem\",\n \"messages\": {\n \"customHookNamespace\": \"Using the --slds namespace for {{token}} isn't supported. Create the custom styling hook in your namespace. Example: --myapp-{{tokenWithoutNamespace}}\"\n }\n },\n \"no-slds-private-var\": {\n \"description\": \"Some SLDS styling hooks are private and reserved only for internal Salesforce use. Private SLDS styling hooks have prefixes --_slds- and --slds-s-. For more information, look up private CSS in lightningdesignsystem.com.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-slds-private-var\",\n \"type\": \"problem\",\n \"messages\": {\n \"privateVar\": \"This styling hook is reserved for internal Salesforce use. Remove the --_slds- or \u2013slds-s private variable within selector {{prop}}. For more information, look up private CSS in lightningdesignsystem.com.\"\n }\n },\n \"enforce-component-hook-naming-convention\": {\n \"description\": \"Replace component styling hooks that use a deprecated naming convention.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#enforce-component-hook-naming-convention\",\n \"type\": \"problem\",\n \"messages\": {\n \"replace\": \"Replace the deprecated {{oldValue}} component styling hook with {{suggestedMatch}}.\"\n }\n },\n \"no-hardcoded-values-slds1\": {\n \"description\": \"Replace static values with SLDS 1 design tokens. For more information, look up design tokens on lightningdesignsystem.com.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-hardcoded-value\",\n \"type\": \"suggestion\",\n \"messages\": {\n \"hardcodedValue\": \"Replace the {{oldValue}} static value with an SLDS 1 styling hook: {{newValue}}.\",\n \"noReplacement\": \"There's no replacement styling hook for the {{oldValue}} static value. Remove the static value.\"\n }\n },\n \"no-hardcoded-values-slds2\": {\n \"description\": \"Replace static values with SLDS 2 styling hooks. For more information, look up design tokens on lightningdesignsystem.com.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-hardcoded-values-slds2\",\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", "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 { 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};", "import { Rule } from 'eslint';\nimport { findAttr, isAttributesEmpty } from \"../utils/node\";\nimport ruleMessages from '../config/rule-messages.yml';\n\nconst ruleConfig = ruleMessages['modal-close-button-issue'];\n\n// This rule specific to CVS, find more details here https://issues.salesforce.com/issue/a028c00000zh1iqAAA/modal-close-button-is-not-visible-with-the-new-white-background-after-winter-25-release\nexport = {\n meta: {\n type: ruleConfig.type,\n docs: {\n category: \"Best Practices\",\n recommended: true,\n description: ruleConfig.description,\n url: ruleConfig.url\n },\n fixable: \"code\",\n schema: [],\n messages: ruleConfig.messages,\n },\n\n create(context) {\n function check(node) {\n if (isAttributesEmpty(node)) {\n return;\n }\n\n const tagName = node.name;\n\n // \u2705 Scenario 1: Remove 'slds-button_icon-inverse' from <button> \n // (optional) when the parent of the button has class name `slds-modal`\n // and also button should have class `slds-modal__close`\n if (tagName === \"button\") {\n const classAttr = findAttr(node, \"class\");\n if (classAttr && classAttr.value) {\n const classList = classAttr.value.value.split(/\\s+/);\n\n // \u2705 Ensure button has \"slds-modal__close\" before proceeding\n if (!classList.includes(\"slds-modal__close\")) {\n return; // Stop execution if the class is missing\n }\n\n if (classList.includes(\"slds-button_icon-inverse\") || classList.includes(\"slds-button--icon-inverse\")) {\n const newClassList = classList\n .filter((cls) => (cls !== \"slds-button_icon-inverse\" && cls !== \"slds-button--icon-inverse\"))\n .join(\" \");\n context.report({\n node,\n loc: classAttr.loc,\n messageId: \"removeClass\",\n fix(fixer) { \n return fixer.replaceText(classAttr, // Replace the full attribute\n `class=\"${newClassList}\"` // Updated class list\n );\n },\n });\n }\n }\n }\n\n // \u2705 Scenario 2: Fix <lightning-button-icon> and this should have class `slds-modal__close`\n if (tagName === \"lightning-button-icon\" || tagName === \"lightning:buttonIcon\") {\n const variantAttr = findAttr(node, \"variant\");\n const sizeAttr = findAttr(node, \"size\");\n const classAttr = findAttr(node, \"class\");\n const iconClassAttr = findAttr(node, \"icon-class\"); // \uD83D\uDD0D Check for icon-class attribute\n \n function validateClassAttr(attribute, attrName) {\n if (attribute && attribute.value) {\n const classList = attribute.value.value.split(/\\s+/);\n\n // Irrespective of whether we are checking for class or icon-class we need to check whether the attribute is present or not.\n // \u2705 Ensure \"slds-modal__close\" exists before proceeding\n if(!classAttr?.value?.value?.includes(\"slds-modal__close\"))\n {\n return;\n }\n \n // \u2705 Ensure \"slds-modal__close\" exists before proceeding\n // if (!classList.includes(\"slds-modal__close\")) {\n // return; // Stop execution if the class is missing\n // }\n \n // Remove inverse classes\n if (classList.includes(\"slds-button_icon-inverse\") || classList.includes(\"slds-button--icon-inverse\")) {\n const newClassList = classList\n .filter((cls) => cls !== \"slds-button_icon-inverse\" && cls !== \"slds-button--icon-inverse\")\n .join(\" \");\n context.report({\n node,\n loc: attribute.loc,\n messageId: \"removeClass\",\n fix(fixer) {\n return fixer.replaceText(attribute, // Replace the full attribute\n `${attrName}=\"${newClassList}\"` // Correctly modifies the respective attribute\n );\n },\n });\n }\n \n // Ensure 'slds-button' and 'slds-button_icon' exist\n if (!classList.includes(\"slds-button\") || !classList.includes(\"slds-button_icon\")) {\n let newClassList;\n if(attrName === 'icon-class'){\n newClassList = [\n ...classList.filter((cls) => cls !== \"slds-button_icon-inverse\"),\n ].join(\" \");\n }else{\n newClassList = [\n \"slds-button\",\n \"slds-button_icon\",\n ...classList.filter((cls) => cls !== \"slds-button_icon-inverse\"),\n ].join(\" \");\n }\n context.report({\n node: attribute,\n loc: attribute.value.loc,\n messageId: \"ensureButtonClasses\",\n fix(fixer) {\n return fixer.replaceText(attribute.value, `${newClassList}`);\n },\n });}\n \n // Fix variant=\"bare-inverse\" to \"bare\"\n if (variantAttr && variantAttr.value && variantAttr.value.value === \"bare-inverse\") {\n context.report({\n node: variantAttr,\n messageId: \"changeVariant\",\n loc: variantAttr.value.loc,\n fix(fixer) {\n return fixer.replaceText(variantAttr.value, `bare`);\n },\n });\n }\n \n // Ensure size=\"large\" exists\n // if (!sizeAttr) {\n // context.report({\n // node,\n // message: messages[\"ensureSizeAttribute\"],\n // fix(fixer) {\n // if (variantAttr) {\n // return fixer.insertTextAfterRange([variantAttr.range[1], variantAttr.range[1]], ' size=\"large\"');\n // }\n // },\n // });\n // }\n }\n }\n \n // \u2705 Validate `class` and `icon-class` separately, maintaining their own attribute names\n validateClassAttr(classAttr, \"class\");\n validateClassAttr(iconClassAttr, \"icon-class\");\n }\n\n // \u2705 Scenario 3: Fix <lightning-icon> inside <button> & the class name of the parent name as button and it should have `slds-modal__close`\n if ((tagName === \"lightning-icon\" || tagName === \"lightning:icon\") && node.parent?.name === \"button\") {\n const parentClassAttr = findAttr(node.parent, \"class\");\n if (parentClassAttr && parentClassAttr.value) {\n const parentClassList = parentClassAttr.value.value.split(/\\s+/);\n\n // \u2705 Ensure the parent <button> has \"slds-modal__close\" before proceeding\n if (!parentClassList.includes(\"slds-modal__close\")) {\n return; // Stop execution if the class is missing\n }\n const variantAttr = findAttr(node, \"variant\");\n const sizeAttr = findAttr(node, \"size\");\n\n // Fix variant=\"bare-inverse\" to \"bare\"\n if (variantAttr && variantAttr.value && variantAttr.value.value === \"bare-inverse\") {\n context.report({\n node: variantAttr,\n messageId: \"changeVariant\",\n loc: variantAttr.value.loc,\n fix(fixer) {\n return fixer.replaceText(variantAttr.value, `bare`);\n },\n });\n }\n\n // // Remove variant attribute completely\n // if (variantAttr) {\n // context.report({\n // node: variantAttr,\n // messageId: \"removeVariant\",\n // fix(fixer) {\n // return fixer.remove(variantAttr);\n // },\n // });\n // }\n\n //Ensure size=\"large\" is set\n // if (!sizeAttr) {\n // context.report({\n // node,\n // message: messages[\"ensureSizeAttribute\"],\n // fix(fixer) {\n // //return fixer.insertTextAfter(node, ' size=\"large\"');\n // if(variantAttr)\n // {\n // return fixer.insertTextAfterRange([variantAttr.range[1], variantAttr.range[1]], ' size=\"large\"')\n // }\n // },\n // });\n // }\n }\n }\n }\n return {\n Tag: check,\n };\n },\n};", "// Unified ESLint plugin config for both v8 (legacy) and v9+ (flat)\n\nimport enforceBemUsage from './rules/enforce-bem-usage';\nimport noDeprecatedClassesSlds2 from './rules/no-deprecated-classes-slds2';\nimport modalCloseButtonIssue from './rules/modal-close-button-issue';\nimport noSldsClassOverrides from './rules/v9/no-slds-class-overrides';\nimport noDeprecatedSldsClasses from './rules/v9/no-deprecated-slds-classes';\nimport noDeprecatedTokensSlds1 from './rules/v9/no-deprecated-tokens-slds1';\nimport lwcTokenToSldsHook from './rules/v9/lwc-token-to-slds-hook';\nimport enforceSdsToSldsHooks from './rules/v9/enforce-sds-to-slds-hooks';\nimport noSldshookFallbackForLwctoken from './rules/v9/no-sldshook-fallback-for-lwctoken';\nimport noUnsupportedHooksSlds2 from './rules/v9/no-unsupported-hooks-slds2';\nimport noSldsVarWithoutFallback from './rules/v9/no-slds-var-without-fallback';\nimport noSldsNamespaceForCustomHooks from './rules/v9/no-slds-namespace-for-custom-hooks';\nimport enforceComponentHookNamingConvention from './rules/v9/enforce-component-hook-naming-convention';\nimport reduceAnnotations from './rules/v9/reduce-annotations';\nimport noSldsPrivateVar from './rules/v9/no-slds-private-var';\nimport noHardcodedValuesSlds1 from './rules/v9/no-hardcoded-values/no-hardcoded-values-slds1';\nimport noHardcodedValuesSlds2 from './rules/v9/no-hardcoded-values/no-hardcoded-values-slds2';\n\n\nimport htmlParser from \"@html-eslint/parser\";\n\n// Import rule configurations based on persona\nimport ruleConfigs from '../eslint.rules.json';\n\nconst rules = {\n \"enforce-bem-usage\": enforceBemUsage,\n \"no-deprecated-classes-slds2\": noDeprecatedClassesSlds2,\n \"modal-close-button-issue\": modalCloseButtonIssue,\n \"no-slds-class-overrides\": noSldsClassOverrides,\n \"no-deprecated-slds-classes\": noDeprecatedSldsClasses,\n \"no-deprecated-tokens-slds1\": noDeprecatedTokensSlds1,\n \"lwc-token-to-slds-hook\": lwcTokenToSldsHook,\n \"enforce-sds-to-slds-hooks\": enforceSdsToSldsHooks,\n \"no-sldshook-fallback-for-lwctoken\": noSldshookFallbackForLwctoken,\n \"no-unsupported-hooks-slds2\": noUnsupportedHooksSlds2,\n \"no-slds-var-without-fallback\": noSldsVarWithoutFallback,\n \"no-slds-namespace-for-custom-hooks\": noSldsNamespaceForCustomHooks,\n \"enforce-component-hook-naming-convention\": enforceComponentHookNamingConvention,\n \"no-slds-private-var\": noSldsPrivateVar,\n \"no-hardcoded-values-slds1\": noHardcodedValuesSlds1,\n \"no-hardcoded-values-slds2\": noHardcodedValuesSlds2,\n \"reduce-annotations\": reduceAnnotations\n};\n\nconst plugin = {\n meta: {\n name: \"@salesforce-ux/eslint-plugin-slds\",\n version: process.env.PLUGIN_VERSION\n },\n rules,\n configs: {}\n};\n\nconst cssConfigArray = [\n // CSS config - Standard CSS files\n {\n files: [\"**/*.{css,scss}\"],\n language: \"css/css\",\n languageOptions: {\n tolerant: true // Allow recoverable parsing errors for SCSS syntax\n },\n plugins: {\n \"@salesforce-ux/slds\": plugin\n },\n rules: ruleConfigs.css,\n settings: {\n // Pass rules configuration to context for runtime access\n sldsRules: { ...ruleConfigs.css }\n }\n }\n];\n\nconst htmlConfigArray = [\n // HTML/Component config\n {\n files: [\"**/*.html\", \"**/*.cmp\"],\n languageOptions: {\n parser: htmlParser,\n ecmaVersion: 2021,\n sourceType: \"module\"\n },\n plugins: {\n \"@salesforce-ux/slds\": plugin\n },\n rules: ruleConfigs.html\n }\n];\n\nObject.assign(plugin.configs, {\n // Flat config for ESLint v9+\n \"flat/recommended-css\": cssConfigArray,\n \"flat/recommended-html\": htmlConfigArray,\n \"flat/recommended\": [...cssConfigArray, ...htmlConfigArray],\n // legacy config for ESLint v8-\n recommended: {\n plugins: [\"@salesforce-ux/slds\"],\n rules: ruleConfigs.html,\n parser: htmlParser,\n parserOptions: {\n ecmaVersion: 2021,\n sourceType: \"module\"\n }\n }\n});\n\nmodule.exports = plugin;\n", "/**\n * @fileoverview Rule to disallow overriding SLDS CSS classes\n * Compatible with @eslint/css parser for ESLint v9\n * Maintains full parity with stylelint version behavior\n */\n\nimport { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata';\nimport ruleMessages from '../../config/rule-messages.yml';\n\nconst ruleConfig = ruleMessages['no-slds-class-overrides'];\n\n// Get SLDS classes from metadata (same as stylelint version)\nconst sldsClasses = metadata.sldsPlusClasses;\nconst sldsClassesSet = new Set(sldsClasses);\n\nexport default {\n meta: {\n type: ruleConfig.type,\n docs: {\n description: ruleConfig.description,\n recommended: true, //useful for plugin recommended configs\n url: ruleConfig.url,\n },\n fixable: null,\n hasSuggestions: false,\n schema: [],\n messages: ruleConfig.messages,\n },\n \n create(context) {\n return {\n // For no-slds-class-overrides: Only flags classes at selector end\n \"SelectorList Selector\"(node) {\n // Get the last ClassSelector in this selector (the one at the end)\n const classSelectorNode = node.children.filter((child) => child.type === \"ClassSelector\").at(-1);\n \n if (classSelectorNode) {\n const className = classSelectorNode.name;\n \n // Check if it's an SLDS class that exists in metadata\n if (className && \n className.startsWith('slds-') && \n sldsClassesSet.has(className)) {\n context.report({\n node: classSelectorNode,\n messageId: 'sldsClassOverride',\n data: { className },\n });\n }\n }\n },\n };\n },\n} as Rule.RuleModule; ", "import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata';\nimport ruleMessages from '../../config/rule-messages.yml';\n\nconst {type, description, url, messages} = ruleMessages['no-deprecated-slds-classes'];\n\nconst deprecatedClasses = metadata.deprecatedClasses;\nconst deprecatedClassesSet = new Set(deprecatedClasses);\n\nexport default {\n meta: {\n type,\n docs: {\n description,\n recommended: true,\n url,\n },\n messages,\n },\n \n create(context) {\n return {\n // For no-deprecated-slds-classes: Check all class selectors for deprecated classes\n \"SelectorList Selector ClassSelector\"(node) {\n const cssClassSelector = context.sourceCode.getText(node);\n \n // Extract class name (remove the leading dot)\n const className = cssClassSelector.substring(1);\n \n // Check if it's a deprecated SLDS class\n if (className && deprecatedClassesSet.has(className)) {\n context.report({\n node,\n messageId: 'deprecatedClass',\n data: { className },\n });\n }\n },\n };\n },\n} as Rule.RuleModule;\n", "import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata';\nimport ruleMessages from '../../config/rule-messages.yml';\n\nconst ruleConfig = ruleMessages['no-deprecated-tokens-slds1'];\nconst { type, description, url, messages } = ruleConfig;\n\n// Get token mapping from metadata (Aura tokens to LWC tokens)\nconst tokenMapping = metadata.auraToLwcTokensMapping;\n\nexport default {\n meta: {\n type,\n docs: {\n description: description,\n recommended: true,\n url,\n },\n fixable: 'code',\n messages,\n },\n \n create(context) {\n /**\n * Check if a token should be ignored (not in mapping or not LWC token)\n */\n function shouldIgnoreDetection(token: string): boolean {\n return (!(token in tokenMapping) || !tokenMapping[token].startsWith('--lwc-'));\n }\n\n /**\n * Generate replacement suggestion for deprecated token\n */\n function generateReplacement(tokenName: string, originalFunctionCall: string): string | null {\n if (shouldIgnoreDetection(tokenName)) {\n return null;\n }\n const recommendation = tokenMapping[tokenName];\n return `var(${recommendation}, ${originalFunctionCall})`;\n }\n\n function handleTokenFunction(node, functionName) {\n // Get the token name from the identifier\n const tokenName = context.sourceCode.getText(node);\n \n // Skip if token should be ignored\n if (shouldIgnoreDetection(tokenName)) {\n return;\n }\n\n // Create original function call - mirroring stylelint's approach\n const originalFunctionCall = `${functionName}(${tokenName})`;\n const replacement = generateReplacement(tokenName, originalFunctionCall);\n \n if (replacement) {\n // Report with replacement suggestion\n context.report({\n node,\n messageId: 'deprecatedToken',\n data: { \n oldValue: originalFunctionCall,\n newValue: replacement\n },\n fix(fixer) {\n // Use node position to avoid multiple replacements of same token\n const sourceCode = context.sourceCode.getText();\n const tokenFunctionCall = `${functionName}(${tokenName})`;\n const nodeOffset = node.loc.start.offset;\n \n // Search backwards from the node position to find the function start\n const searchStart = Math.max(0, nodeOffset - functionName.length - 1);\n const searchEnd = nodeOffset + tokenName.length + 1;\n const searchArea = sourceCode.substring(searchStart, searchEnd);\n \n const functionCallIndex = searchArea.indexOf(tokenFunctionCall);\n if (functionCallIndex !== -1) {\n const actualStart = searchStart + functionCallIndex;\n const actualEnd = actualStart + tokenFunctionCall.length;\n return fixer.replaceTextRange([actualStart, actualEnd], replacement);\n }\n return null;\n }\n });\n } else {\n // Report without specific replacement\n context.report({\n node,\n messageId: 'noReplacement',\n });\n }\n }\n\n return {\n \"Function[name='token'] Identifier\"(node) {\n handleTokenFunction(node, 'token');\n },\n \"Function[name='t'] Identifier\"(node) {\n handleTokenFunction(node, 't');\n },\n };\n\n },\n} as Rule.RuleModule;\n", "import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata';\nimport ruleMessages from '../../config/rule-messages.yml';\nimport { formatSuggestionHooks, forEachLwcVariable, type CssVariableInfo } from '../../utils/css-utils';\nimport type { PositionInfo } from '../../utils/hardcoded-shared-utils';\n\nconst ruleConfig = ruleMessages['lwc-token-to-slds-hook'];\nconst { type, description, url, messages } = ruleConfig;\n\nconst lwcToSlds = metadata.lwcToSlds;\n\n// Replacement category enum to match Stylelint version\nenum ReplacementCategory {\n EMPTY = 'empty',\n SLDS_TOKEN = 'slds_token',\n ARRAY = 'array',\n RAW_VALUE = 'raw_value'\n}\n\nfunction shouldIgnoreDetection(lwcToken: string): boolean {\n // Ignore if entry not found in the list or the token is marked to use further\n return (\n !lwcToken.startsWith('--lwc-') ||\n !(lwcToken in lwcToSlds) ||\n lwcToSlds[lwcToken].continueToUse\n );\n}\n\nfunction categorizeReplacement(recommendation: string | string[]): ReplacementCategory {\n if (!recommendation || recommendation === '--') {\n return ReplacementCategory.EMPTY;\n }\n if (Array.isArray(recommendation)) {\n return ReplacementCategory.ARRAY;\n }\n if (typeof recommendation === 'string' && recommendation.startsWith('--slds-')) {\n return ReplacementCategory.SLDS_TOKEN;\n }\n return ReplacementCategory.RAW_VALUE;\n}\n\nfunction getRecommendation(lwcToken: string) {\n const oldValue = lwcToken;\n const recommendation = lwcToSlds[oldValue]?.replacement || '';\n const replacementCategory = categorizeReplacement(recommendation);\n const hasRecommendation = oldValue in lwcToSlds && replacementCategory !== ReplacementCategory.EMPTY;\n return { hasRecommendation, recommendation, replacementCategory };\n}\n\nfunction getReportMessage(cssVar: string, replacementCategory: ReplacementCategory, recommendation: string | string[]): { messageId: string, data: any } {\n if (!recommendation) {\n // Found a deprecated token but don't have any alternate recommendation then just report user to follow docs\n return {\n messageId: 'errorWithNoRecommendation',\n data: { oldValue: cssVar }\n };\n } else if (replacementCategory === ReplacementCategory.ARRAY) {\n return {\n messageId: 'errorWithStyleHooks',\n data: { oldValue: cssVar, newValue: formatSuggestionHooks(recommendation as string[]) }\n };\n } else if (replacementCategory === ReplacementCategory.SLDS_TOKEN) {\n return {\n messageId: 'errorWithStyleHooks',\n data: { oldValue: cssVar, newValue: recommendation as string }\n };\n } else {\n return {\n messageId: 'errorWithReplacement',\n data: { oldValue: cssVar, newValue: recommendation as string }\n };\n }\n}\n\nexport default {\n meta: {\n type,\n docs: {\n description,\n recommended: true,\n url,\n },\n fixable: 'code',\n messages,\n },\n \n create(context) {\n function reportAndFix(\n node: any,\n suggestedMatch: string | null,\n messageId: string,\n data: any,\n fixRange?: [number, number],\n loc?: any\n ) {\n context.report({\n node,\n loc: loc || node.loc,\n messageId,\n data,\n fix: suggestedMatch && fixRange ? (fixer) => {\n return fixer.replaceTextRange(fixRange, suggestedMatch);\n } : undefined\n });\n }\n\n return {\n // CSS custom property declarations: Check both property name and value\n \"Declaration\"(node) {\n // Check 1: Property name (left-side) for custom properties using --lwc- prefix\n const property = node.property;\n if (property && property.startsWith('--lwc-')) {\n if (!shouldIgnoreDetection(property)) {\n const { hasRecommendation, recommendation, replacementCategory } = getRecommendation(property);\n const { messageId, data } = getReportMessage(property, replacementCategory, recommendation);\n \n // Only provide auto-fix for SLDS token replacements\n const suggestedMatch = (hasRecommendation && replacementCategory === ReplacementCategory.SLDS_TOKEN) \n ? recommendation as string \n : null;\n \n // Calculate fix range for property name\n const propertyStart = node.loc.start.offset;\n const propertyEnd = propertyStart + property.length;\n \n reportAndFix(node, suggestedMatch, messageId, data, [propertyStart, propertyEnd]);\n }\n }\n\n // Check 2: Property value (right-side) - Use AST parsing to detect var(--lwc-*) functions\n // Note: We use forEachLwcVariable instead of Function[name='var'] handler because\n // ESLint treats custom property values (e.g., --custom-prop: var(--lwc-token)) as raw strings\n // rather than parsing them into Function nodes. This AST-based approach handles both cases.\n const valueText = context.sourceCode.getText(node.value);\n if (valueText) {\n forEachLwcVariable(valueText, (variableInfo: CssVariableInfo, positionInfo: PositionInfo) => {\n const { name: lwcToken, hasFallback } = variableInfo;\n \n if (shouldIgnoreDetection(lwcToken)) {\n return;\n }\n\n const { hasRecommendation, recommendation, replacementCategory } = getRecommendation(lwcToken);\n const { messageId, data } = getReportMessage(lwcToken, replacementCategory, recommendation);\n \n let suggestedMatch: string | null = null;\n \n if (hasRecommendation) {\n if (replacementCategory === ReplacementCategory.SLDS_TOKEN) {\n // Extract fallback value from the original var() call if present\n // Use position info to get the full var() call text\n let fallbackValue: string | null = null;\n if (hasFallback && positionInfo.start && positionInfo.end && positionInfo.start.offset !== undefined && positionInfo.end.offset !== undefined) {\n const varCallText = valueText.substring(positionInfo.start.offset, positionInfo.end.offset);\n // Find the comma after the token name and extract everything after it (before the closing paren)\n const commaIndex = varCallText.indexOf(',');\n if (commaIndex !== -1) {\n // Extract from after comma to before closing paren\n fallbackValue = varCallText.substring(commaIndex + 1, varCallText.length - 1).trim();\n }\n }\n \n // Create the replacement in the format: var(--slds-token, var(--lwc-token, fallback))\n // This preserves any existing fallback value\n const originalVarCall = fallbackValue \n ? `var(${lwcToken}, ${fallbackValue})`\n : `var(${lwcToken})`;\n suggestedMatch = `var(${recommendation}, ${originalVarCall})`;\n } else if (replacementCategory === ReplacementCategory.RAW_VALUE) {\n suggestedMatch = recommendation as string;\n }\n }\n\n // Calculate fix range and location using position info from AST parsing\n const valueStartOffset = node.value.loc.start.offset;\n const varStartOffset = valueStartOffset + (positionInfo.start?.offset || 0);\n const varEndOffset = valueStartOffset + (positionInfo.end?.offset || valueText.length);\n \n // Calculate precise location if position info is available\n const preciseLoc = positionInfo.start && positionInfo.end && node.value.loc ? {\n start: {\n line: node.value.loc.start.line + positionInfo.start.line - 1,\n column: node.value.loc.start.column + positionInfo.start.column - 1\n },\n end: {\n line: node.value.loc.start.line + positionInfo.end.line - 1,\n column: node.value.loc.start.column + positionInfo.end.column - 1\n }\n } : node.value.loc;\n \n reportAndFix(node, suggestedMatch, messageId, data, [varStartOffset, varEndOffset], preciseLoc);\n });\n }\n },\n };\n },\n} as Rule.RuleModule;\n", "import { parse, walk } from '@eslint/css-tree';\nimport type { HandlerContext } from '../types';\nimport type { ParsedUnitValue } from './value-utils';\nimport { ALLOWED_UNITS } from './value-utils';\nimport { extractColorValue } from './color-lib-utils';\nimport { isCssFunction } from './css-functions';\n\n/**\n * Common replacement data structure used by both color and density handlers\n */\nexport interface ReplacementInfo {\n start: number;\n end: number;\n replacement: string; // Full CSS var: var(--hook, fallback)\n displayValue: string; // Just the hook: --hook\n hasHook: boolean;\n}\n\n/**\n * Position information from CSS tree parsing\n */\nexport interface PositionInfo {\n start?: { offset: number; line: number; column: number };\n end?: { offset: number; line: number; column: number };\n}\n\n/**\n * Generic callback for processing values with position information\n */\nexport type ValueCallback<T> = (value: T, positionInfo?: PositionInfo) => void;\n\n/**\n * Known valid font-weight values\n */\nconst FONT_WEIGHTS = [\n 'normal',\n 'bold', \n 'bolder',\n 'lighter',\n '100',\n '200', \n '300',\n '400',\n '500',\n '600',\n '700',\n '800',\n '900'\n];\n\n/**\n * Check if a value is a known font-weight\n */\nexport function isKnownFontWeight(value: string | number): boolean {\n const stringValue = value.toString();\n return FONT_WEIGHTS.includes(stringValue.toLowerCase());\n}\n\n/**\n * Generic shorthand auto-fix handler\n * Handles the common logic for reconstructing shorthand values with replacements\n */\nexport function handleShorthandAutoFix(\n declarationNode: any,\n context: HandlerContext,\n valueText: string,\n replacements: ReplacementInfo[]\n) {\n // Sort replacements by position for proper reconstruction\n const sortedReplacements = replacements.sort((a, b) => a.start - b.start);\n \n // Check if we can apply auto-fix (at least one value has a hook)\n const hasAnyHooks = sortedReplacements.some(r => r.hasHook);\n const canAutoFix = hasAnyHooks;\n\n // Report each individual value\n sortedReplacements.forEach(({ start, end, replacement, displayValue, hasHook }) => {\n const originalValue = valueText.substring(start, end);\n const valueStartColumn = declarationNode.value.loc.start.column;\n const valueColumn = valueStartColumn + start;\n \n // Create precise error location for this value\n const { loc: { start: locStart, end: locEnd } } = declarationNode.value;\n const reportNode = {\n ...declarationNode.value,\n loc: {\n ...declarationNode.value.loc,\n start: {\n ...locStart,\n column: valueColumn\n },\n end: {\n ...locEnd,\n column: valueColumn + originalValue.length\n }\n }\n };\n\n if (hasHook) {\n // Create auto-fix for the entire shorthand value\n const fix = canAutoFix ? (fixer: any) => {\n // Reconstruct the entire value with all replacements\n let newValue = valueText;\n \n // Apply replacements from right to left to maintain string positions\n for (let i = sortedReplacements.length - 1; i >= 0; i--) {\n const { start: rStart, end: rEnd, replacement: rReplacement } = sortedReplacements[i];\n newValue = newValue.substring(0, rStart) + rReplacement + newValue.substring(rEnd);\n }\n \n return fixer.replaceText(declarationNode.value, newValue);\n } : undefined;\n\n context.context.report({\n node: reportNode,\n messageId: 'hardcodedValue',\n data: {\n oldValue: originalValue,\n newValue: displayValue\n },\n fix\n });\n } else {\n // No hook available\n context.context.report({\n node: reportNode,\n messageId: 'noReplacement',\n data: {\n oldValue: originalValue\n }\n });\n }\n });\n}\n\n/**\n * Generic CSS tree traversal with position tracking\n * Always provides position information since both handlers need it\n */\nexport function forEachValue<T>(\n valueText: string,\n extractValue: (node: any) => T | null,\n shouldSkipNode: (node: any) => boolean,\n callback: (value: T, positionInfo: PositionInfo) => void\n): void {\n if (!valueText || typeof valueText !== 'string') {\n return;\n }\n\n try {\n const ast = parse(valueText, { context: 'value' as const, positions: true });\n \n walk(ast, {\n enter(node: any) {\n // Skip nodes efficiently using this.skip\n if (shouldSkipNode(node)) {\n return this.skip;\n }\n \n const value = extractValue(node);\n if (value !== null) {\n const positionInfo: PositionInfo = {\n start: node.loc?.start,\n end: node.loc?.end\n };\n callback(value, positionInfo);\n }\n }\n });\n } catch (error) {\n // Silently handle parse errors\n return;\n }\n}\n\n/**\n * Check if color node should be skipped during traversal\n */\nfunction shouldSkipColorNode(node: any): boolean {\n return node.type === 'Function' && isCssFunction(node.name);\n}\n\n/**\n * Check if dimension node should be skipped during traversal\n * Skip all function nodes by default\n */\nfunction shouldSkipDimensionNode(node: any): boolean {\n return node.type === 'Function';\n}\n\n/**\n * Extract dimension value from CSS AST node\n * Returns structured data with number and unit to eliminate regex parsing\n */\nfunction extractDimensionValue(valueNode: any, cssProperty?: string): ParsedUnitValue | null {\n if (!valueNode) return null;\n \n switch (valueNode.type) {\n case 'Dimension':\n // Dimensions: 16px, 1rem -> extract value and unit directly from AST\n const numValue = Number(valueNode.value);\n if (numValue === 0) return null; // Skip zero values\n \n const unit = valueNode.unit.toLowerCase();\n if (!ALLOWED_UNITS.includes(unit)) return null; // Support only allowed units\n \n return {\n number: numValue,\n unit: unit as 'px' | 'rem' | '%' | 'em' | 'ch'\n };\n \n case 'Number':\n // Numbers: 400, 1.5 -> treat as unitless (font-weight, line-height, etc.)\n const numberValue = Number(valueNode.value);\n if (numberValue === 0) return null; // Skip zero values\n \n return {\n number: numberValue,\n unit: null\n };\n \n case 'Percentage':\n // Percentage values: 100%, 50% -> extract value and add % unit\n const percentValue = Number(valueNode.value);\n if (percentValue === 0) return null; // Skip zero values\n \n return {\n number: percentValue,\n unit: '%'\n };\n \n case 'Value':\n // Value wrapper - extract from first child\n return valueNode.children?.[0] ? extractDimensionValue(valueNode.children[0], cssProperty) : null;\n }\n \n return null;\n}\n\n/**\n * Specialized color value traversal\n * Handles color-specific extraction and skipping logic\n */\nexport function forEachColorValue(\n valueText: string,\n callback: (colorValue: string, positionInfo: PositionInfo) => void\n): void {\n forEachValue(valueText, extractColorValue, shouldSkipColorNode, callback);\n}\n\n/**\n * Specialized density value traversal\n * Handles dimension-specific extraction and skipping logic\n */\nexport function forEachDensityValue(\n valueText: string,\n cssProperty: string,\n callback: (parsedDimension: ParsedUnitValue, positionInfo: PositionInfo) => void\n): void {\n forEachValue(\n valueText, \n (node) => extractDimensionValue(node, cssProperty), \n shouldSkipDimensionNode, \n callback\n );\n}\n\n/**\n * Extract font-related values from CSS AST node\n * Handles font-size and font-weight values\n */\nfunction extractFontValue(node: any): ParsedUnitValue | null {\n if (!node) return null;\n \n switch (node.type) {\n case 'Dimension':\n // Font-size: 16px, 1rem, etc.\n const numValue = Number(node.value);\n if (numValue <= 0) return null; // Skip zero/negative values\n \n const unit = node.unit.toLowerCase();\n if (!ALLOWED_UNITS.includes(unit)) return null;\n \n return {\n number: numValue,\n unit: unit as 'px' | 'rem' | '%' | 'em' | 'ch'\n };\n \n case 'Number':\n // Font-weight: 400, 700, etc.\n const numberValue = Number(node.value);\n if (numberValue <= 0) {\n return null; // Skip zero/negative values\n }\n \n // Only accept known font-weight values for unitless numbers\n if (!isKnownFontWeight(numberValue)) {\n return null; // Skip values that aren't valid font-weights\n }\n \n return {\n number: numberValue,\n unit: null\n };\n \n case 'Identifier':\n // Font-weight keywords: normal, bold, etc.\n const namedValue = node.name.toLowerCase();\n \n // Only accept known font-weight keywords\n if (!isKnownFontWeight(namedValue)) {\n return null;\n }\n \n // Convert known keywords to numeric values\n if (namedValue === 'normal') {\n return { number: 400, unit: null };\n }\n \n // For other keywords (bolder, lighter), we can't determine exact numeric value\n // but we know they're valid font-weight values\n return { number: namedValue, unit: null };\n \n case 'Percentage':\n // Percentage values for font-size\n const percentValue = Number(node.value);\n if (percentValue === 0) return null; // Skip zero values\n \n return {\n number: percentValue,\n unit: '%'\n };\n \n case 'Value':\n // Value wrapper - extract from first child\n return node.children?.[0] ? extractFontValue(node.children[0]) : null;\n }\n \n return null;\n}\n\n/**\n * Check if font node should be skipped during traversal\n * Skip all function nodes by default\n */\nfunction shouldSkipFontNode(node: any): boolean {\n return node.type === 'Function';\n}\n\n/**\n * Specialized font value traversal\n * Handles font-specific extraction and skipping logic\n */\nexport function forEachFontValue(\n valueText: string,\n callback: (fontValue: ParsedUnitValue, positionInfo: PositionInfo) => void\n): void {\n forEachValue(valueText, extractFontValue, shouldSkipFontNode, callback);\n}\n", "// Simplified value parsing\n\n/**\n * Checks if a value is a CSS global value.\n *\n * CSS global values are special keywords that can be used for any CSS property and have a universal meaning:\n * - initial: Resets the property to its initial value as defined by the CSS specification.\n * - inherit: Inherits the value from the parent element.\n * - unset: Acts as inherit if the property is inheritable, otherwise acts as initial.\n * - revert: Rolls back the property to the value established by the user-agent or user styles.\n * - revert-layer: Rolls back the property to the value established by the previous cascade layer.\n *\n * All CSS properties accept these global values, including but not limited to:\n * - color\n * - background\n * - font-size\n * - margin\n * - padding\n * - border\n * - display\n * - position\n * - z-index\n * - and many more\n *\n * These values are part of the CSS standard and are not considered violations, even if a rule would otherwise flag a value as invalid or non-design-token. They are always allowed for any property.\n *\n * @param value The CSS value to check.\n * @returns True if the value is a CSS global value, false otherwise.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/initial\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/inherit\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/unset\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/revert\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/revert-layer\n */\nexport function isGlobalValue(value: string): boolean {\n return value === 'initial' || value === 'inherit' || value === 'unset' || value === 'revert' || value === 'revert-layer';\n }\n\n// Configurable list of allowed CSS units\nexport const ALLOWED_UNITS = ['px', 'em', 'rem', '%', 'ch'];\n\nexport type ParsedUnitValue = {\n unit: 'px' | 'rem' | '%' | 'em' | 'ch' | null;\n number: number;\n} | null;\n\nexport function parseUnitValue(value: string): ParsedUnitValue {\n if (!value) return null;\n \n // Create regex pattern from allowed units\n const unitsPattern = ALLOWED_UNITS.join('|');\n const regex = new RegExp(`^(-?\\\\d*\\\\.?\\\\d+)(${unitsPattern})?$`);\n const match = value.match(regex);\n if (!match) return null;\n \n const number = parseFloat(match[1]);\n const unit = match[2] ? (match[2] as 'px' | 'rem' | '%' | 'em' | 'ch') : null; // Keep unitless values as null\n \n if (isNaN(number)) return null;\n \n return { number, unit };\n}\n\nexport function toAlternateUnitValue(numberVal: number, unitType: 'px' | 'rem' | '%' | 'em' | 'ch' | null): ParsedUnitValue {\n if (unitType === 'px') {\n let floatValue = parseFloat(`${numberVal / 16}`);\n if (!isNaN(floatValue)) {\n return {\n unit: 'rem',\n number: parseFloat(floatValue.toFixed(4))\n }\n }\n } else if (unitType === 'rem') {\n const intValue = parseInt(`${numberVal * 16}`);\n if (!isNaN(intValue)) {\n return {\n unit: 'px',\n number: intValue\n }\n }\n }\n // For other units (%, em, ch) and unitless values, no alternate unit conversion available\n // These units are context-dependent and don't have standard conversion ratios\n return null;\n}", "//stylelint-sds/packages/stylelint-plugin-slds/src/utils/color-lib-utils.ts\nimport { ValueToStylingHooksMapping, ValueToStylingHookEntry } from '@salesforce-ux/sds-metadata';\nimport chroma from 'chroma-js';\nimport { generate } from '@eslint/css-tree';\nimport { isCssColorFunction } from './css-functions';\n\nconst LAB_THRESHOLD = 25; // Adjust this to set how strict the matching should be\n\nconst isHardCodedColor = (color: string): boolean => {\n const colorRegex =\n /\\b(rgb|rgba)\\((\\s*\\d{1,3}\\s*,\\s*){2,3}\\s*(0|1|0?\\.\\d+)\\s*\\)|#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})\\b|[a-zA-Z]+/g;\n return colorRegex.test(color);\n};\n\nconst isHexCode = (color: string): boolean => {\n const hexPattern = /^#(?:[0-9a-fA-F]{3}){1,2}$/; // Pattern for #RGB or #RRGGBB\n return hexPattern.test(color);\n};\n\n// Convert a named color or hex code into a hex format using chroma-js\nconst convertToHex = (color: string): string | null => {\n try {\n // Try converting the color using chroma-js, which handles both named and hex colors\n return chroma(color).hex();\n } catch (e) {\n // If chroma can't process the color, it's likely invalid\n return null;\n }\n};\n\n// Find the closest color hook using LAB distance\nconst findClosestColorHook = (\n color: string,\n supportedColors:ValueToStylingHooksMapping,\n cssProperty: string\n): string[] => {\n const returnStylingHooks: string[] = [];\n const closestHooksWithSameProperty: { name: string; distance: number }[] = [];\n const closestHooksWithoutSameProperty: { name: string; distance: number }[] =\n [];\n const closestHooksWithAllProperty: { name: string; distance: number }[] =\n [];\n const labColor = chroma(color).lab();\n\n Object.entries(supportedColors).forEach(([sldsValue, data]) => {\n if (sldsValue && isHexCode(sldsValue)) {\n const hooks = data as ValueToStylingHookEntry[]; // Get the hooks for the sldsValue\n\n hooks.forEach((hook) => {\n const labSupportedColor = chroma(sldsValue).lab();\n const distance = (JSON.stringify(labColor) === JSON.stringify(labSupportedColor)) ? 0\n : chroma.distance(chroma.lab(...labColor), chroma.lab(...labSupportedColor), \"lab\");\n // Check if the hook has the same property\n if (hook.properties.includes(cssProperty)) {\n // Add to same property hooks if within threshold\n if (distance <= LAB_THRESHOLD) {\n closestHooksWithSameProperty.push({ name: hook.name, distance });\n }\n } \n // Check for the universal selector\n else if ( hook.properties.includes(\"*\") ){\n // Add to same property hooks if within threshold\n if (distance <= LAB_THRESHOLD) {\n closestHooksWithAllProperty.push({ name: hook.name, distance });\n }\n }\n else {\n // Add to different property hooks if within threshold\n if (distance <= LAB_THRESHOLD) {\n closestHooksWithoutSameProperty.push({ name: hook.name, distance });\n }\n }\n });\n }\n });\n\n// Group hooks by their priority\nconst closesthookGroups = [\n { hooks: closestHooksWithSameProperty, distance: 0 },\n { hooks: closestHooksWithAllProperty, distance: 0 },\n { hooks: closestHooksWithSameProperty, distance: Infinity }, // For hooks with distance > 0\n { hooks: closestHooksWithAllProperty, distance: Infinity },\n { hooks: closestHooksWithoutSameProperty, distance: Infinity },\n];\n\nfor (const group of closesthookGroups) {\n // Filter hooks based on the distance condition\n const filteredHooks = group.hooks.filter(h => \n group.distance === 0 ? h.distance === 0 : h.distance > 0\n );\n\n if (returnStylingHooks.length < 1 && filteredHooks.length > 0) {\n filteredHooks.sort((a, b) => a.distance - b.distance);\n returnStylingHooks.push(...filteredHooks.slice(0, 5).map((h) => h.name));\n }\n}\n\n\n return Array.from(new Set(returnStylingHooks));\n};\n\n/**\n * This method is usefull to identify all possible css color values.\n * - names colors\n * - 6,8 digit hex\n * - rgb and rgba\n * - hsl and hsla\n */\nconst isValidColor = (val:string):boolean => chroma.valid(val);\n\n/**\n * Extract color value from CSS AST node\n */\nconst extractColorValue = (node: any): string | null => {\n let colorValue: string | null = null;\n \n switch (node.type) {\n case 'Hash':\n colorValue = `#${node.value}`;\n break;\n case 'Identifier':\n colorValue = node.name;\n break;\n case 'Function':\n // Only extract color functions\n if (isCssColorFunction(node.name)) {\n colorValue = generate(node);\n }\n break;\n }\n \n return colorValue && isValidColor(colorValue) ? colorValue : null;\n};\n\nexport { findClosestColorHook, convertToHex, isHexCode, isHardCodedColor, isValidColor, extractColorValue };\n", "//stylelint-sds/packages/stylelint-plugin-slds/src/utils/css-functions.ts\n/**\n * Complete list of CSS functions that should be preserved/recognized\n */\nconst CSS_FUNCTIONS = [\n 'attr',\n 'calc',\n 'color-mix',\n 'conic-gradient',\n 'counter',\n 'cubic-bezier',\n 'linear-gradient',\n 'max',\n 'min',\n 'radial-gradient',\n 'repeating-conic-gradient',\n 'repeating-linear-gradient',\n 'repeating-radial-gradient',\n 'var'\n ];\n \n \n const CSS_MATH_FUNCTIONS = ['calc', 'min', 'max'];\n \n \n const RGB_COLOR_FUNCTIONS = ['rgb', 'rgba', 'hsl', 'hsla'];\n \n /**\n * Regex for matching any CSS function (for general detection)\n * Matches function names within other text\n */\n const cssFunctionsRegex = new RegExp(`(?:${CSS_FUNCTIONS.join('|')})`);\n \n \n const cssFunctionsExactRegex = new RegExp(`^(?:${CSS_FUNCTIONS.join('|')})$`);\n \n \n const cssMathFunctionsRegex = new RegExp(`^(?:${CSS_MATH_FUNCTIONS.join('|')})$`);\n \n export function containsCssFunction(value: string): boolean {\n return cssFunctionsRegex.test(value);\n }\n \n /**\n * Check if a value is exactly a CSS function name\n */\n export function isCssFunction(value: string): boolean {\n return cssFunctionsExactRegex.test(value);\n }\n \n export function isCssMathFunction(value: string): boolean {\n return cssMathFunctionsRegex.test(value);\n }\n \n export function isCssColorFunction(value: string): boolean {\n return RGB_COLOR_FUNCTIONS.includes(value);\n }", "import { \n forEachValue, \n type PositionInfo \n} from './hardcoded-shared-utils';\n\n/**\n * Check if a CSS property should be targeted for linting based on prefixes or explicit targets\n * @param property - The CSS property name to check\n * @param propertyTargets - Array of specific properties to target (empty means target all)\n * @returns true if the property should be targeted\n */\nexport function isTargetProperty(property: string, propertyTargets: string[] = []): boolean {\n if (typeof property !== 'string') return false;\n return property.startsWith('--sds-')\n || property.startsWith('--slds-')\n || property.startsWith('--lwc-')\n || propertyTargets.length === 0\n || propertyTargets.includes(property);\n}\n\n/**\n * CSS Variable information for SLDS variable detection\n */\nexport interface CssVariableInfo {\n name: string; // Variable name: --slds-g-color-surface-1\n hasFallback: boolean; // Whether var() already has a fallback\n}\n\n/**\n * Generic CSS variable extractor that can be customized for different use cases\n * @param node - AST node to extract from\n * @param filter - Function to validate and extract variable information\n * @returns Extracted variable info or null\n */\nfunction extractCssVariable<T>(\n node: any,\n filter: (variableName: string, childrenArray: any[]) => T | null\n): T | null {\n if (!node || node.type !== 'Function' || node.name !== 'var') {\n return null;\n }\n\n if (!node.children) {\n return null;\n }\n\n // Convert children to array and get the first child (variable name)\n const childrenArray = Array.from(node.children);\n if (childrenArray.length === 0) {\n return null;\n }\n \n const firstChild = childrenArray[0] as any;\n if (!firstChild || firstChild.type !== 'Identifier') {\n return null;\n }\n\n const variableName = firstChild.name;\n if (!variableName) {\n return null;\n }\n\n return filter(variableName, childrenArray);\n}\n\n/**\n * Specialized CSS variable traversal for SLDS variables\n * Finds var(--slds-*) functions and reports their fallback status\n */\nexport function forEachSldsVariable(\n valueText: string,\n callback: (variableInfo: CssVariableInfo, positionInfo: PositionInfo) => void\n): void {\n const extractor = (node: any) => extractCssVariable(node, (variableName, childrenArray) => {\n if (!variableName.startsWith('--slds-')) {\n return null;\n }\n\n // Check if there's a fallback (comma separator)\n const hasFallback = childrenArray.some((child: any) => \n child.type === 'Operator' && child.value === ','\n );\n\n return { name: variableName, hasFallback };\n });\n\n forEachValue(valueText, extractor, () => false, callback);\n}\n\n/**\n * Specialized CSS variable traversal for SLDS/SDS namespace detection\n * Finds var(--slds-*) or var(--sds-*) functions in CSS values\n * Note: hasFallback is set to false as it's unused for namespace validation\n */\nexport function forEachNamespacedVariable(\n valueText: string,\n callback: (variableInfo: CssVariableInfo, positionInfo: PositionInfo) => void\n): void {\n const extractor = (node: any) => extractCssVariable(node, (variableName) => {\n // Check for SLDS or SDS namespace\n if (variableName.startsWith('--slds-') || variableName.startsWith('--sds-')) {\n return { name: variableName, hasFallback: false }; // hasFallback unused, but required by interface\n }\n return null;\n });\n\n forEachValue(valueText, extractor, () => false, callback);\n}\n\n/**\n * Specialized CSS variable traversal for LWC variables\n * Finds var(--lwc-*) functions in CSS values and reports their fallback status\n */\nexport function forEachLwcVariable(\n valueText: string,\n callback: (variableInfo: CssVariableInfo, positionInfo: PositionInfo) => void\n): void {\n const extractor = (node: any) => extractCssVariable(node, (variableName, childrenArray) => {\n if (!variableName.startsWith('--lwc-')) {\n return null;\n }\n\n // Check if there's a fallback (comma separator)\n const hasFallback = childrenArray.some((child: any) => \n child.type === 'Operator' && child.value === ','\n );\n\n return { name: variableName, hasFallback };\n });\n\n forEachValue(valueText, extractor, () => false, callback);\n}\n\n/**\n * Format multiple hook suggestions for better readability\n * @param hooks - Array of hook names to format\n * @returns Formatted string with hooks\n */\nexport function formatSuggestionHooks(hooks: string[]): string {\n if (hooks.length === 1) {\n return `${hooks[0]}`;\n }\n\n // Loop through hooks and append each as a numbered list item with line breaks\n return '\\n' + hooks.map((hook, index) => `${index + 1}. ${hook}`).join('\\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-sds-to-slds-hooks'];\nconst { type, description, url, messages } = ruleConfig;\n\nconst sldsPlusStylingHooks = metadata.sldsPlusStylingHooks;\n\n// Generate values to hooks mapping using only global hooks\n// shared hooks are private/ undocumented APIs, so they should not be recommended to customers\n// Ref this thread: https://salesforce-internal.slack.com/archives/C071J0Q3FNV/p1743010620921339?thread_ts=1743009353.385429&cid=C071J0Q3FNV\nconst allSldsHooks = [...sldsPlusStylingHooks.global, ...sldsPlusStylingHooks.component];\n\nconst toSldsToken = (sdsToken: string) => sdsToken.replace('--sds-', '--slds-');\n\nfunction shouldIgnoreDetection(sdsToken: string) {\n // Ignore if entry not found in the list\n return (\n !sdsToken.startsWith('--sds-') || !allSldsHooks.includes(toSldsToken(sdsToken))\n );\n}\n\nexport default {\n meta: {\n type,\n docs: {\n description,\n recommended: true,\n url,\n },\n fixable: 'code',\n messages,\n },\n \n create(context) {\n function reportAndFix(node, oldValue, suggestedMatch) {\n context.report({\n node,\n messageId: 'replaceSdsWithSlds',\n data: { oldValue, suggestedMatch },\n fix(fixer) {\n // For Declaration nodes, use the offset from loc info\n if (node.type === \"Declaration\") {\n const sourceCode = context.sourceCode;\n const fullText = sourceCode.getText();\n const nodeOffset = node.loc.start.offset;\n \n // The property name appears at the start of the Declaration\n const propertyStart = nodeOffset;\n const propertyEnd = propertyStart + oldValue.length;\n \n // Verify we're replacing the right text\n const textAtPosition = fullText.substring(propertyStart, propertyEnd);\n if (textAtPosition === oldValue) {\n return fixer.replaceTextRange([propertyStart, propertyEnd], suggestedMatch);\n }\n }\n \n // For Identifier nodes (inside var() functions), simple replacement works\n return fixer.replaceText(node, suggestedMatch);\n }\n });\n }\n\n return {\n // CSS custom property declarations: --sds-* properties\n \"Declaration[property=/^--sds-/]\"(node) {\n const property = node.property;\n \n if (shouldIgnoreDetection(property)) {\n return;\n }\n\n const suggestedMatch = toSldsToken(property);\n reportAndFix(node, property, suggestedMatch);\n },\n\n // SDS tokens inside var() functions: var(--sds-*)\n \"Function[name='var'] Identifier[name=/^--sds-/]\"(node) {\n const tokenName = node.name;\n \n if (shouldIgnoreDetection(tokenName)) {\n return;\n }\n\n const suggestedMatch = toSldsToken(tokenName);\n reportAndFix(node, tokenName, suggestedMatch);\n }\n };\n },\n} as Rule.RuleModule;\n", "import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata';\nimport ruleMessages from '../../config/rule-messages.yml';\n\nconst ruleConfig = ruleMessages['no-sldshook-fallback-for-lwctoken'];\nconst { type, description, url, messages } = ruleConfig;\n\nconst sldsPlusStylingHooks = metadata.sldsPlusStylingHooks;\n\n// Generate values to hooks mapping using only global hooks\n// shared hooks are private/ undocumented APIs, so they should not be recommended to customers\n// Ref this thread: https://salesforce-internal.slack.com/archives/C071J0Q3FNV/p1743010620921339?thread_ts=1743009353.385429&cid=C071J0Q3FNV\nconst allSldsHooks = [...sldsPlusStylingHooks.global, ...sldsPlusStylingHooks.component];\nconst allSldsHooksSet = new Set(allSldsHooks);\n\n/**\n * Check if using an SLDS hook as fallback for LWC token is unsupported\n */\nfunction hasUnsupportedFallback(lwcToken: string, sldsToken: string): boolean {\n // Convert --sds- to --slds- if needed\n const normalizedSldsToken = sldsToken.replace('--sds-', '--slds-');\n \n return lwcToken.startsWith('--lwc-') \n && normalizedSldsToken.startsWith('--slds-') \n && allSldsHooksSet.has(normalizedSldsToken);\n}\n\nexport default {\n meta: {\n type,\n docs: {\n description,\n recommended: true,\n url,\n },\n messages,\n },\n \n create(context) {\n return {\n // Handle LWC tokens inside var() functions: var(--lwc-*, ...)\n \"Function[name='var'] Identifier[name=/^--lwc-/]\"(node) {\n const lwcToken = node.name;\n \n // Get the var() function node that contains this identifier\n const varFunctionNode = context.sourceCode.getAncestors(node).at(-1);\n if (!varFunctionNode) return;\n \n //access children to find fallback\n const varFunctionChildren = (varFunctionNode as any).children;\n if (!varFunctionChildren) return;\n \n // Find comma operator and the Raw node after it\n let foundComma = false;\n let fallbackRawNode = null;\n \n for (const child of varFunctionChildren) {\n if (child.type === 'Operator' && child.value === ',') {\n foundComma = true;\n continue;\n }\n if (foundComma && child.type === 'Raw') {\n fallbackRawNode = child;\n break;\n }\n }\n \n if (!fallbackRawNode) return;\n \n // Extract SLDS token from the Raw node value\n const fallbackValue = fallbackRawNode.value.trim();\n const varMatch = fallbackValue.match(/var\\(([^,)]+)/);\n if (!varMatch) return;\n \n const sldsToken = varMatch[1];\n \n if (hasUnsupportedFallback(lwcToken, sldsToken)) {\n context.report({\n node,\n messageId: 'unsupportedFallback',\n data: { lwcToken, sldsToken }\n });\n }\n }\n };\n },\n} as Rule.RuleModule;\n", "import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata';\nimport ruleMessages from '../../config/rule-messages.yml';\n\nconst ruleConfig = ruleMessages['no-unsupported-hooks-slds2'];\nconst { type, description, url, messages } = ruleConfig;\n\nconst deprecatedHooks = new Set(metadata.deprecatedStylingHooks);\n\nfunction shouldIgnoreDetection(sldsHook: string): boolean {\n return !deprecatedHooks.has(sldsHook);\n}\n\nexport default {\n meta: {\n type,\n docs: {\n description,\n recommended: true,\n url,\n },\n messages,\n },\n \n create(context) {\n function reportDeprecatedHook(node, token: string) {\n context.report({\n node,\n messageId: 'deprecated',\n data: { token }\n });\n }\n\n return {\n // Handle CSS custom property declarations (left-side usage): --slds-* properties\n // Example: .THIS { --slds-g-link-color: #f73650; }\n \"Declaration[property=/^--s(lds|ds)-/]\"(node) {\n const property = node.property;\n \n if (shouldIgnoreDetection(property)) {\n return;\n }\n \n reportDeprecatedHook(node, property);\n },\n\n // Handle SLDS/SDS hooks inside var() functions (right-side usage): var(--slds-*)\n // Example: .THIS .demo { border-top: 1px solid var(--slds-g-color-border-brand-1); }\n \"Function[name='var'] Identifier[name=/^--s(lds|ds)-/]\"(node) {\n const tokenName = node.name;\n \n if (shouldIgnoreDetection(tokenName)) {\n return;\n }\n \n reportDeprecatedHook(node, tokenName);\n },\n };\n },\n} as Rule.RuleModule;\n", "import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata';\nimport ruleMessages from '../../config/rule-messages.yml';\nimport { forEachSldsVariable, type CssVariableInfo } from '../../utils/css-utils';\nimport type { PositionInfo } from '../../utils/hardcoded-shared-utils';\n\nconst ruleConfig = ruleMessages['no-slds-var-without-fallback'];\nconst { type, description, url, messages } = ruleConfig;\n\n// Access the slds1ExcludedVars property from metadata\nconst sldsVariables = metadata.slds1ExcludedVars || {};\n\n/**\n * ESLint rule to detect SLDS variables used without fallback values\n * Uses CSS AST parsing for consistent detection across all CSS contexts\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 \"Declaration\"(node) {\n const valueText = context.sourceCode.getText(node.value);\n if (!valueText) return;\n\n const variablesNeedingFallback: Array<{\n cssVar: string;\n fallbackValue: string;\n start: number;\n end: number;\n }> = [];\n\n // Use AST parsing to find all SLDS variables\n forEachSldsVariable(valueText, (variableInfo: CssVariableInfo, positionInfo: PositionInfo) => {\n const { name: cssVar, hasFallback } = variableInfo;\n \n if (hasFallback) return; // Skip if variable already has a fallback\n \n const fallbackValue = sldsVariables[cssVar];\n if (!fallbackValue) return; // No fallback available in metadata\n \n variablesNeedingFallback.push({\n cssVar,\n fallbackValue,\n start: positionInfo.start?.offset || 0,\n end: positionInfo.end?.offset || 0\n });\n });\n\n // Report violations with combined fix\n if (variablesNeedingFallback.length > 0) {\n // Create combined fix for all variables\n let newValue = valueText;\n const sortedVariables = variablesNeedingFallback.sort((a, b) => b.start - a.start);\n \n sortedVariables.forEach(({ cssVar, fallbackValue, start, end }) => {\n const replacement = `var(${cssVar}, ${fallbackValue})`;\n newValue = newValue.substring(0, start) + replacement + newValue.substring(end);\n });\n\n // Report each variable separately but with the same combined fix\n variablesNeedingFallback.forEach(({ cssVar, fallbackValue }) => {\n context.report({\n node,\n messageId: 'varWithoutFallback',\n data: { cssVar, recommendation: fallbackValue },\n fix: (fixer) => fixer.replaceText(node.value, newValue)\n });\n });\n }\n }\n };\n },\n} as Rule.RuleModule;\n", "import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata';\nimport ruleMessages from '../../config/rule-messages.yml';\nimport { forEachNamespacedVariable, type CssVariableInfo } from '../../utils/css-utils';\nimport type { PositionInfo } from '../../utils/hardcoded-shared-utils';\n\nconst ruleConfig = ruleMessages['no-slds-namespace-for-custom-hooks'];\nconst { type, description, url, messages } = ruleConfig;\n\nconst sldsPlusStylingHooks = metadata.sldsPlusStylingHooks;\n\n// Generate values to hooks mapping using only global hooks\n// shared hooks are private/ undocumented APIs, so they should not be recommended to customers\n// Ref this thread: https://salesforce-internal.slack.com/archives/C071J0Q3FNV/p1743010620921339?thread_ts=1743009353.385429&cid=C071J0Q3FNV\n// Note: kinetics hooks available but excluded due to TypeScript type mismatch (type says 'kinetic', runtime has 'kinetics')\nconst allSldsHooks = [...sldsPlusStylingHooks.global, ...sldsPlusStylingHooks.component, ...sldsPlusStylingHooks.shared];\n\nconst toSldsToken = (sdsToken: string) => sdsToken.replace('--sds-', '--slds-');\n\nfunction shouldIgnoreDetection(sdsToken: string): boolean {\n // Ignore if entry found in the list or not starts with reserved namespace\n if (sdsToken.startsWith('--sds-') || sdsToken.startsWith('--slds-')) {\n return allSldsHooks.includes(toSldsToken(sdsToken));\n }\n return true;\n}\n\nexport default {\n meta: {\n type,\n docs: {\n description,\n recommended: true,\n url,\n },\n messages,\n },\n \n create(context) {\n return {\n \"Declaration\"(node) {\n // Check 1: Property name (left-side) for custom properties using reserved namespaces\n const property = node.property;\n if (property && \n (property.startsWith('--slds-') || property.startsWith('--sds-')) &&\n !shouldIgnoreDetection(property)) {\n const tokenWithoutNamespace = property.replace('--slds-', '').replace('--sds-', '');\n \n // Report at the property location (before the colon)\n context.report({\n node,\n loc: node.loc, // Use full declaration loc which includes the property\n messageId: 'customHookNamespace',\n data: { \n token: property,\n tokenWithoutNamespace\n }\n });\n }\n\n // Check 2: Property value (right-side) - Use AST parsing to detect var() functions\n const valueText = context.sourceCode.getText(node.value);\n if (valueText) {\n forEachNamespacedVariable(valueText, (variableInfo: CssVariableInfo, positionInfo: PositionInfo) => {\n const { name: tokenName } = variableInfo;\n \n if (!shouldIgnoreDetection(tokenName)) {\n const tokenWithoutNamespace = tokenName.replace('--slds-', '').replace('--sds-', '');\n \n // Use exact position if available, otherwise report on declaration node\n if (positionInfo.start && positionInfo.end && node.value.loc) {\n context.report({\n node,\n loc: {\n start: {\n line: node.value.loc.start.line + positionInfo.start.line - 1,\n column: node.value.loc.start.column + positionInfo.start.column - 1\n },\n end: {\n line: node.value.loc.start.line + positionInfo.end.line - 1,\n column: node.value.loc.start.column + positionInfo.end.column - 1\n }\n },\n messageId: 'customHookNamespace',\n data: { token: tokenName, tokenWithoutNamespace }\n });\n } else {\n context.report({\n node,\n messageId: 'customHookNamespace',\n data: { token: tokenName, tokenWithoutNamespace }\n });\n }\n }\n });\n }\n },\n };\n },\n} as Rule.RuleModule;\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", "import { Rule } from 'eslint';\nimport ruleMessages from '../../config/rule-messages.yml';\n\nconst ruleConfig = ruleMessages['reduce-annotations'];\nconst { type, description, url, messages } = ruleConfig;\n\n// SLDS validator annotations to detect and flag for removal\nconst SLDS_ANNOTATIONS = [\n \"@sldsValidatorIgnoreNextLine\", \n \"@sldsValidatorAllow\", \n \"@sldsValidatorIgnore\"\n];\n\nexport default {\n meta: {\n type,\n docs: {\n description,\n recommended: true,\n url,\n },\n messages,\n },\n \n create(context) {\n return {\n StyleSheet(node) {\n const sourceCode = context.sourceCode;\n \n let comments = (sourceCode as any)?.comments || [];\n\n comments.forEach(comment => {\n const commentContent = comment.value.trim();\n \n const matchingAnnotation = SLDS_ANNOTATIONS.find(annotation => \n commentContent.startsWith(annotation)\n );\n \n if (matchingAnnotation) {\n context.report({\n node: comment,\n messageId: 'removeAnnotation'\n });\n }\n });\n },\n };\n },\n} as Rule.RuleModule;\n", "import { Rule } from 'eslint';\nimport ruleMessages from '../../config/rule-messages.yml';\n\nconst ruleConfig = ruleMessages['no-slds-private-var'];\nconst { type, description, url, messages } = ruleConfig;\n\nexport default {\n meta: {\n type,\n docs: {\n description,\n recommended: true,\n url,\n },\n fixable: 'code',\n messages\n },\n \n create(context) {\n return {\n // Handle CSS custom properties (declarations starting with --)\n \"Declaration\"(node) {\n // Check if this is a custom property declaration\n if (node.property && typeof node.property === 'string' && node.property.startsWith('--_slds-')) {\n context.report({\n node,\n messageId: 'privateVar',\n data: { prop: node.property },\n fix(fixer) {\n // Auto-fix: replace --_slds- with --slds-\n const newProperty = node.property.replace('--_slds-', '--slds-');\n const sourceCode = context.sourceCode.getText(node);\n const fixedCode = sourceCode.replace(node.property, newProperty);\n return fixer.replaceText(node, fixedCode);\n }\n });\n }\n },\n };\n },\n} as Rule.RuleModule;\n", "import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata';\nimport ruleMessages from '../../../config/rule-messages.yml';\nimport { defineNoHardcodedValueRule } from './noHardcodedValueRule';\n\nconst ruleName = 'no-hardcoded-values-slds1';\nconst ruleConfig = ruleMessages[ruleName];\nconst { type, description, url, messages } = ruleConfig;\n\nconst valueToStylinghook = metadata.valueToStylingHooksSlds;\n\nexport default defineNoHardcodedValueRule({\n ruleConfig,\n valueToStylinghook,\n ruleName,\n}) as Rule.RuleModule;\n\n", "///stylelint-sds/packages/stylelint-plugin-slds/src/utils/property-matcher.ts\n/**\n * Check if any of the hook properties match the provided cssProperty using wildcard matching.\n * @param hookProperties - Array of property patterns (can contain wildcards like `*`)\n * @param cssProperty - The CSS property to be checked\n * @returns true if a match is found, otherwise false\n */\nexport function matchesCssProperty(\n hookProperties: string[],\n cssProperty: string\n): boolean {\n return hookProperties.some((propertyPattern: string) => {\n const regexPattern = new RegExp(\n '^' + propertyPattern.replace(/\\*/g, '.*') + '$'\n );\n return regexPattern.test(cssProperty);\n });\n}\n\n// Directions & Corners\nconst DIRECTION_VALUES = '(?:top|right|bottom|left|inline|block|inline-start|inline-end|start|end|block-start|block-end)';\nconst CORNER_VALUES = '(?:top-left|top-right|bottom-right|bottom-left|start-start|start-end|end-start|end-end)';\nconst INSET_VALUES = '(?:inline|block|inline-start|inline-end|block-start|block-end)';\n\n\n// Pre-compiled regex patterns for better performance\nconst BORDER_COLOR_REGEX = new RegExp(`^border(?:-${DIRECTION_VALUES})?-color$`);\nconst BORDER_WIDTH_REGEX = new RegExp(`^border(?:-${DIRECTION_VALUES})?-width$`);\nconst MARGIN_REGEX = new RegExp(`^margin(?:-${DIRECTION_VALUES})?$`);\nconst PADDING_REGEX = new RegExp(`^padding(?:-${DIRECTION_VALUES})?$`);\nconst BORDER_RADIUS_REGEX = new RegExp(`^border(?:-${CORNER_VALUES})?-radius$`);\nconst INSET_REGEX = new RegExp(`^inset(?:-${INSET_VALUES})?$`);\n\nexport function isBorderColorProperty(cssProperty: string): boolean {\n return BORDER_COLOR_REGEX.test(cssProperty);\n}\n\nexport function isBorderWidthProperty(cssProperty: string): boolean {\n return BORDER_WIDTH_REGEX.test(cssProperty);\n}\n\nexport function isMarginProperty(cssProperty: string): boolean {\n return MARGIN_REGEX.test(cssProperty);\n}\n\nexport function isPaddingProperty(cssProperty: string): boolean {\n return PADDING_REGEX.test(cssProperty);\n}\n\nexport function isBorderRadius(cssProperty: string): boolean {\n return BORDER_RADIUS_REGEX.test(cssProperty);\n}\n\nexport function isDimensionProperty(cssProperty: string): boolean {\n return ['width', 'height', 'min-width', 'max-width', 'min-height', 'max-height'].includes(cssProperty);\n}\n\nexport function isInsetProperty(cssProperty: string): boolean {\n return INSET_REGEX.test(cssProperty);\n}\n\nexport const fontProperties = [\n 'font',\n 'font-size', \n 'font-weight'\n];\n\nexport const colorProperties = [\n 'color',\n 'fill',\n 'background',\n 'background-color',\n 'stroke',\n 'border',\n 'border*',\n 'border*-color',\n 'outline',\n 'outline-color',\n];\n\nexport const densificationProperties = [\n 'border*',\n 'margin*',\n 'padding*',\n 'width',\n 'height',\n 'min-width',\n 'max-width',\n 'min-height',\n 'max-height',\n 'inset',\n 'top',\n 'right',\n 'left',\n 'bottom',\n 'outline',\n 'outline-width',\n 'line-height'\n]; \n\n/**\n * Convert property patterns to CSS AST selector patterns\n * Handles wildcards (*) and creates proper ESLint CSS selector syntax\n */\nexport function toSelector(properties: string[]): string {\n const selectorParts = properties.map(prop => {\n if (prop.includes('*')) {\n // Convert wildcards to regex patterns for CSS AST selectors\n // Anchor to start of string to prevent matching CSS custom properties\n const regexPattern = prop.replace(/\\*/g, '.*');\n return `Declaration[property=/^${regexPattern}$/]`;\n } else {\n // Exact property match\n return `Declaration[property='${prop}']`;\n }\n });\n \n return selectorParts.join(', ');\n}\n\nexport function resolvePropertyToMatch(cssProperty:string){\n const propertyToMatch = cssProperty.toLowerCase();\n if(propertyToMatch === 'outline' || propertyToMatch === 'outline-width' || isBorderWidthProperty(propertyToMatch)){\n return 'border-width';\n } else if(isMarginProperty(propertyToMatch)){\n return 'margin';\n } else if(isPaddingProperty(propertyToMatch)){\n return 'padding';\n } else if(isBorderRadius(propertyToMatch)){\n return 'border-radius';\n } else if(isDimensionProperty(propertyToMatch)){\n // Stylinghooks includes only width as property to match, for all other dimensions we need to match width\n return 'width';\n } else if(isInsetProperty(propertyToMatch)){\n // Stylinghooks includes only top/left/right/bottom as property to match, for all other insets we need to match top\n return 'top';\n } else if(cssProperty === 'background' || cssProperty === 'background-color'){\n return 'background-color';\n } else if(cssProperty === 'outline' || cssProperty === 'outline-color' || isBorderColorProperty(cssProperty)){\n return 'border-color';\n }\n return propertyToMatch;\n}", "import { findClosestColorHook, convertToHex, isValidColor } from '../../../../utils/color-lib-utils';\nimport { resolvePropertyToMatch } from '../../../../utils/property-matcher';\nimport { formatSuggestionHooks } from '../../../../utils/css-utils';\nimport type { HandlerContext, DeclarationHandler } from '../../../../types';\n\n// Import shared utilities for common logic\nimport { \n handleShorthandAutoFix, \n forEachColorValue,\n type ReplacementInfo,\n type PositionInfo\n} from '../../../../utils/hardcoded-shared-utils';\n\n/**\n * Handle color declarations using CSS tree parsing\n * Supports shorthand properties like background, border, etc. \n * Uses css-tree for reliable AST-based parsing + chroma-js validation\n */\nexport const handleColorDeclaration: DeclarationHandler = (node: any, context: HandlerContext) => {\n const cssProperty = node.property.toLowerCase();\n const valueText = context.sourceCode.getText(node.value);\n const replacements: ReplacementInfo[] = [];\n \n forEachColorValue(valueText, (colorValue, positionInfo) => {\n if (colorValue !== 'transparent' && isValidColor(colorValue)) {\n const replacement = createColorReplacement(colorValue, cssProperty, context, positionInfo, valueText);\n if (replacement) {\n replacements.push(replacement);\n }\n }\n });\n \n // Apply shorthand auto-fix once all values are processed\n handleShorthandAutoFix(node, context, valueText, replacements);\n};\n\n\n\n\n\n/**\n * Create color replacement info for shorthand auto-fix\n * Returns replacement data or null if no valid replacement\n */\nfunction createColorReplacement(\n colorValue: string,\n cssProperty: string,\n context: HandlerContext,\n positionInfo: PositionInfo,\n originalValueText?: string\n): ReplacementInfo | null {\n if (!positionInfo?.start) {\n return null;\n }\n\n const hexValue = convertToHex(colorValue);\n if (!hexValue) {\n return null;\n }\n\n const propToMatch = resolvePropertyToMatch(cssProperty);\n const closestHooks = findClosestColorHook(hexValue, context.valueToStylinghook, propToMatch);\n\n // Use position information directly from CSS tree (already 0-based offsets)\n const start = positionInfo.start.offset;\n const end = positionInfo.end.offset;\n \n // Extract the original value from the CSS text to preserve spacing\n const originalValue = originalValueText ? originalValueText.substring(start, end) : colorValue;\n\n if (closestHooks.length === 1) {\n // Has a single hook replacement - should provide autofix\n return {\n start,\n end,\n replacement: `var(${closestHooks[0]}, ${colorValue})`,\n displayValue: closestHooks[0],\n hasHook: true\n };\n } else if (closestHooks.length > 1) {\n // Multiple hooks - format them for better readability\n return {\n start,\n end,\n replacement: originalValue, // Use original value to preserve spacing\n displayValue: formatSuggestionHooks(closestHooks),\n hasHook: true\n };\n } else {\n // No hooks - keep original value\n return {\n start,\n end,\n replacement: originalValue, // Use original value to preserve spacing\n displayValue: originalValue,\n hasHook: false\n };\n }\n}\n\n\n\n\n\n", "import type { ValueToStylingHookEntry, ValueToStylingHooksMapping } from '@salesforce-ux/sds-metadata';\nimport { ParsedUnitValue, parseUnitValue, toAlternateUnitValue } from './value-utils';\n\nfunction isValueMatch(valueToMatch: ParsedUnitValue, sldsValue: ParsedUnitValue): boolean {\n if (!valueToMatch || !sldsValue) {\n return false;\n }\n return valueToMatch.unit == sldsValue.unit && valueToMatch.number === sldsValue.number;\n}\n\n/**\n * Get styling hooks for a density value using structured data from CSS AST\n * Eliminates regex parsing by accepting pre-parsed dimension data\n */\nexport function getStylingHooksForDensityValue(\n parsedValue: ParsedUnitValue,\n supportedStylinghooks: ValueToStylingHooksMapping,\n cssProperty: string\n): string[] {\n if (!parsedValue) return [];\n \n const alternateValue = toAlternateUnitValue(parsedValue.number, parsedValue.unit);\n const matchedHooks = [];\n\n for (const [sldsValue, hooks] of Object.entries(supportedStylinghooks)) {\n // parsing SLDS metadata values\n const parsedSldsValue = parseUnitValue(sldsValue);\n if (isValueMatch(parsedValue, parsedSldsValue) || (alternateValue && isValueMatch(alternateValue, parsedSldsValue))) {\n hooks\n .filter((hook: ValueToStylingHookEntry) => hook.properties.includes(cssProperty))\n .forEach((hook) => matchedHooks.push(hook.name));\n }\n }\n return matchedHooks;\n}", "import { getStylingHooksForDensityValue } from '../../../../utils/styling-hook-utils';\nimport { resolvePropertyToMatch } from '../../../../utils/property-matcher';\nimport { formatSuggestionHooks } from '../../../../utils/css-utils';\nimport type { ParsedUnitValue } from '../../../../utils/value-utils';\nimport type { HandlerContext, DeclarationHandler } from '../../../../types';\n\n\n\n// Import shared utilities for common logic\nimport { \n handleShorthandAutoFix, \n forEachDensityValue,\n type ReplacementInfo,\n type PositionInfo\n} from '../../../../utils/hardcoded-shared-utils';\n\n/**\n * Handle density/sizing declarations using CSS tree parsing\n * Supports shorthand properties like padding, margin, etc.\n * Uses css-tree for reliable AST-based parsing\n */\nexport const handleDensityDeclaration: DeclarationHandler = (node: any, context: HandlerContext) => {\n const cssProperty = node.property.toLowerCase();\n const valueText = context.sourceCode.getText(node.value);\n const replacements: ReplacementInfo[] = [];\n \n forEachDensityValue(valueText, cssProperty, (parsedDimension, positionInfo) => {\n if (parsedDimension) {\n const replacement = createDimensionReplacement(parsedDimension, cssProperty, context, positionInfo);\n if (replacement) {\n replacements.push(replacement);\n }\n }\n });\n \n // Apply shorthand auto-fix once all values are processed\n handleShorthandAutoFix(node, context, valueText, replacements);\n};\n\n\n\n/**\n * Create dimension replacement info for shorthand auto-fix\n * Returns replacement data or null if no valid replacement\n */\nfunction createDimensionReplacement(\n parsedDimension: ParsedUnitValue,\n cssProperty: string,\n context: HandlerContext,\n positionInfo: PositionInfo\n): ReplacementInfo | null {\n if (!parsedDimension || !positionInfo?.start) {\n return null;\n }\n\n const rawValue = parsedDimension.unit \n ? `${parsedDimension.number}${parsedDimension.unit}`\n : parsedDimension.number.toString();\n\n const propToMatch = resolvePropertyToMatch(cssProperty);\n const closestHooks = getStylingHooksForDensityValue(parsedDimension, context.valueToStylinghook, propToMatch);\n\n // Use position information directly from CSS tree (already 0-based offsets)\n const start = positionInfo.start.offset;\n const end = positionInfo.end.offset;\n\n if (closestHooks.length === 1) {\n // Has a single hook replacement\n return {\n start,\n end,\n replacement: `var(${closestHooks[0]}, ${rawValue})`,\n displayValue: closestHooks[0],\n hasHook: true\n };\n } else if (closestHooks.length > 1) {\n // Multiple hooks - still has hooks, but no auto-fix\n return {\n start,\n end,\n replacement: rawValue,\n displayValue: formatSuggestionHooks(closestHooks),\n hasHook: true\n };\n } else {\n // No hook or multiple hooks - keep original value\n return {\n start,\n end,\n replacement: rawValue,\n displayValue: rawValue,\n hasHook: false\n };\n }\n}\n\n\n\n", "import { getStylingHooksForDensityValue } from '../../../../utils/styling-hook-utils';\nimport { resolvePropertyToMatch } from '../../../../utils/property-matcher';\nimport { formatSuggestionHooks } from '../../../../utils/css-utils';\nimport type { ParsedUnitValue } from '../../../../utils/value-utils';\nimport type { HandlerContext, DeclarationHandler } from '../../../../types';\n\n// Import shared utilities for common logic\nimport { \n handleShorthandAutoFix, \n forEachFontValue,\n isKnownFontWeight,\n type ReplacementInfo,\n type PositionInfo\n} from '../../../../utils/hardcoded-shared-utils';\n\n/**\n * Handle font declarations including shorthand property\n * Uses css-tree for reliable AST-based parsing\n */\nexport const handleFontDeclaration: DeclarationHandler = (node: any, context: HandlerContext) => {\n const cssProperty = node.property.toLowerCase();\n const valueText = context.sourceCode.getText(node.value);\n const replacements: ReplacementInfo[] = [];\n \n forEachFontValue(valueText, (fontValue, positionInfo) => {\n if (fontValue && isValidFontValue(fontValue, cssProperty)) {\n const replacement = createFontReplacement(fontValue, cssProperty, context, positionInfo);\n if (replacement) {\n replacements.push(replacement);\n }\n }\n });\n \n // Apply shorthand auto-fix once all values are processed\n handleShorthandAutoFix(node, context, valueText, replacements);\n};\n\n/**\n * Validate font value based on property type or value characteristics for shorthand\n * Only accepts what we explicitly handle in createFontReplacement\n */\nfunction isValidFontValue(fontValue: ParsedUnitValue, cssProperty: string): boolean {\n if (cssProperty === 'font-size') {\n // Font-size: must have units (unitless font-size values are generally invalid in CSS)\n return !!fontValue.unit;\n } else if (cssProperty === 'font-weight') {\n // Font-weight: must be unitless and a known font-weight value\n return !fontValue.unit && isKnownFontWeight(fontValue.number);\n } else if (cssProperty === 'font') {\n // Font shorthand: determine validation based on value characteristics\n if (!fontValue.unit && isKnownFontWeight(fontValue.number)) {\n // This is a font-weight value\n return true;\n } else if (fontValue.unit) {\n // font-size\n return true;\n } else {\n // Unitless value that's not a known font-weight - invalid\n return false;\n }\n }\n \n // For other font properties, reject extracted values\n return false;\n}\n\nfunction createFontReplacement(\n fontValue: ParsedUnitValue,\n cssProperty: string,\n context: HandlerContext,\n positionInfo: PositionInfo\n): ReplacementInfo | null {\n if (!positionInfo?.start) {\n return null;\n }\n\n const rawValue = fontValue.unit \n ? `${fontValue.number}${fontValue.unit}`\n : fontValue.number.toString();\n\n // Font-specific property resolution\n // Font-weight: unitless known font-weight values, otherwise font-size\n const propToMatch = (!fontValue.unit && isKnownFontWeight(fontValue.number)) \n ? resolvePropertyToMatch('font-weight')\n : resolvePropertyToMatch('font-size');\n\n const closestHooks = getStylingHooksForDensityValue(fontValue, context.valueToStylinghook, propToMatch);\n\n // Use position information directly from CSS tree (already 0-based offsets)\n const start = positionInfo.start.offset;\n const end = positionInfo.end.offset;\n\n if (closestHooks.length === 1) {\n // Has a single hook replacement - should provide autofix\n return {\n start,\n end,\n replacement: `var(${closestHooks[0]}, ${rawValue})`,\n displayValue: closestHooks[0],\n hasHook: true\n };\n } else if (closestHooks.length > 1) {\n // Multiple hooks - still has hooks, but no auto-fix\n return {\n start,\n end,\n replacement: rawValue,\n displayValue: formatSuggestionHooks(closestHooks),\n hasHook: true\n };\n } else {\n // No hooks - keep original value\n return {\n start,\n end,\n replacement: rawValue,\n displayValue: rawValue,\n hasHook: false\n };\n }\n}\n\n", "import { parse, walk, generate } from '@eslint/css-tree';\nimport { isValidColor } from './color-lib-utils';\nimport { parseUnitValue, type ParsedUnitValue } from './value-utils';\nimport { isCssColorFunction } from './css-functions';\n\nexport interface BoxShadowValue {\n offsetX?: string;\n offsetY?: string;\n blurRadius?: string;\n spreadRadius?: string;\n color?: string;\n inset?: boolean;\n}\n\ninterface ShadowParts {\n lengthParts: string[];\n colorParts: string[];\n inset: boolean;\n}\n\n/**\n * Check if a CSS tree node represents a color value\n */\nfunction isColorValue(node: any): boolean {\n if (!node) return false;\n \n switch (node.type) {\n case 'Hash':\n return true; // #hex colors\n case 'Identifier':\n return isValidColor(node.name);\n case 'Function':\n return isCssColorFunction(node.name.toLowerCase());\n default:\n return false;\n }\n}\n\n/**\n * Check if a CSS tree node represents a length value\n */\nfunction isLengthValue(node: any): boolean {\n if (!node) return false;\n \n switch (node.type) {\n case 'Dimension':\n // Use existing unit parsing to validate the unit\n const dimensionStr = `${node.value}${node.unit}`;\n return parseUnitValue(dimensionStr) !== null;\n case 'Number':\n // Zero values without units are valid lengths\n return Number(node.value) === 0;\n default:\n return false;\n }\n}\n\n/**\n * Check if a CSS tree node represents the 'inset' keyword\n */\nfunction isInsetKeyword(node: any): boolean {\n return node?.type === 'Identifier' && node.name.toLowerCase() === 'inset';\n}\n\n/**\n * Extract shadow parts from CSS tree nodes\n */\nfunction extractShadowParts(valueText: string): ShadowParts[] {\n const shadows: ShadowParts[] = [];\n let currentShadow: ShadowParts = {\n lengthParts: [],\n colorParts: [],\n inset: false\n };\n\n try {\n const ast = parse(valueText, { context: 'value' as const });\n \n walk(ast, {\n enter(node: any) {\n // Skip nested function content for now\n if (node.type === 'Function') {\n return this.skip;\n }\n \n if (isInsetKeyword(node)) {\n currentShadow.inset = true;\n } else if (isLengthValue(node)) {\n currentShadow.lengthParts.push(generate(node));\n } else if (isColorValue(node)) {\n currentShadow.colorParts.push(generate(node));\n }\n }\n });\n \n // Add the current shadow if it has any content\n if (currentShadow.lengthParts.length > 0 || currentShadow.colorParts.length > 0 || currentShadow.inset) {\n shadows.push(currentShadow);\n }\n \n } catch (error) {\n return [];\n }\n\n return shadows;\n}\n\n/**\n * Parse box-shadow value into structured format\n * Simplified version for ESLint v9 compatibility\n */\nexport function parseBoxShadowValue(value: string): BoxShadowValue[] {\n // Handle multiple shadows separated by commas\n const shadowStrings = value.split(',').map(s => s.trim());\n const allShadows: BoxShadowValue[] = [];\n \n for (const shadowString of shadowStrings) {\n const shadows = extractShadowParts(shadowString);\n \n const parsedShadows = shadows.map((shadow) => {\n /**\n * Box-shadow syntax:\n * Two, three, or four <length> values:\n * - offset-x offset-y [blur-radius] [spread-radius]\n * Optionally: inset keyword and color value\n */\n const shadowValue: BoxShadowValue = {};\n \n // Map length parts to shadow properties\n const lengthProps = ['offsetX', 'offsetY', 'blurRadius', 'spreadRadius'] as const;\n lengthProps.forEach((prop, index) => {\n if (shadow.lengthParts.length > index) {\n shadowValue[prop] = shadow.lengthParts[index];\n }\n });\n \n // Add color if present\n if (shadow.colorParts.length > 0) {\n shadowValue.color = shadow.colorParts[0];\n }\n \n // Add inset flag if present\n if (shadow.inset) {\n shadowValue.inset = true;\n }\n \n return shadowValue;\n });\n \n allShadows.push(...parsedShadows);\n }\n \n return allShadows;\n}\n\n/**\n * Normalize length value for comparison\n */\nfunction normalizeLengthValue(value: string | undefined): string {\n if (!value) return '0px';\n if (value === '0') return '0px';\n return value;\n}\n\n/**\n * Check if two parsed box-shadow values match\n */\nexport function isBoxShadowMatch(parsedCssValue: BoxShadowValue[], parsedValueHook: BoxShadowValue[]): boolean {\n // If the number of shadows doesn't match, they're not equal\n if (parsedCssValue.length !== parsedValueHook.length) {\n return false;\n }\n\n // Compare each shadow in the array\n for (let i = 0; i < parsedCssValue.length; i++) {\n const cssShadow = parsedCssValue[i];\n const hookShadow = parsedValueHook[i];\n\n // Compare color and inset properties\n if (cssShadow.color !== hookShadow.color || cssShadow.inset !== hookShadow.inset) {\n return false;\n }\n\n // Compare length properties\n const lengthProps = ['offsetX', 'offsetY', 'blurRadius', 'spreadRadius'] as const;\n for (const prop of lengthProps) {\n if (normalizeLengthValue(cssShadow[prop]) !== normalizeLengthValue(hookShadow[prop])) {\n return false;\n }\n }\n }\n\n return true;\n}\n", "import type { HandlerContext, DeclarationHandler } from '../../../../types';\nimport type { ValueToStylingHooksMapping } from '@salesforce-ux/sds-metadata';\nimport { parseBoxShadowValue, isBoxShadowMatch, type BoxShadowValue } from '../../../../utils/boxShadowValueParser';\nimport { formatSuggestionHooks } from '../../../../utils/css-utils';\n\n// Import shared utilities for common logic\nimport { \n handleShorthandAutoFix, \n type ReplacementInfo,\n type PositionInfo\n} from '../../../../utils/hardcoded-shared-utils';\n\n/**\n * Convert CSS value to parsed box-shadow values, filtering out empty ones\n */\nfunction toBoxShadowValue(cssValue: string): BoxShadowValue[] | null {\n const parsedCssValue = parseBoxShadowValue(cssValue).filter((shadow) => Object.keys(shadow).length > 0);\n if (parsedCssValue.length === 0) {\n return null;\n }\n return parsedCssValue;\n}\n\n/**\n * Extract box-shadow hook entries from styling hooks mapping\n */\nfunction shadowValueToHookEntries(supportedStylinghooks: ValueToStylingHooksMapping): Array<[string, string[]]> {\n return Object.entries(supportedStylinghooks).filter(([key, value]) => {\n return value.some((hook) => hook.properties.includes('box-shadow'));\n }).map(([key, value]) => {\n return [key, value.map((hook) => hook.name)];\n });\n}\n\n/**\n * Handle box-shadow declarations using CSS tree parsing\n */\nexport const handleBoxShadowDeclaration: DeclarationHandler = (node: any, context: HandlerContext) => {\n const cssProperty = node.property.toLowerCase();\n const valueText = context.sourceCode.getText(node.value);\n \n const shadowHooks = shadowValueToHookEntries(context.valueToStylinghook);\n \n const parsedCssValue = toBoxShadowValue(valueText);\n if (!parsedCssValue) {\n return;\n }\n\n // Look for matching hooks\n for (const [shadow, closestHooks] of shadowHooks) {\n const parsedValueHook = toBoxShadowValue(shadow);\n if (parsedValueHook && isBoxShadowMatch(parsedCssValue, parsedValueHook)) {\n if (closestHooks.length > 0) {\n // Create position info for the entire box-shadow value\n const positionInfo: PositionInfo = {\n start: { offset: 0, line: 1, column: 1 },\n end: { offset: valueText.length, line: 1, column: valueText.length + 1 }\n };\n \n const replacement = createBoxShadowReplacement(\n valueText,\n closestHooks,\n context,\n positionInfo\n );\n \n if (replacement) {\n const replacements: ReplacementInfo[] = [replacement];\n // Apply shorthand auto-fix when we have replacements to report\n handleShorthandAutoFix(node, context, valueText, replacements);\n }\n }\n return;\n }\n }\n \n // If no hooks found, silently ignore - don't report any violations\n};\n\n\n/**\n * Create box-shadow replacement info for shorthand auto-fix\n * Only called when hooks are available (hooks.length > 0)\n * Returns replacement data or null if invalid position info\n */\nfunction createBoxShadowReplacement(\n originalValue: string,\n hooks: string[],\n context: HandlerContext,\n positionInfo: PositionInfo\n): ReplacementInfo | null {\n if (!positionInfo?.start) {\n return null;\n }\n\n // Use position information directly from CSS tree (already 0-based offsets)\n const start = positionInfo.start.offset;\n const end = positionInfo.end.offset;\n\n if (hooks.length === 1) {\n // Has a single hook replacement - should provide autofix\n return {\n start,\n end,\n replacement: `var(${hooks[0]}, ${originalValue})`,\n displayValue: hooks[0],\n hasHook: true\n };\n } else {\n // Multiple hooks - still has hooks, but no auto-fix\n return {\n start,\n end,\n replacement: originalValue,\n displayValue: formatSuggestionHooks(hooks),\n hasHook: true\n };\n }\n}\n", "import { Rule } from 'eslint';\n\n/**\n * Check if a specific ESLint rule is enabled in the current configuration\n * @param context - ESLint rule context\n * @param ruleName - rule name\n * @returns true if the rule is enabled, false otherwise\n */\nexport function isRuleEnabled(context: Rule.RuleContext, ruleName: string): boolean {\n try {\n // get rules from context settings\n const rules: Record<string, any> = (context.settings?.sldsRules as Record<string, any>) || {};\n \n if (ruleName in rules) {\n const ruleConfig = rules[ruleName];\n \n if (Array.isArray(ruleConfig)) {\n return ruleConfig[0] === true;\n } else if (ruleConfig !== undefined && ruleConfig !== null) {\n return true;\n } else if (ruleConfig === false) {\n return false;\n }\n }\n } catch (error) {\n return false;\n }\n}\n", "import { Rule } from 'eslint';\n\nimport { \n handleColorDeclaration, \n handleDensityDeclaration,\n handleFontDeclaration,\n handleBoxShadowDeclaration\n} from './handlers/index';\nimport { colorProperties, densificationProperties, fontProperties, toSelector } from '../../../utils/property-matcher';\nimport { isRuleEnabled } from '../../../utils/rule-utils';\nimport type { RuleConfig, HandlerContext } from '../../../types';\n\n\n\n/**\n * Creates the shared no-hardcoded-value rule implementation for ESLint v9\n * Supports color, density, and font properties including font shorthand\n * Uses property-matcher.ts to ensure comprehensive coverage without missing properties\n * Complex cases like box-shadow will be handled in future iterations\n */\nexport function defineNoHardcodedValueRule(config: RuleConfig & { ruleName?: string }): Rule.RuleModule {\n const { ruleConfig, ruleName } = config;\n const { type, description, url, messages } = ruleConfig;\n\n return {\n meta: {\n type,\n docs: {\n description,\n recommended: true,\n url,\n },\n fixable: 'code',\n messages,\n },\n \n create(context) {\n if (ruleName === 'no-hardcoded-values-slds1' && \n isRuleEnabled(context, '@salesforce-ux/slds/no-hardcoded-values-slds2')) {\n return {};\n }\n\n // Create handler context\n const handlerContext: HandlerContext = {\n valueToStylinghook: config.valueToStylinghook,\n context,\n sourceCode: context.sourceCode\n };\n \n const colorOnlySelector = toSelector(colorProperties);\n const densityOnlySelector = toSelector(densificationProperties);\n const fontDensitySelector = toSelector(fontProperties);\n\n // Find overlapping properties that need both handlers\n // This includes exact matches and wildcard pattern matches\n const overlappingProperties = colorProperties.filter(colorProp => {\n return densificationProperties.some(densityProp => {\n if (densityProp === colorProp) {\n return true; // Exact match\n }\n if (densityProp.includes('*')) {\n // Check if colorProp matches the wildcard pattern\n const regexPattern = new RegExp('^' + densityProp.replace(/\\*/g, '.*') + '$');\n return regexPattern.test(colorProp);\n }\n return false;\n });\n });\n const overlappingSet = new Set(overlappingProperties);\n \n // Create property lists excluding overlaps to avoid triple processing\n const colorOnlyProps = colorProperties.filter(prop => !overlappingSet.has(prop));\n const densityOnlyProps = densificationProperties.filter(prop => !overlappingSet.has(prop));\n \n // Define CSS AST selectors and their handlers\n const visitors: Record<string, (node: any) => void> = {};\n \n // Color-only properties (excluding overlaps)\n if (colorOnlyProps.length > 0) {\n const colorOnlySelector = toSelector(colorOnlyProps);\n visitors[colorOnlySelector] = (node: any) => {\n handleColorDeclaration(node, handlerContext);\n };\n }\n\n // Density-only properties (excluding overlaps)\n if (densityOnlyProps.length > 0) {\n const densityOnlySelector = toSelector(densityOnlyProps);\n visitors[densityOnlySelector] = (node: any) => {\n handleDensityDeclaration(node, handlerContext);\n };\n }\n \n // Font shorthand property, Font density properties (font-size, font-weight)\n visitors[fontDensitySelector] = (node: any) => {\n handleFontDeclaration(node, handlerContext);\n };\n \n // Box-shadow property - special case requiring complete value matching\n visitors['Declaration[property=\"box-shadow\"]'] = (node: any) => {\n handleBoxShadowDeclaration(node, handlerContext);\n };\n\n // For overlapping properties, run both handlers\n if (overlappingProperties.length > 0) {\n const overlappingSelector = toSelector(overlappingProperties);\n visitors[overlappingSelector] = (node: any) => {\n handleColorDeclaration(node, handlerContext);\n handleDensityDeclaration(node, handlerContext);\n };\n }\n\n return visitors;\n }\n };\n}", "import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata';\nimport ruleMessages from '../../../config/rule-messages.yml';\nimport { defineNoHardcodedValueRule } from './noHardcodedValueRule';\n \nconst ruleName = 'no-hardcoded-values-slds2';\nconst ruleConfig = ruleMessages[ruleName];\nconst { type, description, url, messages } = ruleConfig;\n\nconst valueToStylinghook = metadata.valueToStylingHooksCosmos;\n\nexport default defineNoHardcodedValueRule({\n ruleConfig,\n valueToStylinghook,\n ruleName,\n}) as Rule.RuleModule;\n\n", "{\n \"css\": {\n \"@salesforce-ux/slds/no-slds-class-overrides\": \"warn\",\n \"@salesforce-ux/slds/no-deprecated-slds-classes\": \"warn\",\n \"@salesforce-ux/slds/lwc-token-to-slds-hook\": \"error\",\n \"@salesforce-ux/slds/enforce-sds-to-slds-hooks\": \"warn\",\n \"@salesforce-ux/slds/no-sldshook-fallback-for-lwctoken\": \"warn\",\n \"@salesforce-ux/slds/no-unsupported-hooks-slds2\": \"warn\",\n \"@salesforce-ux/slds/no-slds-var-without-fallback\": \"warn\",\n \"@salesforce-ux/slds/no-slds-namespace-for-custom-hooks\": \"warn\",\n \"@salesforce-ux/slds/enforce-component-hook-naming-convention\": \"error\",\n \"@salesforce-ux/slds/no-slds-private-var\": \"warn\",\n \"@salesforce-ux/slds/no-hardcoded-values-slds2\": \"warn\",\n \"@salesforce-ux/slds/reduce-annotations\": \"warn\"\n },\n \"html\": { \n \"@salesforce-ux/slds/enforce-bem-usage\": \"error\",\n \"@salesforce-ux/slds/no-deprecated-classes-slds2\": \"error\",\n \"@salesforce-ux/slds/modal-close-button-issue\": \"error\"\n }\n}"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,SAAS,SAAS,MAAM,KAAK;AAC3B,SAAO,KAAK,WAAW;AAAA,IACrB,CAAC,SAAS,KAAK,OAAO,KAAK,IAAI,MAAM,YAAY,MAAM,IAAI,YAAY;AAAA,EACzE;AACF;AAOA,SAAS,kBAAkB,MAAM;AAC/B,SAAO,CAAC,KAAK,cAAc,KAAK,WAAW,UAAU;AACvD;AAvBA,IAEA,eAsLM,kBACA;AAzLN;AAAA;AAEA,oBAA2B;AAsL3B,IAAM,mBAAmB;AACzB,IAAM,oBAAoB,IAAI,OAAO,iBAAiB,QAAQ,IAAI;AAAA;AAAA;;;ACzLlE;AAAA,gCAAAA,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;A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OAAO,CAAC,aAAa,UAAU;AAAA,IAC/B,iBAAiB;AAAA,MACf,QAAQ,eAAAC;AAAA,MACR,aAAa;AAAA,MACb,YAAY;AAAA,IACd;AAAA,IACA,SAAS;AAAA,MACP,uBAAuB;AAAA,IACzB;AAAA,IACA,OAAO,qBAAY;AAAA,EACrB;AACF;AAEA,OAAO,OAAO,OAAO,SAAS;AAAA;AAAA,EAE5B,wBAAwB;AAAA,EACxB,yBAAyB;AAAA,EACzB,oBAAoB,CAAC,GAAG,gBAAgB,GAAG,eAAe;AAAA;AAAA,EAE1D,aAAa;AAAA,IACX,SAAS,CAAC,qBAAqB;AAAA,IAC/B,OAAO,qBAAY;AAAA,IACnB,QAAQ,eAAAA;AAAA,IACR,eAAe;AAAA,MACb,aAAa;AAAA,MACb,YAAY;AAAA,IACd;AAAA,EACF;AACF,CAAC;AAED,OAAO,UAAU;",
|
|
6
|
-
"names": ["exports", "module", "ruleMessages", "metadata", "exports", "module", "import_sds_metadata", "import_rule_messages", "bemMapping", "metadata", "deprecatedClasses", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "enforceBemUsage", "exports", "module", "import_sds_metadata", "import_rule_messages", "deprecatedClasses", "metadata", "ruleConfig", "ruleMessages", "exports", "module", "import_rule_messages", "ruleConfig", "ruleMessages", "import_sds_metadata", "import_rule_messages", "ruleMessages", "metadata", "import_sds_metadata", "import_rule_messages", "type", "description", "url", "messages", "ruleMessages", "metadata", "import_sds_metadata", "import_rule_messages", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "metadata", "shouldIgnoreDetection", "import_sds_metadata", "import_rule_messages", "import_css_tree", "chroma", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "metadata", "type", "description", "url", "messages", "import_sds_metadata", "import_rule_messages", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "metadata", "shouldIgnoreDetection", "import_sds_metadata", "import_rule_messages", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "sldsPlusStylingHooks", "metadata", "allSldsHooks", "import_sds_metadata", "import_rule_messages", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "metadata", "shouldIgnoreDetection", "import_sds_metadata", "import_rule_messages", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "metadata", "import_sds_metadata", "import_rule_messages", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "sldsPlusStylingHooks", "metadata", "allSldsHooks", "toSldsToken", "shouldIgnoreDetection", "import_sds_metadata", "import_rule_messages", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "metadata", "shouldIgnoreDetection", "import_rule_messages", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "import_rule_messages", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "import_sds_metadata", "import_rule_messages", "import_css_tree", "ruleName", "rules", "ruleConfig", "ruleConfig", "ruleName", "type", "description", "url", "messages", "colorOnlySelector", "densityOnlySelector", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "metadata", "import_sds_metadata", "import_rule_messages", "ruleName", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "valueToStylinghook", "metadata", "import_parser", "enforceBemUsage", "noDeprecatedClassesSlds2", "modalCloseButtonIssue", "htmlParser"]
|
|
4
|
+
"sourcesContent": ["// THIS IS TAKEN FROM html-eslint\n\nimport { NODE_TYPES } from \"@html-eslint/parser\";\n\n\n/**\n * @param {TagNode | ScriptTagNode | StyleTagNode} node\n * @param {string} key\n * @returns {AttributeNode | undefined}\n */\nfunction findAttr(node, key) {\n return node.attributes.find(\n (attr) => attr.key && attr.key.value.toLowerCase() === key.toLowerCase()\n );\n}\n\n/**\n * Checks whether a node's attributes is empty or not.\n * @param {TagNode | ScriptTagNode | StyleTagNode} node\n * @returns {boolean}\n */\nfunction isAttributesEmpty(node) {\n return !node.attributes || node.attributes.length <= 0;\n}\n\n/**\n * Checks whether a node's all tokens are on the same line or not.\n * @param {AnyNode} node A node to check\n * @returns {boolean} `true` if a node's tokens are on the same line, otherwise `false`.\n */\nfunction isNodeTokensOnSameLine(node) {\n return node.loc.start.line === node.loc.end.line;\n}\n\n/**\n *\n * @param {Range} rangeA\n * @param {Range} rangeB\n * @returns {boolean}\n */\nfunction isRangesOverlap(rangeA, rangeB) {\n return rangeA[0] < rangeB[1] && rangeB[0] < rangeA[1];\n}\n\n/**\n * @param {(TextNode | CommentContentNode)['templates']} templates\n * @param {Range} range\n * @returns {boolean}\n */\nfunction isOverlapWithTemplates(templates, range) {\n return templates\n .filter((template) => template.isTemplate)\n .some((template) => isRangesOverlap(template.range, range));\n}\n\n/**\n *\n * @param {TextNode | CommentContentNode} node\n * @returns {LineNode[]}\n */\nfunction splitToLineNodes(node) {\n let start = node.range[0];\n let line = node.loc.start.line;\n const startCol = node.loc.start.column;\n /**\n * @type {LineNode[]}\n */\n const lineNodes = [];\n const templates = node.templates || [];\n /**\n *\n * @param {import(\"../../types\").Range} range\n */\n function shouldSkipIndentCheck(range) {\n const overlappedTemplates = templates.filter(\n (template) =>\n template.isTemplate && isRangesOverlap(template.range, range)\n );\n\n const isLineInTemplate = overlappedTemplates.some((template) => {\n return template.range[0] <= range[0] && template.range[1] >= range[1];\n });\n if (isLineInTemplate) {\n return true;\n }\n const isLineBeforeTemplate = overlappedTemplates.some((template) => {\n return template.range[0] <= range[0] && template.range[1] <= range[1];\n });\n if (isLineBeforeTemplate) {\n return true;\n }\n const isLineAfterTemplate = overlappedTemplates.some((template) => {\n return template.range[1] <= range[0];\n });\n if (isLineAfterTemplate) {\n return true;\n }\n return false;\n }\n\n node.value.split(\"\\n\").forEach((value, index) => {\n const columnStart = index === 0 ? startCol : 0;\n /**\n * @type {import(\"../../types\").Range}\n */\n const range = [start, start + value.length];\n const loc = {\n start: {\n line,\n column: columnStart,\n },\n end: {\n line,\n column: columnStart + value.length,\n },\n };\n /**\n * @type {LineNode}\n */\n const lineNode = {\n type: \"Line\",\n value,\n range,\n loc,\n skipIndentCheck: shouldSkipIndentCheck(range),\n };\n\n start += value.length + 1;\n line += 1;\n\n lineNodes.push(lineNode);\n });\n\n return lineNodes;\n}\n\n/**\n * Get location between two nodes.\n * @param {BaseNode} before A node placed in before\n * @param {BaseNode} after A node placed in after\n * @returns {Location} location between two nodes.\n */\nfunction getLocBetween(before, after) {\n return {\n start: before.loc.end,\n end: after.loc.start,\n };\n}\n\n/**\n * @param {AttributeValueNode} node\n * @return {boolean}\n */\nfunction isExpressionInTemplate(node) {\n if (node.type === NODE_TYPES.AttributeValue) {\n return node.value.indexOf(\"${\") === 0;\n }\n return false;\n}\n\n/**\n * @param {AnyNode} node\n * @returns {node is TagNode}\n */\nfunction isTag(node) {\n return node.type === NODE_TYPES.Tag;\n}\n\n/**\n * @param {AnyNode} node\n * @returns {node is CommentNode}\n */\nfunction isComment(node) {\n return node.type === NODE_TYPES.Comment;\n}\n\n/**\n * @param {AnyNode} node\n * @returns {node is TextNode}\n */\nfunction isText(node) {\n return node.type === NODE_TYPES.Text;\n}\n\nconst lineBreakPattern = /\\r\\n|[\\r\\n\\u2028\\u2029]/u;\nconst lineEndingPattern = new RegExp(lineBreakPattern.source, \"gu\");\n/**\n * @param {string} source\n * @returns {string[]}\n */\nfunction codeToLines(source) {\n return source.split(lineEndingPattern);\n}\n\n/**\n *\n * @param {AnyToken[]} tokens\n * @returns {((CommentContentNode | TextNode)['templates'][number])[]}\n */\nfunction getTemplateTokens(tokens) {\n return (\n []\n .concat(\n ...tokens\n // @ts-ignore\n .map((token) => token[\"templates\"] || [])\n )\n // @ts-ignore\n .filter((token) => token.isTemplate)\n );\n}\n\nexport {\n findAttr,\n isAttributesEmpty,\n isNodeTokensOnSameLine,\n splitToLineNodes,\n getLocBetween,\n isExpressionInTemplate,\n isTag,\n isComment,\n isText,\n isOverlapWithTemplates,\n codeToLines,\n isRangesOverlap,\n getTemplateTokens,\n};", "module.exports = {\n \"no-slds-class-overrides\": {\n \"description\": \"Create new custom CSS classes instead of overriding SLDS selectors\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-slds-class-overrides\",\n \"type\": \"problem\",\n \"messages\": {\n \"sldsClassOverride\": \"Overriding .{{className}} isn't supported. To differentiate SLDS and custom classes, create a CSS class in your namespace. Examples: myapp-input, myapp-button.\"\n }\n },\n \"no-deprecated-slds-classes\": {\n \"description\": \"Please replace the deprecated classes with a modern equivalent\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-deprecated-slds-classes\",\n \"type\": \"problem\",\n \"messages\": {\n \"deprecatedClass\": \"The class {{className}} is deprecated and not available in SLDS2. Please update to a supported class.\"\n }\n },\n \"no-deprecated-tokens-slds1\": {\n \"description\": \"Update outdated design tokens to SLDS 2 styling hooks with similar values. For more information, see Styling Hooks on lightningdesignsystem.com.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-deprecated-tokens-slds1\",\n \"type\": \"problem\",\n \"messages\": {\n \"deprecatedToken\": \"Consider removing {{oldValue}} or replacing it with {{newValue}}. Set the fallback to {{oldValue}}. For more info, see Styling Hooks on lightningdesignsystem.com.\",\n \"noReplacement\": \"Update outdated design tokens to SLDS 2 styling hooks with similar values. For more information, see Styling Hooks on lightningdesignsystem.com.\"\n }\n },\n \"enforce-sds-to-slds-hooks\": {\n \"description\": \"Convert your existing --sds styling hooks to --slds styling hooks. See lightningdesignsystem.com for more info.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#enforce-sds-to-slds-hooks\",\n \"type\": \"problem\",\n \"messages\": {\n \"replaceSdsWithSlds\": \"Replace {{oldValue}} with {{suggestedMatch}} styling hook.\"\n }\n },\n \"enforce-bem-usage\": {\n \"description\": \"Replace BEM double-dash syntax in class names with single underscore syntax\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#enforce-bem-usage\",\n \"type\": \"problem\",\n \"messages\": {\n \"bemDoubleDash\": \"{{actual}} has been retired. Update it to the new name {{newValue}}.\",\n \"fixBemNaming\": \"Update to correct BEM naming convention\"\n }\n },\n \"modal-close-button-issue\": {\n \"description\": \"Update component attributes or CSS classes for the modal close button to comply with the modal component blueprint\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#modal-close-button-issue\",\n \"type\": \"problem\",\n \"messages\": {\n \"modalCloseButtonIssue\": \"Update component attributes or CSS classes for the modal close button to comply with the modal component blueprint.\",\n \"removeClass\": \"Remove the slds-button_icon-inverse class from the modal close button in components that use the SLDS modal blueprint.\",\n \"changeVariant\": \"Change the variant attribute value from bare-inverse to bare in <lightning-button-icon> or <lightning-icon>.\",\n \"removeVariant\": \"Remove the variant attribute from the <lightning-icon> component inside the <button> element.\",\n \"ensureButtonClasses\": \"Add or move slds-button and slds-button_icon to the class attribute of the <button> element or <lightning-button-icon> component.\",\n \"ensureSizeAttribute\": \"To size icons properly, set the size attribute \u200Cto large in the <lightning-icon> and <lightning-button-icon> components.\"\n }\n },\n \"no-deprecated-classes-slds2\": {\n \"description\": \"Replace classes that aren't available with SLDS 2 classes\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-deprecated-classes-slds2\",\n \"type\": \"problem\",\n \"messages\": {\n \"deprecatedClass\": \"The class {{className}} isn't available in SLDS 2. Update it to a class supported in SLDS 2. See lightningdesignsystem.com for more information.\",\n \"updateToModernClass\": \"Replace deprecated class with modern equivalent\",\n \"checkDocumentation\": \"See lightningdesignsystem.com for SLDS 2 class alternatives\"\n }\n },\n \"lwc-token-to-slds-hook\": {\n \"description\": \"Replace the deprecated --lwc tokens with the latest --slds tokens. See lightningdesignsystem.com for more info.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#lwc-token-to-slds-hook\",\n \"type\": \"problem\",\n \"messages\": {\n \"errorWithReplacement\": \"The '{{oldValue}}' design token is deprecated. Replace it with '{{newValue}}'. For more info, see Global Styling Hooks on lightningdesignsystem.com.\",\n \"errorWithStyleHooks\": \"The '{{oldValue}}' design token is deprecated. Replace it with the SLDS 2 '{{newValue}}' styling hook and set the fallback to '{{oldValue}}'. For more info, see Global Styling Hooks on lightningdesignsystem.com.\",\n \"errorWithNoRecommendation\": \"The '{{oldValue}}' design token is deprecated. For more info, see the New Global Styling Hook Guidance on lightningdesignsystem.com.\"\n }\n },\n \"no-sldshook-fallback-for-lwctoken\": {\n \"description\": \"Avoid using --slds styling hooks as fallback values for --lwc tokens.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-sldshook-fallback-for-lwctoken\",\n \"type\": \"problem\",\n \"messages\": {\n \"unsupportedFallback\": \"Remove the {{sldsToken}} styling hook that is used as a fallback value for {{lwcToken}}.\"\n }\n },\n \"no-unsupported-hooks-slds2\": {\n \"description\": \"Identifies styling hooks that aren't present in SLDS 2. They must be replaced with styling hooks that have a similar effect, or they must be removed.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-unsupported-hooks-slds2\",\n \"type\": \"problem\",\n \"messages\": {\n \"deprecated\": \"The {{token}} styling hook isn't present in SLDS 2 and there's no equivalent replacement. Remove it or replace it with a styling hook with a similar effect.\"\n }\n },\n \"no-slds-var-without-fallback\": {\n \"description\": \"Add fallback values to SLDS styling hooks. The fallback values are used in Salesforce environments where styling hooks are unavailable.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-slds-var-without-fallback\",\n \"type\": \"problem\",\n \"messages\": {\n \"varWithoutFallback\": \"Your code uses the {{cssVar}} styling hook without a fallback value. Styling hooks are unavailable in some Salesforce environments. To render your component correctly in all environments, add this fallback value: var({{cssVar}}, {{recommendation}}). To make this fallback value brand-aware, use a branded design token instead of a static value. See Design Tokens on v1.lightningdesignsystem.com.\"\n }\n },\n \"no-slds-namespace-for-custom-hooks\": {\n \"description\": \"To differentiate custom styling hooks from SLDS styling hooks, create custom styling hooks in your namespace.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-slds-namespace-for-custom-hooks\",\n \"type\": \"problem\",\n \"messages\": {\n \"customHookNamespace\": \"Using the --slds namespace for {{token}} isn't supported. Create the custom styling hook in your namespace. Example: --myapp-{{tokenWithoutNamespace}}\"\n }\n },\n \"no-slds-private-var\": {\n \"description\": \"Some SLDS styling hooks are private and reserved only for internal Salesforce use. Private SLDS styling hooks have prefixes --_slds- and --slds-s-. For more information, look up private CSS in lightningdesignsystem.com.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-slds-private-var\",\n \"type\": \"problem\",\n \"messages\": {\n \"privateVar\": \"This styling hook is reserved for internal Salesforce use. Remove the --_slds- or \u2013slds-s private variable within selector {{prop}}. For more information, look up private CSS in lightningdesignsystem.com.\"\n }\n },\n \"enforce-component-hook-naming-convention\": {\n \"description\": \"Replace component styling hooks that use a deprecated naming convention.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#enforce-component-hook-naming-convention\",\n \"type\": \"problem\",\n \"messages\": {\n \"replace\": \"Replace the deprecated {{oldValue}} component styling hook with {{suggestedMatch}}.\"\n }\n },\n \"no-hardcoded-values-slds1\": {\n \"description\": \"Replace static values with SLDS 1 design tokens. For more information, look up design tokens on lightningdesignsystem.com.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-hardcoded-value\",\n \"type\": \"suggestion\",\n \"messages\": {\n \"hardcodedValue\": \"Replace the {{oldValue}} static value with an SLDS 1 styling hook: {{newValue}}.\",\n \"noReplacement\": \"There's no replacement styling hook for the {{oldValue}} static value. Remove the static value.\"\n }\n },\n \"no-hardcoded-values-slds2\": {\n \"description\": \"Replace static values with SLDS 2 styling hooks. For more information, look up design tokens on lightningdesignsystem.com.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-hardcoded-values-slds2\",\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", "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 { 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};", "import { Rule } from 'eslint';\nimport { findAttr, isAttributesEmpty } from \"../utils/node\";\nimport ruleMessages from '../config/rule-messages.yml';\n\nconst ruleConfig = ruleMessages['modal-close-button-issue'];\n\n// This rule specific to CVS, find more details here https://issues.salesforce.com/issue/a028c00000zh1iqAAA/modal-close-button-is-not-visible-with-the-new-white-background-after-winter-25-release\nexport = {\n meta: {\n type: ruleConfig.type,\n docs: {\n category: \"Best Practices\",\n recommended: true,\n description: ruleConfig.description,\n url: ruleConfig.url\n },\n fixable: \"code\",\n schema: [],\n messages: ruleConfig.messages,\n },\n\n create(context) {\n function check(node) {\n if (isAttributesEmpty(node)) {\n return;\n }\n\n const tagName = node.name;\n\n // \u2705 Scenario 1: Remove 'slds-button_icon-inverse' from <button> \n // (optional) when the parent of the button has class name `slds-modal`\n // and also button should have class `slds-modal__close`\n if (tagName === \"button\") {\n const classAttr = findAttr(node, \"class\");\n if (classAttr && classAttr.value) {\n const classList = classAttr.value.value.split(/\\s+/);\n\n // \u2705 Ensure button has \"slds-modal__close\" before proceeding\n if (!classList.includes(\"slds-modal__close\")) {\n return; // Stop execution if the class is missing\n }\n\n if (classList.includes(\"slds-button_icon-inverse\") || classList.includes(\"slds-button--icon-inverse\")) {\n const newClassList = classList\n .filter((cls) => (cls !== \"slds-button_icon-inverse\" && cls !== \"slds-button--icon-inverse\"))\n .join(\" \");\n context.report({\n node,\n loc: classAttr.loc,\n messageId: \"removeClass\",\n fix(fixer) { \n return fixer.replaceText(classAttr, // Replace the full attribute\n `class=\"${newClassList}\"` // Updated class list\n );\n },\n });\n }\n }\n }\n\n // \u2705 Scenario 2: Fix <lightning-button-icon> and this should have class `slds-modal__close`\n if (tagName === \"lightning-button-icon\" || tagName === \"lightning:buttonIcon\") {\n const variantAttr = findAttr(node, \"variant\");\n const sizeAttr = findAttr(node, \"size\");\n const classAttr = findAttr(node, \"class\");\n const iconClassAttr = findAttr(node, \"icon-class\"); // \uD83D\uDD0D Check for icon-class attribute\n \n function validateClassAttr(attribute, attrName) {\n if (attribute && attribute.value) {\n const classList = attribute.value.value.split(/\\s+/);\n\n // Irrespective of whether we are checking for class or icon-class we need to check whether the attribute is present or not.\n // \u2705 Ensure \"slds-modal__close\" exists before proceeding\n if(!classAttr?.value?.value?.includes(\"slds-modal__close\"))\n {\n return;\n }\n \n // \u2705 Ensure \"slds-modal__close\" exists before proceeding\n // if (!classList.includes(\"slds-modal__close\")) {\n // return; // Stop execution if the class is missing\n // }\n \n // Remove inverse classes\n if (classList.includes(\"slds-button_icon-inverse\") || classList.includes(\"slds-button--icon-inverse\")) {\n const newClassList = classList\n .filter((cls) => cls !== \"slds-button_icon-inverse\" && cls !== \"slds-button--icon-inverse\")\n .join(\" \");\n context.report({\n node,\n loc: attribute.loc,\n messageId: \"removeClass\",\n fix(fixer) {\n return fixer.replaceText(attribute, // Replace the full attribute\n `${attrName}=\"${newClassList}\"` // Correctly modifies the respective attribute\n );\n },\n });\n }\n \n // Ensure 'slds-button' and 'slds-button_icon' exist\n if (!classList.includes(\"slds-button\") || !classList.includes(\"slds-button_icon\")) {\n let newClassList;\n if(attrName === 'icon-class'){\n newClassList = [\n ...classList.filter((cls) => cls !== \"slds-button_icon-inverse\"),\n ].join(\" \");\n }else{\n newClassList = [\n \"slds-button\",\n \"slds-button_icon\",\n ...classList.filter((cls) => cls !== \"slds-button_icon-inverse\"),\n ].join(\" \");\n }\n context.report({\n node: attribute,\n loc: attribute.value.loc,\n messageId: \"ensureButtonClasses\",\n fix(fixer) {\n return fixer.replaceText(attribute.value, `${newClassList}`);\n },\n });}\n \n // Fix variant=\"bare-inverse\" to \"bare\"\n if (variantAttr && variantAttr.value && variantAttr.value.value === \"bare-inverse\") {\n context.report({\n node: variantAttr,\n messageId: \"changeVariant\",\n loc: variantAttr.value.loc,\n fix(fixer) {\n return fixer.replaceText(variantAttr.value, `bare`);\n },\n });\n }\n \n // Ensure size=\"large\" exists\n // if (!sizeAttr) {\n // context.report({\n // node,\n // message: messages[\"ensureSizeAttribute\"],\n // fix(fixer) {\n // if (variantAttr) {\n // return fixer.insertTextAfterRange([variantAttr.range[1], variantAttr.range[1]], ' size=\"large\"');\n // }\n // },\n // });\n // }\n }\n }\n \n // \u2705 Validate `class` and `icon-class` separately, maintaining their own attribute names\n validateClassAttr(classAttr, \"class\");\n validateClassAttr(iconClassAttr, \"icon-class\");\n }\n\n // \u2705 Scenario 3: Fix <lightning-icon> inside <button> & the class name of the parent name as button and it should have `slds-modal__close`\n if ((tagName === \"lightning-icon\" || tagName === \"lightning:icon\") && node.parent?.name === \"button\") {\n const parentClassAttr = findAttr(node.parent, \"class\");\n if (parentClassAttr && parentClassAttr.value) {\n const parentClassList = parentClassAttr.value.value.split(/\\s+/);\n\n // \u2705 Ensure the parent <button> has \"slds-modal__close\" before proceeding\n if (!parentClassList.includes(\"slds-modal__close\")) {\n return; // Stop execution if the class is missing\n }\n const variantAttr = findAttr(node, \"variant\");\n const sizeAttr = findAttr(node, \"size\");\n\n // Fix variant=\"bare-inverse\" to \"bare\"\n if (variantAttr && variantAttr.value && variantAttr.value.value === \"bare-inverse\") {\n context.report({\n node: variantAttr,\n messageId: \"changeVariant\",\n loc: variantAttr.value.loc,\n fix(fixer) {\n return fixer.replaceText(variantAttr.value, `bare`);\n },\n });\n }\n\n // // Remove variant attribute completely\n // if (variantAttr) {\n // context.report({\n // node: variantAttr,\n // messageId: \"removeVariant\",\n // fix(fixer) {\n // return fixer.remove(variantAttr);\n // },\n // });\n // }\n\n //Ensure size=\"large\" is set\n // if (!sizeAttr) {\n // context.report({\n // node,\n // message: messages[\"ensureSizeAttribute\"],\n // fix(fixer) {\n // //return fixer.insertTextAfter(node, ' size=\"large\"');\n // if(variantAttr)\n // {\n // return fixer.insertTextAfterRange([variantAttr.range[1], variantAttr.range[1]], ' size=\"large\"')\n // }\n // },\n // });\n // }\n }\n }\n }\n return {\n Tag: check,\n };\n },\n};", "// Unified ESLint plugin config for both v8 (legacy) and v9+ (flat)\n\nimport enforceBemUsage from './rules/enforce-bem-usage';\nimport noDeprecatedClassesSlds2 from './rules/no-deprecated-classes-slds2';\nimport modalCloseButtonIssue from './rules/modal-close-button-issue';\nimport noSldsClassOverrides from './rules/v9/no-slds-class-overrides';\nimport noDeprecatedSldsClasses from './rules/v9/no-deprecated-slds-classes';\nimport noDeprecatedTokensSlds1 from './rules/v9/no-deprecated-tokens-slds1';\nimport lwcTokenToSldsHook from './rules/v9/lwc-token-to-slds-hook';\nimport enforceSdsToSldsHooks from './rules/v9/enforce-sds-to-slds-hooks';\nimport noSldshookFallbackForLwctoken from './rules/v9/no-sldshook-fallback-for-lwctoken';\nimport noUnsupportedHooksSlds2 from './rules/v9/no-unsupported-hooks-slds2';\nimport noSldsVarWithoutFallback from './rules/v9/no-slds-var-without-fallback';\nimport noSldsNamespaceForCustomHooks from './rules/v9/no-slds-namespace-for-custom-hooks';\nimport enforceComponentHookNamingConvention from './rules/v9/enforce-component-hook-naming-convention';\nimport reduceAnnotations from './rules/v9/reduce-annotations';\nimport noSldsPrivateVar from './rules/v9/no-slds-private-var';\nimport noHardcodedValuesSlds1 from './rules/v9/no-hardcoded-values/no-hardcoded-values-slds1';\nimport noHardcodedValuesSlds2 from './rules/v9/no-hardcoded-values/no-hardcoded-values-slds2';\n\n\nimport htmlParser from \"@html-eslint/parser\";\nimport cssPlugin from \"@eslint/css\";\n\n// Import rule configurations based on persona\nimport ruleConfigs from '../eslint.rules.json';\n\nconst rules = {\n \"enforce-bem-usage\": enforceBemUsage,\n \"no-deprecated-classes-slds2\": noDeprecatedClassesSlds2,\n \"modal-close-button-issue\": modalCloseButtonIssue,\n \"no-slds-class-overrides\": noSldsClassOverrides,\n \"no-deprecated-slds-classes\": noDeprecatedSldsClasses,\n \"no-deprecated-tokens-slds1\": noDeprecatedTokensSlds1,\n \"lwc-token-to-slds-hook\": lwcTokenToSldsHook,\n \"enforce-sds-to-slds-hooks\": enforceSdsToSldsHooks,\n \"no-sldshook-fallback-for-lwctoken\": noSldshookFallbackForLwctoken,\n \"no-unsupported-hooks-slds2\": noUnsupportedHooksSlds2,\n \"no-slds-var-without-fallback\": noSldsVarWithoutFallback,\n \"no-slds-namespace-for-custom-hooks\": noSldsNamespaceForCustomHooks,\n \"enforce-component-hook-naming-convention\": enforceComponentHookNamingConvention,\n \"no-slds-private-var\": noSldsPrivateVar,\n \"no-hardcoded-values-slds1\": noHardcodedValuesSlds1,\n \"no-hardcoded-values-slds2\": noHardcodedValuesSlds2,\n \"reduce-annotations\": reduceAnnotations\n};\n\nconst plugin = {\n meta: {\n name: \"@salesforce-ux/eslint-plugin-slds\",\n version: process.env.PLUGIN_VERSION\n },\n rules,\n configs: {}\n};\n\n// Base CSS config with CSS plugin included (required for SLDS plugin to work independently)\nconst baseCssConfigWithPlugin = {\n files: [\"**/*.{css,scss}\"],\n language: \"css/css\",\n languageOptions: {\n tolerant: true // Allow recoverable parsing errors for SCSS syntax\n },\n plugins: {\n css: cssPlugin,\n \"@salesforce-ux/slds\": plugin,\n },\n rules: ruleConfigs.css,\n settings: {\n // Pass rules configuration to context for runtime access\n sldsRules: { ...ruleConfigs.css }\n }\n};\n\n// CSS config array built from base config (self-sufficient with CSS plugin)\nconst cssConfigArray = [baseCssConfigWithPlugin];\n\nconst htmlConfigArray = [\n // HTML/Component config\n {\n files: [\"**/*.html\", \"**/*.cmp\"],\n languageOptions: {\n parser: htmlParser,\n ecmaVersion: 2021,\n sourceType: \"module\"\n },\n plugins: {\n \"@salesforce-ux/slds\": plugin\n },\n rules: ruleConfigs.html\n }\n];\n\nObject.assign(plugin.configs, {\n // Flat config for ESLint v9+\n \"flat/recommended-css\": cssConfigArray,\n \"flat/recommended-html\": htmlConfigArray,\n \"flat/recommended\": [...cssConfigArray, ...htmlConfigArray],\n // legacy config for ESLint v8-\n recommended: {\n plugins: [\"@salesforce-ux/slds\"],\n rules: ruleConfigs.html,\n parser: htmlParser,\n parserOptions: {\n ecmaVersion: 2021,\n sourceType: \"module\"\n }\n }\n});\n\nfunction sldsCssPlugin() {\n return {\n ...baseCssConfigWithPlugin.plugins,\n }\n}\n\nmodule.exports = plugin;\nmodule.exports.sldsCssPlugin = sldsCssPlugin;\n", "/**\n * @fileoverview Rule to disallow overriding SLDS CSS classes\n * Compatible with @eslint/css parser for ESLint v9\n * Maintains full parity with stylelint version behavior\n */\n\nimport { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata';\nimport ruleMessages from '../../config/rule-messages.yml';\n\nconst ruleConfig = ruleMessages['no-slds-class-overrides'];\n\n// Get SLDS classes from metadata (same as stylelint version)\nconst sldsClasses = metadata.sldsPlusClasses;\nconst sldsClassesSet = new Set(sldsClasses);\n\nexport default {\n meta: {\n type: ruleConfig.type,\n docs: {\n description: ruleConfig.description,\n recommended: true, //useful for plugin recommended configs\n url: ruleConfig.url,\n },\n fixable: null,\n hasSuggestions: false,\n schema: [],\n messages: ruleConfig.messages,\n },\n \n create(context) {\n return {\n // For no-slds-class-overrides: Only flags classes at selector end\n \"SelectorList Selector\"(node) {\n // Get the last ClassSelector in this selector (the one at the end)\n const classSelectorNode = node.children.filter((child) => child.type === \"ClassSelector\").at(-1);\n \n if (classSelectorNode) {\n const className = classSelectorNode.name;\n \n // Check if it's an SLDS class that exists in metadata\n if (className && \n className.startsWith('slds-') && \n sldsClassesSet.has(className)) {\n context.report({\n node: classSelectorNode,\n messageId: 'sldsClassOverride',\n data: { className },\n });\n }\n }\n },\n };\n },\n} as Rule.RuleModule; ", "import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata';\nimport ruleMessages from '../../config/rule-messages.yml';\n\nconst {type, description, url, messages} = ruleMessages['no-deprecated-slds-classes'];\n\nconst deprecatedClasses = metadata.deprecatedClasses;\nconst deprecatedClassesSet = new Set(deprecatedClasses);\n\nexport default {\n meta: {\n type,\n docs: {\n description,\n recommended: true,\n url,\n },\n messages,\n },\n \n create(context) {\n return {\n // For no-deprecated-slds-classes: Check all class selectors for deprecated classes\n \"SelectorList Selector ClassSelector\"(node) {\n const cssClassSelector = context.sourceCode.getText(node);\n \n // Extract class name (remove the leading dot)\n const className = cssClassSelector.substring(1);\n \n // Check if it's a deprecated SLDS class\n if (className && deprecatedClassesSet.has(className)) {\n context.report({\n node,\n messageId: 'deprecatedClass',\n data: { className },\n });\n }\n },\n };\n },\n} as Rule.RuleModule;\n", "import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata';\nimport ruleMessages from '../../config/rule-messages.yml';\n\nconst ruleConfig = ruleMessages['no-deprecated-tokens-slds1'];\nconst { type, description, url, messages } = ruleConfig;\n\n// Get token mapping from metadata (Aura tokens to LWC tokens)\nconst tokenMapping = metadata.auraToLwcTokensMapping;\n\nexport default {\n meta: {\n type,\n docs: {\n description: description,\n recommended: true,\n url,\n },\n fixable: 'code',\n messages,\n },\n \n create(context) {\n /**\n * Check if a token should be ignored (not in mapping or not LWC token)\n */\n function shouldIgnoreDetection(token: string): boolean {\n return (!(token in tokenMapping) || !tokenMapping[token].startsWith('--lwc-'));\n }\n\n /**\n * Generate replacement suggestion for deprecated token\n */\n function generateReplacement(tokenName: string, originalFunctionCall: string): string | null {\n if (shouldIgnoreDetection(tokenName)) {\n return null;\n }\n const recommendation = tokenMapping[tokenName];\n return `var(${recommendation}, ${originalFunctionCall})`;\n }\n\n function handleTokenFunction(node, functionName) {\n // Get the token name from the identifier\n const tokenName = context.sourceCode.getText(node);\n \n // Skip if token should be ignored\n if (shouldIgnoreDetection(tokenName)) {\n return;\n }\n\n // Create original function call - mirroring stylelint's approach\n const originalFunctionCall = `${functionName}(${tokenName})`;\n const replacement = generateReplacement(tokenName, originalFunctionCall);\n \n if (replacement) {\n // Report with replacement suggestion\n context.report({\n node,\n messageId: 'deprecatedToken',\n data: { \n oldValue: originalFunctionCall,\n newValue: replacement\n },\n fix(fixer) {\n // Use node position to avoid multiple replacements of same token\n const sourceCode = context.sourceCode.getText();\n const tokenFunctionCall = `${functionName}(${tokenName})`;\n const nodeOffset = node.loc.start.offset;\n \n // Search backwards from the node position to find the function start\n const searchStart = Math.max(0, nodeOffset - functionName.length - 1);\n const searchEnd = nodeOffset + tokenName.length + 1;\n const searchArea = sourceCode.substring(searchStart, searchEnd);\n \n const functionCallIndex = searchArea.indexOf(tokenFunctionCall);\n if (functionCallIndex !== -1) {\n const actualStart = searchStart + functionCallIndex;\n const actualEnd = actualStart + tokenFunctionCall.length;\n return fixer.replaceTextRange([actualStart, actualEnd], replacement);\n }\n return null;\n }\n });\n } else {\n // Report without specific replacement\n context.report({\n node,\n messageId: 'noReplacement',\n });\n }\n }\n\n return {\n \"Function[name='token'] Identifier\"(node) {\n handleTokenFunction(node, 'token');\n },\n \"Function[name='t'] Identifier\"(node) {\n handleTokenFunction(node, 't');\n },\n };\n\n },\n} as Rule.RuleModule;\n", "import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata';\nimport ruleMessages from '../../config/rule-messages.yml';\nimport { formatSuggestionHooks, forEachLwcVariable, type CssVariableInfo } from '../../utils/css-utils';\nimport type { PositionInfo } from '../../utils/hardcoded-shared-utils';\n\nconst ruleConfig = ruleMessages['lwc-token-to-slds-hook'];\nconst { type, description, url, messages } = ruleConfig;\n\nconst lwcToSlds = metadata.lwcToSlds;\n\n// Replacement category enum to match Stylelint version\nenum ReplacementCategory {\n EMPTY = 'empty',\n SLDS_TOKEN = 'slds_token',\n ARRAY = 'array',\n RAW_VALUE = 'raw_value'\n}\n\nfunction shouldIgnoreDetection(lwcToken: string): boolean {\n // Ignore if entry not found in the list or the token is marked to use further\n return (\n !lwcToken.startsWith('--lwc-') ||\n !(lwcToken in lwcToSlds) ||\n lwcToSlds[lwcToken].continueToUse\n );\n}\n\nfunction categorizeReplacement(recommendation: string | string[]): ReplacementCategory {\n if (!recommendation || recommendation === '--') {\n return ReplacementCategory.EMPTY;\n }\n if (Array.isArray(recommendation)) {\n return ReplacementCategory.ARRAY;\n }\n if (typeof recommendation === 'string' && recommendation.startsWith('--slds-')) {\n return ReplacementCategory.SLDS_TOKEN;\n }\n return ReplacementCategory.RAW_VALUE;\n}\n\nfunction getRecommendation(lwcToken: string) {\n const oldValue = lwcToken;\n const recommendation = lwcToSlds[oldValue]?.replacement || '';\n const replacementCategory = categorizeReplacement(recommendation);\n const hasRecommendation = oldValue in lwcToSlds && replacementCategory !== ReplacementCategory.EMPTY;\n return { hasRecommendation, recommendation, replacementCategory };\n}\n\nfunction getReportMessage(cssVar: string, replacementCategory: ReplacementCategory, recommendation: string | string[]): { messageId: string, data: any } {\n if (!recommendation) {\n // Found a deprecated token but don't have any alternate recommendation then just report user to follow docs\n return {\n messageId: 'errorWithNoRecommendation',\n data: { oldValue: cssVar }\n };\n } else if (replacementCategory === ReplacementCategory.ARRAY) {\n return {\n messageId: 'errorWithStyleHooks',\n data: { oldValue: cssVar, newValue: formatSuggestionHooks(recommendation as string[]) }\n };\n } else if (replacementCategory === ReplacementCategory.SLDS_TOKEN) {\n return {\n messageId: 'errorWithStyleHooks',\n data: { oldValue: cssVar, newValue: recommendation as string }\n };\n } else {\n return {\n messageId: 'errorWithReplacement',\n data: { oldValue: cssVar, newValue: recommendation as string }\n };\n }\n}\n\nexport default {\n meta: {\n type,\n docs: {\n description,\n recommended: true,\n url,\n },\n fixable: 'code',\n messages,\n },\n \n create(context) {\n function reportAndFix(\n node: any,\n suggestedMatch: string | null,\n messageId: string,\n data: any,\n fixRange?: [number, number],\n loc?: any\n ) {\n context.report({\n node,\n loc: loc || node.loc,\n messageId,\n data,\n fix: suggestedMatch && fixRange ? (fixer) => {\n return fixer.replaceTextRange(fixRange, suggestedMatch);\n } : undefined\n });\n }\n\n return {\n // CSS custom property declarations: Check both property name and value\n \"Declaration\"(node) {\n // Check 1: Property name (left-side) for custom properties using --lwc- prefix\n const property = node.property;\n if (property && property.startsWith('--lwc-')) {\n if (!shouldIgnoreDetection(property)) {\n const { hasRecommendation, recommendation, replacementCategory } = getRecommendation(property);\n const { messageId, data } = getReportMessage(property, replacementCategory, recommendation);\n \n // Only provide auto-fix for SLDS token replacements\n const suggestedMatch = (hasRecommendation && replacementCategory === ReplacementCategory.SLDS_TOKEN) \n ? recommendation as string \n : null;\n \n // Calculate fix range for property name\n const propertyStart = node.loc.start.offset;\n const propertyEnd = propertyStart + property.length;\n \n reportAndFix(node, suggestedMatch, messageId, data, [propertyStart, propertyEnd]);\n }\n }\n\n // Check 2: Property value (right-side) - Use AST parsing to detect var(--lwc-*) functions\n // Note: We use forEachLwcVariable instead of Function[name='var'] handler because\n // ESLint treats custom property values (e.g., --custom-prop: var(--lwc-token)) as raw strings\n // rather than parsing them into Function nodes. This AST-based approach handles both cases.\n const valueText = context.sourceCode.getText(node.value);\n if (valueText) {\n forEachLwcVariable(valueText, (variableInfo: CssVariableInfo, positionInfo: PositionInfo) => {\n const { name: lwcToken, hasFallback } = variableInfo;\n \n if (shouldIgnoreDetection(lwcToken)) {\n return;\n }\n\n const { hasRecommendation, recommendation, replacementCategory } = getRecommendation(lwcToken);\n const { messageId, data } = getReportMessage(lwcToken, replacementCategory, recommendation);\n \n let suggestedMatch: string | null = null;\n \n if (hasRecommendation) {\n if (replacementCategory === ReplacementCategory.SLDS_TOKEN) {\n // Extract fallback value from the original var() call if present\n // Use position info to get the full var() call text\n let fallbackValue: string | null = null;\n if (hasFallback && positionInfo.start && positionInfo.end && positionInfo.start.offset !== undefined && positionInfo.end.offset !== undefined) {\n const varCallText = valueText.substring(positionInfo.start.offset, positionInfo.end.offset);\n // Find the comma after the token name and extract everything after it (before the closing paren)\n const commaIndex = varCallText.indexOf(',');\n if (commaIndex !== -1) {\n // Extract from after comma to before closing paren\n fallbackValue = varCallText.substring(commaIndex + 1, varCallText.length - 1).trim();\n }\n }\n \n // Create the replacement in the format: var(--slds-token, var(--lwc-token, fallback))\n // This preserves any existing fallback value\n const originalVarCall = fallbackValue \n ? `var(${lwcToken}, ${fallbackValue})`\n : `var(${lwcToken})`;\n suggestedMatch = `var(${recommendation}, ${originalVarCall})`;\n } else if (replacementCategory === ReplacementCategory.RAW_VALUE) {\n suggestedMatch = recommendation as string;\n }\n }\n\n // Calculate fix range and location using position info from AST parsing\n const valueStartOffset = node.value.loc.start.offset;\n const varStartOffset = valueStartOffset + (positionInfo.start?.offset || 0);\n const varEndOffset = valueStartOffset + (positionInfo.end?.offset || valueText.length);\n \n // Calculate precise location if position info is available\n const preciseLoc = positionInfo.start && positionInfo.end && node.value.loc ? {\n start: {\n line: node.value.loc.start.line + positionInfo.start.line - 1,\n column: node.value.loc.start.column + positionInfo.start.column - 1\n },\n end: {\n line: node.value.loc.start.line + positionInfo.end.line - 1,\n column: node.value.loc.start.column + positionInfo.end.column - 1\n }\n } : node.value.loc;\n \n reportAndFix(node, suggestedMatch, messageId, data, [varStartOffset, varEndOffset], preciseLoc);\n });\n }\n },\n };\n },\n} as Rule.RuleModule;\n", "import { parse, walk } from '@eslint/css-tree';\nimport type { HandlerContext } from '../types';\nimport type { ParsedUnitValue } from './value-utils';\nimport { ALLOWED_UNITS } from './value-utils';\nimport { extractColorValue } from './color-lib-utils';\nimport { isCssFunction } from './css-functions';\n\n/**\n * Common replacement data structure used by both color and density handlers\n */\nexport interface ReplacementInfo {\n start: number;\n end: number;\n replacement: string; // Full CSS var: var(--hook, fallback)\n displayValue: string; // Just the hook: --hook\n hasHook: boolean;\n}\n\n/**\n * Position information from CSS tree parsing\n */\nexport interface PositionInfo {\n start?: { offset: number; line: number; column: number };\n end?: { offset: number; line: number; column: number };\n}\n\n/**\n * Generic callback for processing values with position information\n */\nexport type ValueCallback<T> = (value: T, positionInfo?: PositionInfo) => void;\n\n/**\n * Known valid font-weight values\n */\nconst FONT_WEIGHTS = [\n 'normal',\n 'bold', \n 'bolder',\n 'lighter',\n '100',\n '200', \n '300',\n '400',\n '500',\n '600',\n '700',\n '800',\n '900'\n];\n\n/**\n * Check if a value is a known font-weight\n */\nexport function isKnownFontWeight(value: string | number): boolean {\n const stringValue = value.toString();\n return FONT_WEIGHTS.includes(stringValue.toLowerCase());\n}\n\n/**\n * Generic shorthand auto-fix handler\n * Handles the common logic for reconstructing shorthand values with replacements\n */\nexport function handleShorthandAutoFix(\n declarationNode: any,\n context: HandlerContext,\n valueText: string,\n replacements: ReplacementInfo[]\n) {\n // Sort replacements by position for proper reconstruction\n const sortedReplacements = replacements.sort((a, b) => a.start - b.start);\n \n // Check if we can apply auto-fix (at least one value has a hook)\n const hasAnyHooks = sortedReplacements.some(r => r.hasHook);\n const canAutoFix = hasAnyHooks;\n\n // Report each individual value\n sortedReplacements.forEach(({ start, end, replacement, displayValue, hasHook }) => {\n const originalValue = valueText.substring(start, end);\n const valueStartColumn = declarationNode.value.loc.start.column;\n const valueColumn = valueStartColumn + start;\n \n // Create precise error location for this value\n const { loc: { start: locStart, end: locEnd } } = declarationNode.value;\n const reportNode = {\n ...declarationNode.value,\n loc: {\n ...declarationNode.value.loc,\n start: {\n ...locStart,\n column: valueColumn\n },\n end: {\n ...locEnd,\n column: valueColumn + originalValue.length\n }\n }\n };\n\n if (hasHook) {\n // Create auto-fix for the entire shorthand value\n const fix = canAutoFix ? (fixer: any) => {\n // Reconstruct the entire value with all replacements\n let newValue = valueText;\n \n // Apply replacements from right to left to maintain string positions\n for (let i = sortedReplacements.length - 1; i >= 0; i--) {\n const { start: rStart, end: rEnd, replacement: rReplacement } = sortedReplacements[i];\n newValue = newValue.substring(0, rStart) + rReplacement + newValue.substring(rEnd);\n }\n \n return fixer.replaceText(declarationNode.value, newValue);\n } : undefined;\n\n context.context.report({\n node: reportNode,\n messageId: 'hardcodedValue',\n data: {\n oldValue: originalValue,\n newValue: displayValue\n },\n fix\n });\n } else {\n // No hook available\n context.context.report({\n node: reportNode,\n messageId: 'noReplacement',\n data: {\n oldValue: originalValue\n }\n });\n }\n });\n}\n\n/**\n * Generic CSS tree traversal with position tracking\n * Always provides position information since both handlers need it\n */\nexport function forEachValue<T>(\n valueText: string,\n extractValue: (node: any) => T | null,\n shouldSkipNode: (node: any) => boolean,\n callback: (value: T, positionInfo: PositionInfo) => void\n): void {\n if (!valueText || typeof valueText !== 'string') {\n return;\n }\n\n try {\n const ast = parse(valueText, { context: 'value' as const, positions: true });\n \n walk(ast, {\n enter(node: any) {\n // Skip nodes efficiently using this.skip\n if (shouldSkipNode(node)) {\n return this.skip;\n }\n \n const value = extractValue(node);\n if (value !== null) {\n const positionInfo: PositionInfo = {\n start: node.loc?.start,\n end: node.loc?.end\n };\n callback(value, positionInfo);\n }\n }\n });\n } catch (error) {\n // Silently handle parse errors\n return;\n }\n}\n\n/**\n * Check if color node should be skipped during traversal\n */\nfunction shouldSkipColorNode(node: any): boolean {\n return node.type === 'Function' && isCssFunction(node.name);\n}\n\n/**\n * Check if dimension node should be skipped during traversal\n * Skip all function nodes by default\n */\nfunction shouldSkipDimensionNode(node: any): boolean {\n return node.type === 'Function';\n}\n\n/**\n * Extract dimension value from CSS AST node\n * Returns structured data with number and unit to eliminate regex parsing\n */\nfunction extractDimensionValue(valueNode: any, cssProperty?: string): ParsedUnitValue | null {\n if (!valueNode) return null;\n \n switch (valueNode.type) {\n case 'Dimension':\n // Dimensions: 16px, 1rem -> extract value and unit directly from AST\n const numValue = Number(valueNode.value);\n if (numValue === 0) return null; // Skip zero values\n \n const unit = valueNode.unit.toLowerCase();\n if (!ALLOWED_UNITS.includes(unit)) return null; // Support only allowed units\n \n return {\n number: numValue,\n unit: unit as 'px' | 'rem' | '%' | 'em' | 'ch'\n };\n \n case 'Number':\n // Numbers: 400, 1.5 -> treat as unitless (font-weight, line-height, etc.)\n const numberValue = Number(valueNode.value);\n if (numberValue === 0) return null; // Skip zero values\n \n return {\n number: numberValue,\n unit: null\n };\n \n case 'Percentage':\n // Percentage values: 100%, 50% -> extract value and add % unit\n const percentValue = Number(valueNode.value);\n if (percentValue === 0) return null; // Skip zero values\n \n return {\n number: percentValue,\n unit: '%'\n };\n \n case 'Value':\n // Value wrapper - extract from first child\n return valueNode.children?.[0] ? extractDimensionValue(valueNode.children[0], cssProperty) : null;\n }\n \n return null;\n}\n\n/**\n * Specialized color value traversal\n * Handles color-specific extraction and skipping logic\n */\nexport function forEachColorValue(\n valueText: string,\n callback: (colorValue: string, positionInfo: PositionInfo) => void\n): void {\n forEachValue(valueText, extractColorValue, shouldSkipColorNode, callback);\n}\n\n/**\n * Specialized density value traversal\n * Handles dimension-specific extraction and skipping logic\n */\nexport function forEachDensityValue(\n valueText: string,\n cssProperty: string,\n callback: (parsedDimension: ParsedUnitValue, positionInfo: PositionInfo) => void\n): void {\n forEachValue(\n valueText, \n (node) => extractDimensionValue(node, cssProperty), \n shouldSkipDimensionNode, \n callback\n );\n}\n\n/**\n * Extract font-related values from CSS AST node\n * Handles font-size and font-weight values\n */\nfunction extractFontValue(node: any): ParsedUnitValue | null {\n if (!node) return null;\n \n switch (node.type) {\n case 'Dimension':\n // Font-size: 16px, 1rem, etc.\n const numValue = Number(node.value);\n if (numValue <= 0) return null; // Skip zero/negative values\n \n const unit = node.unit.toLowerCase();\n if (!ALLOWED_UNITS.includes(unit)) return null;\n \n return {\n number: numValue,\n unit: unit as 'px' | 'rem' | '%' | 'em' | 'ch'\n };\n \n case 'Number':\n // Font-weight: 400, 700, etc.\n const numberValue = Number(node.value);\n if (numberValue <= 0) {\n return null; // Skip zero/negative values\n }\n \n // Only accept known font-weight values for unitless numbers\n if (!isKnownFontWeight(numberValue)) {\n return null; // Skip values that aren't valid font-weights\n }\n \n return {\n number: numberValue,\n unit: null\n };\n \n case 'Identifier':\n // Font-weight keywords: normal, bold, etc.\n const namedValue = node.name.toLowerCase();\n \n // Only accept known font-weight keywords\n if (!isKnownFontWeight(namedValue)) {\n return null;\n }\n \n // Convert known keywords to numeric values\n if (namedValue === 'normal') {\n return { number: 400, unit: null };\n }\n \n // For other keywords (bolder, lighter), we can't determine exact numeric value\n // but we know they're valid font-weight values\n return { number: namedValue, unit: null };\n \n case 'Percentage':\n // Percentage values for font-size\n const percentValue = Number(node.value);\n if (percentValue === 0) return null; // Skip zero values\n \n return {\n number: percentValue,\n unit: '%'\n };\n \n case 'Value':\n // Value wrapper - extract from first child\n return node.children?.[0] ? extractFontValue(node.children[0]) : null;\n }\n \n return null;\n}\n\n/**\n * Check if font node should be skipped during traversal\n * Skip all function nodes by default\n */\nfunction shouldSkipFontNode(node: any): boolean {\n return node.type === 'Function';\n}\n\n/**\n * Specialized font value traversal\n * Handles font-specific extraction and skipping logic\n */\nexport function forEachFontValue(\n valueText: string,\n callback: (fontValue: ParsedUnitValue, positionInfo: PositionInfo) => void\n): void {\n forEachValue(valueText, extractFontValue, shouldSkipFontNode, callback);\n}\n", "// Simplified value parsing\n\n/**\n * Checks if a value is a CSS global value.\n *\n * CSS global values are special keywords that can be used for any CSS property and have a universal meaning:\n * - initial: Resets the property to its initial value as defined by the CSS specification.\n * - inherit: Inherits the value from the parent element.\n * - unset: Acts as inherit if the property is inheritable, otherwise acts as initial.\n * - revert: Rolls back the property to the value established by the user-agent or user styles.\n * - revert-layer: Rolls back the property to the value established by the previous cascade layer.\n *\n * All CSS properties accept these global values, including but not limited to:\n * - color\n * - background\n * - font-size\n * - margin\n * - padding\n * - border\n * - display\n * - position\n * - z-index\n * - and many more\n *\n * These values are part of the CSS standard and are not considered violations, even if a rule would otherwise flag a value as invalid or non-design-token. They are always allowed for any property.\n *\n * @param value The CSS value to check.\n * @returns True if the value is a CSS global value, false otherwise.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/initial\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/inherit\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/unset\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/revert\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/revert-layer\n */\nexport function isGlobalValue(value: string): boolean {\n return value === 'initial' || value === 'inherit' || value === 'unset' || value === 'revert' || value === 'revert-layer';\n }\n\n// Configurable list of allowed CSS units\nexport const ALLOWED_UNITS = ['px', 'em', 'rem', '%', 'ch'];\n\nexport type ParsedUnitValue = {\n unit: 'px' | 'rem' | '%' | 'em' | 'ch' | null;\n number: number;\n} | null;\n\nexport function parseUnitValue(value: string): ParsedUnitValue {\n if (!value) return null;\n \n // Create regex pattern from allowed units\n const unitsPattern = ALLOWED_UNITS.join('|');\n const regex = new RegExp(`^(-?\\\\d*\\\\.?\\\\d+)(${unitsPattern})?$`);\n const match = value.match(regex);\n if (!match) return null;\n \n const number = parseFloat(match[1]);\n const unit = match[2] ? (match[2] as 'px' | 'rem' | '%' | 'em' | 'ch') : null; // Keep unitless values as null\n \n if (isNaN(number)) return null;\n \n return { number, unit };\n}\n\nexport function toAlternateUnitValue(numberVal: number, unitType: 'px' | 'rem' | '%' | 'em' | 'ch' | null): ParsedUnitValue {\n if (unitType === 'px') {\n let floatValue = parseFloat(`${numberVal / 16}`);\n if (!isNaN(floatValue)) {\n return {\n unit: 'rem',\n number: parseFloat(floatValue.toFixed(4))\n }\n }\n } else if (unitType === 'rem') {\n const intValue = parseInt(`${numberVal * 16}`);\n if (!isNaN(intValue)) {\n return {\n unit: 'px',\n number: intValue\n }\n }\n }\n // For other units (%, em, ch) and unitless values, no alternate unit conversion available\n // These units are context-dependent and don't have standard conversion ratios\n return null;\n}", "//stylelint-sds/packages/stylelint-plugin-slds/src/utils/color-lib-utils.ts\nimport { ValueToStylingHooksMapping, ValueToStylingHookEntry } from '@salesforce-ux/sds-metadata';\nimport chroma from 'chroma-js';\nimport { generate } from '@eslint/css-tree';\nimport { isCssColorFunction } from './css-functions';\n\nconst LAB_THRESHOLD = 25; // Adjust this to set how strict the matching should be\n\nconst isHardCodedColor = (color: string): boolean => {\n const colorRegex =\n /\\b(rgb|rgba)\\((\\s*\\d{1,3}\\s*,\\s*){2,3}\\s*(0|1|0?\\.\\d+)\\s*\\)|#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})\\b|[a-zA-Z]+/g;\n return colorRegex.test(color);\n};\n\nconst isHexCode = (color: string): boolean => {\n const hexPattern = /^#(?:[0-9a-fA-F]{3}){1,2}$/; // Pattern for #RGB or #RRGGBB\n return hexPattern.test(color);\n};\n\n// Convert a named color or hex code into a hex format using chroma-js\nconst convertToHex = (color: string): string | null => {\n try {\n // Try converting the color using chroma-js, which handles both named and hex colors\n return chroma(color).hex();\n } catch (e) {\n // If chroma can't process the color, it's likely invalid\n return null;\n }\n};\n\n// Find the closest color hook using LAB distance\nconst findClosestColorHook = (\n color: string,\n supportedColors:ValueToStylingHooksMapping,\n cssProperty: string\n): string[] => {\n const returnStylingHooks: string[] = [];\n const closestHooksWithSameProperty: { name: string; distance: number }[] = [];\n const closestHooksWithoutSameProperty: { name: string; distance: number }[] =\n [];\n const closestHooksWithAllProperty: { name: string; distance: number }[] =\n [];\n const labColor = chroma(color).lab();\n\n Object.entries(supportedColors).forEach(([sldsValue, data]) => {\n if (sldsValue && isHexCode(sldsValue)) {\n const hooks = data as ValueToStylingHookEntry[]; // Get the hooks for the sldsValue\n\n hooks.forEach((hook) => {\n const labSupportedColor = chroma(sldsValue).lab();\n const distance = (JSON.stringify(labColor) === JSON.stringify(labSupportedColor)) ? 0\n : chroma.distance(chroma.lab(...labColor), chroma.lab(...labSupportedColor), \"lab\");\n // Check if the hook has the same property\n if (hook.properties.includes(cssProperty)) {\n // Add to same property hooks if within threshold\n if (distance <= LAB_THRESHOLD) {\n closestHooksWithSameProperty.push({ name: hook.name, distance });\n }\n } \n // Check for the universal selector\n else if ( hook.properties.includes(\"*\") ){\n // Add to same property hooks if within threshold\n if (distance <= LAB_THRESHOLD) {\n closestHooksWithAllProperty.push({ name: hook.name, distance });\n }\n }\n else {\n // Add to different property hooks if within threshold\n if (distance <= LAB_THRESHOLD) {\n closestHooksWithoutSameProperty.push({ name: hook.name, distance });\n }\n }\n });\n }\n });\n\n// Group hooks by their priority\nconst closesthookGroups = [\n { hooks: closestHooksWithSameProperty, distance: 0 },\n { hooks: closestHooksWithAllProperty, distance: 0 },\n { hooks: closestHooksWithSameProperty, distance: Infinity }, // For hooks with distance > 0\n { hooks: closestHooksWithAllProperty, distance: Infinity },\n { hooks: closestHooksWithoutSameProperty, distance: Infinity },\n];\n\nfor (const group of closesthookGroups) {\n // Filter hooks based on the distance condition\n const filteredHooks = group.hooks.filter(h => \n group.distance === 0 ? h.distance === 0 : h.distance > 0\n );\n\n if (returnStylingHooks.length < 1 && filteredHooks.length > 0) {\n filteredHooks.sort((a, b) => a.distance - b.distance);\n returnStylingHooks.push(...filteredHooks.slice(0, 5).map((h) => h.name));\n }\n}\n\n\n return Array.from(new Set(returnStylingHooks));\n};\n\n/**\n * This method is usefull to identify all possible css color values.\n * - names colors\n * - 6,8 digit hex\n * - rgb and rgba\n * - hsl and hsla\n */\nconst isValidColor = (val:string):boolean => chroma.valid(val);\n\n/**\n * Extract color value from CSS AST node\n */\nconst extractColorValue = (node: any): string | null => {\n let colorValue: string | null = null;\n \n switch (node.type) {\n case 'Hash':\n colorValue = `#${node.value}`;\n break;\n case 'Identifier':\n colorValue = node.name;\n break;\n case 'Function':\n // Only extract color functions\n if (isCssColorFunction(node.name)) {\n colorValue = generate(node);\n }\n break;\n }\n \n return colorValue && isValidColor(colorValue) ? colorValue : null;\n};\n\nexport { findClosestColorHook, convertToHex, isHexCode, isHardCodedColor, isValidColor, extractColorValue };\n", "//stylelint-sds/packages/stylelint-plugin-slds/src/utils/css-functions.ts\n/**\n * Complete list of CSS functions that should be preserved/recognized\n */\nconst CSS_FUNCTIONS = [\n 'attr',\n 'calc',\n 'color-mix',\n 'conic-gradient',\n 'counter',\n 'cubic-bezier',\n 'linear-gradient',\n 'max',\n 'min',\n 'radial-gradient',\n 'repeating-conic-gradient',\n 'repeating-linear-gradient',\n 'repeating-radial-gradient',\n 'var'\n ];\n \n \n const CSS_MATH_FUNCTIONS = ['calc', 'min', 'max'];\n \n \n const RGB_COLOR_FUNCTIONS = ['rgb', 'rgba', 'hsl', 'hsla'];\n \n /**\n * Regex for matching any CSS function (for general detection)\n * Matches function names within other text\n */\n const cssFunctionsRegex = new RegExp(`(?:${CSS_FUNCTIONS.join('|')})`);\n \n \n const cssFunctionsExactRegex = new RegExp(`^(?:${CSS_FUNCTIONS.join('|')})$`);\n \n \n const cssMathFunctionsRegex = new RegExp(`^(?:${CSS_MATH_FUNCTIONS.join('|')})$`);\n \n export function containsCssFunction(value: string): boolean {\n return cssFunctionsRegex.test(value);\n }\n \n /**\n * Check if a value is exactly a CSS function name\n */\n export function isCssFunction(value: string): boolean {\n return cssFunctionsExactRegex.test(value);\n }\n \n export function isCssMathFunction(value: string): boolean {\n return cssMathFunctionsRegex.test(value);\n }\n \n export function isCssColorFunction(value: string): boolean {\n return RGB_COLOR_FUNCTIONS.includes(value);\n }", "import { \n forEachValue, \n type PositionInfo \n} from './hardcoded-shared-utils';\n\n/**\n * Check if a CSS property should be targeted for linting based on prefixes or explicit targets\n * @param property - The CSS property name to check\n * @param propertyTargets - Array of specific properties to target (empty means target all)\n * @returns true if the property should be targeted\n */\nexport function isTargetProperty(property: string, propertyTargets: string[] = []): boolean {\n if (typeof property !== 'string') return false;\n return property.startsWith('--sds-')\n || property.startsWith('--slds-')\n || property.startsWith('--lwc-')\n || propertyTargets.length === 0\n || propertyTargets.includes(property);\n}\n\n/**\n * CSS Variable information for SLDS variable detection\n */\nexport interface CssVariableInfo {\n name: string; // Variable name: --slds-g-color-surface-1\n hasFallback: boolean; // Whether var() already has a fallback\n}\n\n/**\n * Generic CSS variable extractor that can be customized for different use cases\n * @param node - AST node to extract from\n * @param filter - Function to validate and extract variable information\n * @returns Extracted variable info or null\n */\nfunction extractCssVariable<T>(\n node: any,\n filter: (variableName: string, childrenArray: any[]) => T | null\n): T | null {\n if (!node || node.type !== 'Function' || node.name !== 'var') {\n return null;\n }\n\n if (!node.children) {\n return null;\n }\n\n // Convert children to array and get the first child (variable name)\n const childrenArray = Array.from(node.children);\n if (childrenArray.length === 0) {\n return null;\n }\n \n const firstChild = childrenArray[0] as any;\n if (!firstChild || firstChild.type !== 'Identifier') {\n return null;\n }\n\n const variableName = firstChild.name;\n if (!variableName) {\n return null;\n }\n\n return filter(variableName, childrenArray);\n}\n\n/**\n * Specialized CSS variable traversal for SLDS variables\n * Finds var(--slds-*) functions and reports their fallback status\n */\nexport function forEachSldsVariable(\n valueText: string,\n callback: (variableInfo: CssVariableInfo, positionInfo: PositionInfo) => void\n): void {\n const extractor = (node: any) => extractCssVariable(node, (variableName, childrenArray) => {\n if (!variableName.startsWith('--slds-')) {\n return null;\n }\n\n // Check if there's a fallback (comma separator)\n const hasFallback = childrenArray.some((child: any) => \n child.type === 'Operator' && child.value === ','\n );\n\n return { name: variableName, hasFallback };\n });\n\n forEachValue(valueText, extractor, () => false, callback);\n}\n\n/**\n * Specialized CSS variable traversal for SLDS/SDS namespace detection\n * Finds var(--slds-*) or var(--sds-*) functions in CSS values\n * Note: hasFallback is set to false as it's unused for namespace validation\n */\nexport function forEachNamespacedVariable(\n valueText: string,\n callback: (variableInfo: CssVariableInfo, positionInfo: PositionInfo) => void\n): void {\n const extractor = (node: any) => extractCssVariable(node, (variableName) => {\n // Check for SLDS or SDS namespace\n if (variableName.startsWith('--slds-') || variableName.startsWith('--sds-')) {\n return { name: variableName, hasFallback: false }; // hasFallback unused, but required by interface\n }\n return null;\n });\n\n forEachValue(valueText, extractor, () => false, callback);\n}\n\n/**\n * Specialized CSS variable traversal for LWC variables\n * Finds var(--lwc-*) functions in CSS values and reports their fallback status\n */\nexport function forEachLwcVariable(\n valueText: string,\n callback: (variableInfo: CssVariableInfo, positionInfo: PositionInfo) => void\n): void {\n const extractor = (node: any) => extractCssVariable(node, (variableName, childrenArray) => {\n if (!variableName.startsWith('--lwc-')) {\n return null;\n }\n\n // Check if there's a fallback (comma separator)\n const hasFallback = childrenArray.some((child: any) => \n child.type === 'Operator' && child.value === ','\n );\n\n return { name: variableName, hasFallback };\n });\n\n forEachValue(valueText, extractor, () => false, callback);\n}\n\n/**\n * Format multiple hook suggestions for better readability\n * @param hooks - Array of hook names to format\n * @returns Formatted string with hooks\n */\nexport function formatSuggestionHooks(hooks: string[]): string {\n if (hooks.length === 1) {\n return `${hooks[0]}`;\n }\n\n // Loop through hooks and append each as a numbered list item with line breaks\n return '\\n' + hooks.map((hook, index) => `${index + 1}. ${hook}`).join('\\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-sds-to-slds-hooks'];\nconst { type, description, url, messages } = ruleConfig;\n\nconst sldsPlusStylingHooks = metadata.sldsPlusStylingHooks;\n\n// Generate values to hooks mapping using only global hooks\n// shared hooks are private/ undocumented APIs, so they should not be recommended to customers\n// Ref this thread: https://salesforce-internal.slack.com/archives/C071J0Q3FNV/p1743010620921339?thread_ts=1743009353.385429&cid=C071J0Q3FNV\nconst allSldsHooks = [...sldsPlusStylingHooks.global, ...sldsPlusStylingHooks.component];\n\nconst toSldsToken = (sdsToken: string) => sdsToken.replace('--sds-', '--slds-');\n\nfunction shouldIgnoreDetection(sdsToken: string) {\n // Ignore if entry not found in the list\n return (\n !sdsToken.startsWith('--sds-') || !allSldsHooks.includes(toSldsToken(sdsToken))\n );\n}\n\nexport default {\n meta: {\n type,\n docs: {\n description,\n recommended: true,\n url,\n },\n fixable: 'code',\n messages,\n },\n \n create(context) {\n function reportAndFix(node, oldValue, suggestedMatch) {\n context.report({\n node,\n messageId: 'replaceSdsWithSlds',\n data: { oldValue, suggestedMatch },\n fix(fixer) {\n // For Declaration nodes, use the offset from loc info\n if (node.type === \"Declaration\") {\n const sourceCode = context.sourceCode;\n const fullText = sourceCode.getText();\n const nodeOffset = node.loc.start.offset;\n \n // The property name appears at the start of the Declaration\n const propertyStart = nodeOffset;\n const propertyEnd = propertyStart + oldValue.length;\n \n // Verify we're replacing the right text\n const textAtPosition = fullText.substring(propertyStart, propertyEnd);\n if (textAtPosition === oldValue) {\n return fixer.replaceTextRange([propertyStart, propertyEnd], suggestedMatch);\n }\n }\n \n // For Identifier nodes (inside var() functions), simple replacement works\n return fixer.replaceText(node, suggestedMatch);\n }\n });\n }\n\n return {\n // CSS custom property declarations: --sds-* properties\n \"Declaration[property=/^--sds-/]\"(node) {\n const property = node.property;\n \n if (shouldIgnoreDetection(property)) {\n return;\n }\n\n const suggestedMatch = toSldsToken(property);\n reportAndFix(node, property, suggestedMatch);\n },\n\n // SDS tokens inside var() functions: var(--sds-*)\n \"Function[name='var'] Identifier[name=/^--sds-/]\"(node) {\n const tokenName = node.name;\n \n if (shouldIgnoreDetection(tokenName)) {\n return;\n }\n\n const suggestedMatch = toSldsToken(tokenName);\n reportAndFix(node, tokenName, suggestedMatch);\n }\n };\n },\n} as Rule.RuleModule;\n", "import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata';\nimport ruleMessages from '../../config/rule-messages.yml';\n\nconst ruleConfig = ruleMessages['no-sldshook-fallback-for-lwctoken'];\nconst { type, description, url, messages } = ruleConfig;\n\nconst sldsPlusStylingHooks = metadata.sldsPlusStylingHooks;\n\n// Generate values to hooks mapping using only global hooks\n// shared hooks are private/ undocumented APIs, so they should not be recommended to customers\n// Ref this thread: https://salesforce-internal.slack.com/archives/C071J0Q3FNV/p1743010620921339?thread_ts=1743009353.385429&cid=C071J0Q3FNV\nconst allSldsHooks = [...sldsPlusStylingHooks.global, ...sldsPlusStylingHooks.component];\nconst allSldsHooksSet = new Set(allSldsHooks);\n\n/**\n * Check if using an SLDS hook as fallback for LWC token is unsupported\n */\nfunction hasUnsupportedFallback(lwcToken: string, sldsToken: string): boolean {\n // Convert --sds- to --slds- if needed\n const normalizedSldsToken = sldsToken.replace('--sds-', '--slds-');\n \n return lwcToken.startsWith('--lwc-') \n && normalizedSldsToken.startsWith('--slds-') \n && allSldsHooksSet.has(normalizedSldsToken);\n}\n\nexport default {\n meta: {\n type,\n docs: {\n description,\n recommended: true,\n url,\n },\n messages,\n },\n \n create(context) {\n return {\n // Handle LWC tokens inside var() functions: var(--lwc-*, ...)\n \"Function[name='var'] Identifier[name=/^--lwc-/]\"(node) {\n const lwcToken = node.name;\n \n // Get the var() function node that contains this identifier\n const varFunctionNode = context.sourceCode.getAncestors(node).at(-1);\n if (!varFunctionNode) return;\n \n //access children to find fallback\n const varFunctionChildren = (varFunctionNode as any).children;\n if (!varFunctionChildren) return;\n \n // Find comma operator and the Raw node after it\n let foundComma = false;\n let fallbackRawNode = null;\n \n for (const child of varFunctionChildren) {\n if (child.type === 'Operator' && child.value === ',') {\n foundComma = true;\n continue;\n }\n if (foundComma && child.type === 'Raw') {\n fallbackRawNode = child;\n break;\n }\n }\n \n if (!fallbackRawNode) return;\n \n // Extract SLDS token from the Raw node value\n const fallbackValue = fallbackRawNode.value.trim();\n const varMatch = fallbackValue.match(/var\\(([^,)]+)/);\n if (!varMatch) return;\n \n const sldsToken = varMatch[1];\n \n if (hasUnsupportedFallback(lwcToken, sldsToken)) {\n context.report({\n node,\n messageId: 'unsupportedFallback',\n data: { lwcToken, sldsToken }\n });\n }\n }\n };\n },\n} as Rule.RuleModule;\n", "import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata';\nimport ruleMessages from '../../config/rule-messages.yml';\n\nconst ruleConfig = ruleMessages['no-unsupported-hooks-slds2'];\nconst { type, description, url, messages } = ruleConfig;\n\nconst deprecatedHooks = new Set(metadata.deprecatedStylingHooks);\n\nfunction shouldIgnoreDetection(sldsHook: string): boolean {\n return !deprecatedHooks.has(sldsHook);\n}\n\nexport default {\n meta: {\n type,\n docs: {\n description,\n recommended: true,\n url,\n },\n messages,\n },\n \n create(context) {\n function reportDeprecatedHook(node, token: string) {\n context.report({\n node,\n messageId: 'deprecated',\n data: { token }\n });\n }\n\n return {\n // Handle CSS custom property declarations (left-side usage): --slds-* properties\n // Example: .THIS { --slds-g-link-color: #f73650; }\n \"Declaration[property=/^--s(lds|ds)-/]\"(node) {\n const property = node.property;\n \n if (shouldIgnoreDetection(property)) {\n return;\n }\n \n reportDeprecatedHook(node, property);\n },\n\n // Handle SLDS/SDS hooks inside var() functions (right-side usage): var(--slds-*)\n // Example: .THIS .demo { border-top: 1px solid var(--slds-g-color-border-brand-1); }\n \"Function[name='var'] Identifier[name=/^--s(lds|ds)-/]\"(node) {\n const tokenName = node.name;\n \n if (shouldIgnoreDetection(tokenName)) {\n return;\n }\n \n reportDeprecatedHook(node, tokenName);\n },\n };\n },\n} as Rule.RuleModule;\n", "import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata';\nimport ruleMessages from '../../config/rule-messages.yml';\nimport { forEachSldsVariable, type CssVariableInfo } from '../../utils/css-utils';\nimport type { PositionInfo } from '../../utils/hardcoded-shared-utils';\n\nconst ruleConfig = ruleMessages['no-slds-var-without-fallback'];\nconst { type, description, url, messages } = ruleConfig;\n\n// Access the slds1ExcludedVars property from metadata\nconst sldsVariables = metadata.slds1ExcludedVars || {};\n\n/**\n * ESLint rule to detect SLDS variables used without fallback values\n * Uses CSS AST parsing for consistent detection across all CSS contexts\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 \"Declaration\"(node) {\n const valueText = context.sourceCode.getText(node.value);\n if (!valueText) return;\n\n const variablesNeedingFallback: Array<{\n cssVar: string;\n fallbackValue: string;\n start: number;\n end: number;\n }> = [];\n\n // Use AST parsing to find all SLDS variables\n forEachSldsVariable(valueText, (variableInfo: CssVariableInfo, positionInfo: PositionInfo) => {\n const { name: cssVar, hasFallback } = variableInfo;\n \n if (hasFallback) return; // Skip if variable already has a fallback\n \n const fallbackValue = sldsVariables[cssVar];\n if (!fallbackValue) return; // No fallback available in metadata\n \n variablesNeedingFallback.push({\n cssVar,\n fallbackValue,\n start: positionInfo.start?.offset || 0,\n end: positionInfo.end?.offset || 0\n });\n });\n\n // Report violations with combined fix\n if (variablesNeedingFallback.length > 0) {\n // Create combined fix for all variables\n let newValue = valueText;\n const sortedVariables = variablesNeedingFallback.sort((a, b) => b.start - a.start);\n \n sortedVariables.forEach(({ cssVar, fallbackValue, start, end }) => {\n const replacement = `var(${cssVar}, ${fallbackValue})`;\n newValue = newValue.substring(0, start) + replacement + newValue.substring(end);\n });\n\n // Report each variable separately but with the same combined fix\n variablesNeedingFallback.forEach(({ cssVar, fallbackValue }) => {\n context.report({\n node,\n messageId: 'varWithoutFallback',\n data: { cssVar, recommendation: fallbackValue },\n fix: (fixer) => fixer.replaceText(node.value, newValue)\n });\n });\n }\n }\n };\n },\n} as Rule.RuleModule;\n", "import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata';\nimport ruleMessages from '../../config/rule-messages.yml';\nimport { forEachNamespacedVariable, type CssVariableInfo } from '../../utils/css-utils';\nimport type { PositionInfo } from '../../utils/hardcoded-shared-utils';\n\nconst ruleConfig = ruleMessages['no-slds-namespace-for-custom-hooks'];\nconst { type, description, url, messages } = ruleConfig;\n\nconst sldsPlusStylingHooks = metadata.sldsPlusStylingHooks;\n\n// Generate values to hooks mapping using only global hooks\n// shared hooks are private/ undocumented APIs, so they should not be recommended to customers\n// Ref this thread: https://salesforce-internal.slack.com/archives/C071J0Q3FNV/p1743010620921339?thread_ts=1743009353.385429&cid=C071J0Q3FNV\n// Note: kinetics hooks available but excluded due to TypeScript type mismatch (type says 'kinetic', runtime has 'kinetics')\nconst allSldsHooks = [...sldsPlusStylingHooks.global, ...sldsPlusStylingHooks.component, ...sldsPlusStylingHooks.shared];\n\nconst toSldsToken = (sdsToken: string) => sdsToken.replace('--sds-', '--slds-');\n\nfunction shouldIgnoreDetection(sdsToken: string): boolean {\n // Ignore if entry found in the list or not starts with reserved namespace\n if (sdsToken.startsWith('--sds-') || sdsToken.startsWith('--slds-')) {\n return allSldsHooks.includes(toSldsToken(sdsToken));\n }\n return true;\n}\n\nexport default {\n meta: {\n type,\n docs: {\n description,\n recommended: true,\n url,\n },\n messages,\n },\n \n create(context) {\n return {\n \"Declaration\"(node) {\n // Check 1: Property name (left-side) for custom properties using reserved namespaces\n const property = node.property;\n if (property && \n (property.startsWith('--slds-') || property.startsWith('--sds-')) &&\n !shouldIgnoreDetection(property)) {\n const tokenWithoutNamespace = property.replace('--slds-', '').replace('--sds-', '');\n \n // Report at the property location (before the colon)\n context.report({\n node,\n loc: node.loc, // Use full declaration loc which includes the property\n messageId: 'customHookNamespace',\n data: { \n token: property,\n tokenWithoutNamespace\n }\n });\n }\n\n // Check 2: Property value (right-side) - Use AST parsing to detect var() functions\n const valueText = context.sourceCode.getText(node.value);\n if (valueText) {\n forEachNamespacedVariable(valueText, (variableInfo: CssVariableInfo, positionInfo: PositionInfo) => {\n const { name: tokenName } = variableInfo;\n \n if (!shouldIgnoreDetection(tokenName)) {\n const tokenWithoutNamespace = tokenName.replace('--slds-', '').replace('--sds-', '');\n \n // Use exact position if available, otherwise report on declaration node\n if (positionInfo.start && positionInfo.end && node.value.loc) {\n context.report({\n node,\n loc: {\n start: {\n line: node.value.loc.start.line + positionInfo.start.line - 1,\n column: node.value.loc.start.column + positionInfo.start.column - 1\n },\n end: {\n line: node.value.loc.start.line + positionInfo.end.line - 1,\n column: node.value.loc.start.column + positionInfo.end.column - 1\n }\n },\n messageId: 'customHookNamespace',\n data: { token: tokenName, tokenWithoutNamespace }\n });\n } else {\n context.report({\n node,\n messageId: 'customHookNamespace',\n data: { token: tokenName, tokenWithoutNamespace }\n });\n }\n }\n });\n }\n },\n };\n },\n} as Rule.RuleModule;\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", "import { Rule } from 'eslint';\nimport ruleMessages from '../../config/rule-messages.yml';\n\nconst ruleConfig = ruleMessages['reduce-annotations'];\nconst { type, description, url, messages } = ruleConfig;\n\n// SLDS validator annotations to detect and flag for removal\nconst SLDS_ANNOTATIONS = [\n \"@sldsValidatorIgnoreNextLine\", \n \"@sldsValidatorAllow\", \n \"@sldsValidatorIgnore\"\n];\n\nexport default {\n meta: {\n type,\n docs: {\n description,\n recommended: true,\n url,\n },\n messages,\n },\n \n create(context) {\n return {\n StyleSheet(node) {\n const sourceCode = context.sourceCode;\n \n let comments = (sourceCode as any)?.comments || [];\n\n comments.forEach(comment => {\n const commentContent = comment.value.trim();\n \n const matchingAnnotation = SLDS_ANNOTATIONS.find(annotation => \n commentContent.startsWith(annotation)\n );\n \n if (matchingAnnotation) {\n context.report({\n node: comment,\n messageId: 'removeAnnotation'\n });\n }\n });\n },\n };\n },\n} as Rule.RuleModule;\n", "import { Rule } from 'eslint';\nimport ruleMessages from '../../config/rule-messages.yml';\n\nconst ruleConfig = ruleMessages['no-slds-private-var'];\nconst { type, description, url, messages } = ruleConfig;\n\nexport default {\n meta: {\n type,\n docs: {\n description,\n recommended: true,\n url,\n },\n fixable: 'code',\n messages\n },\n \n create(context) {\n return {\n // Handle CSS custom properties (declarations starting with --)\n \"Declaration\"(node) {\n // Check if this is a custom property declaration\n if (node.property && typeof node.property === 'string' && node.property.startsWith('--_slds-')) {\n context.report({\n node,\n messageId: 'privateVar',\n data: { prop: node.property },\n fix(fixer) {\n // Auto-fix: replace --_slds- with --slds-\n const newProperty = node.property.replace('--_slds-', '--slds-');\n const sourceCode = context.sourceCode.getText(node);\n const fixedCode = sourceCode.replace(node.property, newProperty);\n return fixer.replaceText(node, fixedCode);\n }\n });\n }\n },\n };\n },\n} as Rule.RuleModule;\n", "import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata';\nimport ruleMessages from '../../../config/rule-messages.yml';\nimport { defineNoHardcodedValueRule } from './noHardcodedValueRule';\n\nconst ruleName = 'no-hardcoded-values-slds1';\nconst ruleConfig = ruleMessages[ruleName];\nconst { type, description, url, messages } = ruleConfig;\n\nconst valueToStylinghook = metadata.valueToStylingHooksSlds;\n\nexport default defineNoHardcodedValueRule({\n ruleConfig,\n valueToStylinghook,\n ruleName,\n}) as Rule.RuleModule;\n\n", "///stylelint-sds/packages/stylelint-plugin-slds/src/utils/property-matcher.ts\n/**\n * Check if any of the hook properties match the provided cssProperty using wildcard matching.\n * @param hookProperties - Array of property patterns (can contain wildcards like `*`)\n * @param cssProperty - The CSS property to be checked\n * @returns true if a match is found, otherwise false\n */\nexport function matchesCssProperty(\n hookProperties: string[],\n cssProperty: string\n): boolean {\n return hookProperties.some((propertyPattern: string) => {\n const regexPattern = new RegExp(\n '^' + propertyPattern.replace(/\\*/g, '.*') + '$'\n );\n return regexPattern.test(cssProperty);\n });\n}\n\n// Directions & Corners\nconst DIRECTION_VALUES = '(?:top|right|bottom|left|inline|block|inline-start|inline-end|start|end|block-start|block-end)';\nconst CORNER_VALUES = '(?:top-left|top-right|bottom-right|bottom-left|start-start|start-end|end-start|end-end)';\nconst INSET_VALUES = '(?:inline|block|inline-start|inline-end|block-start|block-end)';\n\n\n// Pre-compiled regex patterns for better performance\nconst BORDER_COLOR_REGEX = new RegExp(`^border(?:-${DIRECTION_VALUES})?-color$`);\nconst BORDER_WIDTH_REGEX = new RegExp(`^border(?:-${DIRECTION_VALUES})?-width$`);\nconst MARGIN_REGEX = new RegExp(`^margin(?:-${DIRECTION_VALUES})?$`);\nconst PADDING_REGEX = new RegExp(`^padding(?:-${DIRECTION_VALUES})?$`);\nconst BORDER_RADIUS_REGEX = new RegExp(`^border(?:-${CORNER_VALUES})?-radius$`);\nconst INSET_REGEX = new RegExp(`^inset(?:-${INSET_VALUES})?$`);\n\nexport function isBorderColorProperty(cssProperty: string): boolean {\n return BORDER_COLOR_REGEX.test(cssProperty);\n}\n\nexport function isBorderWidthProperty(cssProperty: string): boolean {\n return BORDER_WIDTH_REGEX.test(cssProperty);\n}\n\nexport function isMarginProperty(cssProperty: string): boolean {\n return MARGIN_REGEX.test(cssProperty);\n}\n\nexport function isPaddingProperty(cssProperty: string): boolean {\n return PADDING_REGEX.test(cssProperty);\n}\n\nexport function isBorderRadius(cssProperty: string): boolean {\n return BORDER_RADIUS_REGEX.test(cssProperty);\n}\n\nexport function isDimensionProperty(cssProperty: string): boolean {\n return ['width', 'height', 'min-width', 'max-width', 'min-height', 'max-height'].includes(cssProperty);\n}\n\nexport function isInsetProperty(cssProperty: string): boolean {\n return INSET_REGEX.test(cssProperty);\n}\n\nexport const fontProperties = [\n 'font',\n 'font-size', \n 'font-weight'\n];\n\nexport const colorProperties = [\n 'color',\n 'fill',\n 'background',\n 'background-color',\n 'stroke',\n 'border',\n 'border*',\n 'border*-color',\n 'outline',\n 'outline-color',\n];\n\nexport const densificationProperties = [\n 'border*',\n 'margin*',\n 'padding*',\n 'width',\n 'height',\n 'min-width',\n 'max-width',\n 'min-height',\n 'max-height',\n 'inset',\n 'top',\n 'right',\n 'left',\n 'bottom',\n 'outline',\n 'outline-width',\n 'line-height'\n]; \n\n/**\n * Convert property patterns to CSS AST selector patterns\n * Handles wildcards (*) and creates proper ESLint CSS selector syntax\n */\nexport function toSelector(properties: string[]): string {\n const selectorParts = properties.map(prop => {\n if (prop.includes('*')) {\n // Convert wildcards to regex patterns for CSS AST selectors\n // Anchor to start of string to prevent matching CSS custom properties\n const regexPattern = prop.replace(/\\*/g, '.*');\n return `Declaration[property=/^${regexPattern}$/]`;\n } else {\n // Exact property match\n return `Declaration[property='${prop}']`;\n }\n });\n \n return selectorParts.join(', ');\n}\n\nexport function resolvePropertyToMatch(cssProperty:string){\n const propertyToMatch = cssProperty.toLowerCase();\n if(propertyToMatch === 'outline' || propertyToMatch === 'outline-width' || isBorderWidthProperty(propertyToMatch)){\n return 'border-width';\n } else if(isMarginProperty(propertyToMatch)){\n return 'margin';\n } else if(isPaddingProperty(propertyToMatch)){\n return 'padding';\n } else if(isBorderRadius(propertyToMatch)){\n return 'border-radius';\n } else if(isDimensionProperty(propertyToMatch)){\n // Stylinghooks includes only width as property to match, for all other dimensions we need to match width\n return 'width';\n } else if(isInsetProperty(propertyToMatch)){\n // Stylinghooks includes only top/left/right/bottom as property to match, for all other insets we need to match top\n return 'top';\n } else if(cssProperty === 'background' || cssProperty === 'background-color'){\n return 'background-color';\n } else if(cssProperty === 'outline' || cssProperty === 'outline-color' || isBorderColorProperty(cssProperty)){\n return 'border-color';\n }\n return propertyToMatch;\n}", "import { findClosestColorHook, convertToHex, isValidColor } from '../../../../utils/color-lib-utils';\nimport { resolvePropertyToMatch } from '../../../../utils/property-matcher';\nimport { formatSuggestionHooks } from '../../../../utils/css-utils';\nimport type { HandlerContext, DeclarationHandler } from '../../../../types';\n\n// Import shared utilities for common logic\nimport { \n handleShorthandAutoFix, \n forEachColorValue,\n type ReplacementInfo,\n type PositionInfo\n} from '../../../../utils/hardcoded-shared-utils';\n\n/**\n * Handle color declarations using CSS tree parsing\n * Supports shorthand properties like background, border, etc. \n * Uses css-tree for reliable AST-based parsing + chroma-js validation\n */\nexport const handleColorDeclaration: DeclarationHandler = (node: any, context: HandlerContext) => {\n const cssProperty = node.property.toLowerCase();\n const valueText = context.sourceCode.getText(node.value);\n const replacements: ReplacementInfo[] = [];\n \n forEachColorValue(valueText, (colorValue, positionInfo) => {\n if (colorValue !== 'transparent' && isValidColor(colorValue)) {\n const replacement = createColorReplacement(colorValue, cssProperty, context, positionInfo, valueText);\n if (replacement) {\n replacements.push(replacement);\n }\n }\n });\n \n // Apply shorthand auto-fix once all values are processed\n handleShorthandAutoFix(node, context, valueText, replacements);\n};\n\n\n\n\n\n/**\n * Create color replacement info for shorthand auto-fix\n * Returns replacement data or null if no valid replacement\n */\nfunction createColorReplacement(\n colorValue: string,\n cssProperty: string,\n context: HandlerContext,\n positionInfo: PositionInfo,\n originalValueText?: string\n): ReplacementInfo | null {\n if (!positionInfo?.start) {\n return null;\n }\n\n const hexValue = convertToHex(colorValue);\n if (!hexValue) {\n return null;\n }\n\n const propToMatch = resolvePropertyToMatch(cssProperty);\n const closestHooks = findClosestColorHook(hexValue, context.valueToStylinghook, propToMatch);\n\n // Use position information directly from CSS tree (already 0-based offsets)\n const start = positionInfo.start.offset;\n const end = positionInfo.end.offset;\n \n // Extract the original value from the CSS text to preserve spacing\n const originalValue = originalValueText ? originalValueText.substring(start, end) : colorValue;\n\n if (closestHooks.length === 1) {\n // Has a single hook replacement - should provide autofix\n return {\n start,\n end,\n replacement: `var(${closestHooks[0]}, ${colorValue})`,\n displayValue: closestHooks[0],\n hasHook: true\n };\n } else if (closestHooks.length > 1) {\n // Multiple hooks - format them for better readability\n return {\n start,\n end,\n replacement: originalValue, // Use original value to preserve spacing\n displayValue: formatSuggestionHooks(closestHooks),\n hasHook: true\n };\n } else {\n // No hooks - keep original value\n return {\n start,\n end,\n replacement: originalValue, // Use original value to preserve spacing\n displayValue: originalValue,\n hasHook: false\n };\n }\n}\n\n\n\n\n\n", "import type { ValueToStylingHookEntry, ValueToStylingHooksMapping } from '@salesforce-ux/sds-metadata';\nimport { ParsedUnitValue, parseUnitValue, toAlternateUnitValue } from './value-utils';\n\nfunction isValueMatch(valueToMatch: ParsedUnitValue, sldsValue: ParsedUnitValue): boolean {\n if (!valueToMatch || !sldsValue) {\n return false;\n }\n return valueToMatch.unit == sldsValue.unit && valueToMatch.number === sldsValue.number;\n}\n\n/**\n * Get styling hooks for a density value using structured data from CSS AST\n * Eliminates regex parsing by accepting pre-parsed dimension data\n */\nexport function getStylingHooksForDensityValue(\n parsedValue: ParsedUnitValue,\n supportedStylinghooks: ValueToStylingHooksMapping,\n cssProperty: string\n): string[] {\n if (!parsedValue) return [];\n \n const alternateValue = toAlternateUnitValue(parsedValue.number, parsedValue.unit);\n const matchedHooks = [];\n\n for (const [sldsValue, hooks] of Object.entries(supportedStylinghooks)) {\n // parsing SLDS metadata values\n const parsedSldsValue = parseUnitValue(sldsValue);\n if (isValueMatch(parsedValue, parsedSldsValue) || (alternateValue && isValueMatch(alternateValue, parsedSldsValue))) {\n hooks\n .filter((hook: ValueToStylingHookEntry) => hook.properties.includes(cssProperty))\n .forEach((hook) => matchedHooks.push(hook.name));\n }\n }\n return matchedHooks;\n}", "import { getStylingHooksForDensityValue } from '../../../../utils/styling-hook-utils';\nimport { resolvePropertyToMatch } from '../../../../utils/property-matcher';\nimport { formatSuggestionHooks } from '../../../../utils/css-utils';\nimport type { ParsedUnitValue } from '../../../../utils/value-utils';\nimport type { HandlerContext, DeclarationHandler } from '../../../../types';\n\n\n\n// Import shared utilities for common logic\nimport { \n handleShorthandAutoFix, \n forEachDensityValue,\n type ReplacementInfo,\n type PositionInfo\n} from '../../../../utils/hardcoded-shared-utils';\n\n/**\n * Handle density/sizing declarations using CSS tree parsing\n * Supports shorthand properties like padding, margin, etc.\n * Uses css-tree for reliable AST-based parsing\n */\nexport const handleDensityDeclaration: DeclarationHandler = (node: any, context: HandlerContext) => {\n const cssProperty = node.property.toLowerCase();\n const valueText = context.sourceCode.getText(node.value);\n const replacements: ReplacementInfo[] = [];\n \n forEachDensityValue(valueText, cssProperty, (parsedDimension, positionInfo) => {\n if (parsedDimension) {\n const replacement = createDimensionReplacement(parsedDimension, cssProperty, context, positionInfo);\n if (replacement) {\n replacements.push(replacement);\n }\n }\n });\n \n // Apply shorthand auto-fix once all values are processed\n handleShorthandAutoFix(node, context, valueText, replacements);\n};\n\n\n\n/**\n * Create dimension replacement info for shorthand auto-fix\n * Returns replacement data or null if no valid replacement\n */\nfunction createDimensionReplacement(\n parsedDimension: ParsedUnitValue,\n cssProperty: string,\n context: HandlerContext,\n positionInfo: PositionInfo\n): ReplacementInfo | null {\n if (!parsedDimension || !positionInfo?.start) {\n return null;\n }\n\n const rawValue = parsedDimension.unit \n ? `${parsedDimension.number}${parsedDimension.unit}`\n : parsedDimension.number.toString();\n\n const propToMatch = resolvePropertyToMatch(cssProperty);\n const closestHooks = getStylingHooksForDensityValue(parsedDimension, context.valueToStylinghook, propToMatch);\n\n // Use position information directly from CSS tree (already 0-based offsets)\n const start = positionInfo.start.offset;\n const end = positionInfo.end.offset;\n\n if (closestHooks.length === 1) {\n // Has a single hook replacement\n return {\n start,\n end,\n replacement: `var(${closestHooks[0]}, ${rawValue})`,\n displayValue: closestHooks[0],\n hasHook: true\n };\n } else if (closestHooks.length > 1) {\n // Multiple hooks - still has hooks, but no auto-fix\n return {\n start,\n end,\n replacement: rawValue,\n displayValue: formatSuggestionHooks(closestHooks),\n hasHook: true\n };\n } else {\n // No hook or multiple hooks - keep original value\n return {\n start,\n end,\n replacement: rawValue,\n displayValue: rawValue,\n hasHook: false\n };\n }\n}\n\n\n\n", "import { getStylingHooksForDensityValue } from '../../../../utils/styling-hook-utils';\nimport { resolvePropertyToMatch } from '../../../../utils/property-matcher';\nimport { formatSuggestionHooks } from '../../../../utils/css-utils';\nimport type { ParsedUnitValue } from '../../../../utils/value-utils';\nimport type { HandlerContext, DeclarationHandler } from '../../../../types';\n\n// Import shared utilities for common logic\nimport { \n handleShorthandAutoFix, \n forEachFontValue,\n isKnownFontWeight,\n type ReplacementInfo,\n type PositionInfo\n} from '../../../../utils/hardcoded-shared-utils';\n\n/**\n * Handle font declarations including shorthand property\n * Uses css-tree for reliable AST-based parsing\n */\nexport const handleFontDeclaration: DeclarationHandler = (node: any, context: HandlerContext) => {\n const cssProperty = node.property.toLowerCase();\n const valueText = context.sourceCode.getText(node.value);\n const replacements: ReplacementInfo[] = [];\n \n forEachFontValue(valueText, (fontValue, positionInfo) => {\n if (fontValue && isValidFontValue(fontValue, cssProperty)) {\n const replacement = createFontReplacement(fontValue, cssProperty, context, positionInfo);\n if (replacement) {\n replacements.push(replacement);\n }\n }\n });\n \n // Apply shorthand auto-fix once all values are processed\n handleShorthandAutoFix(node, context, valueText, replacements);\n};\n\n/**\n * Validate font value based on property type or value characteristics for shorthand\n * Only accepts what we explicitly handle in createFontReplacement\n */\nfunction isValidFontValue(fontValue: ParsedUnitValue, cssProperty: string): boolean {\n if (cssProperty === 'font-size') {\n // Font-size: must have units (unitless font-size values are generally invalid in CSS)\n return !!fontValue.unit;\n } else if (cssProperty === 'font-weight') {\n // Font-weight: must be unitless and a known font-weight value\n return !fontValue.unit && isKnownFontWeight(fontValue.number);\n } else if (cssProperty === 'font') {\n // Font shorthand: determine validation based on value characteristics\n if (!fontValue.unit && isKnownFontWeight(fontValue.number)) {\n // This is a font-weight value\n return true;\n } else if (fontValue.unit) {\n // font-size\n return true;\n } else {\n // Unitless value that's not a known font-weight - invalid\n return false;\n }\n }\n \n // For other font properties, reject extracted values\n return false;\n}\n\nfunction createFontReplacement(\n fontValue: ParsedUnitValue,\n cssProperty: string,\n context: HandlerContext,\n positionInfo: PositionInfo\n): ReplacementInfo | null {\n if (!positionInfo?.start) {\n return null;\n }\n\n const rawValue = fontValue.unit \n ? `${fontValue.number}${fontValue.unit}`\n : fontValue.number.toString();\n\n // Font-specific property resolution\n // Font-weight: unitless known font-weight values, otherwise font-size\n const propToMatch = (!fontValue.unit && isKnownFontWeight(fontValue.number)) \n ? resolvePropertyToMatch('font-weight')\n : resolvePropertyToMatch('font-size');\n\n const closestHooks = getStylingHooksForDensityValue(fontValue, context.valueToStylinghook, propToMatch);\n\n // Use position information directly from CSS tree (already 0-based offsets)\n const start = positionInfo.start.offset;\n const end = positionInfo.end.offset;\n\n if (closestHooks.length === 1) {\n // Has a single hook replacement - should provide autofix\n return {\n start,\n end,\n replacement: `var(${closestHooks[0]}, ${rawValue})`,\n displayValue: closestHooks[0],\n hasHook: true\n };\n } else if (closestHooks.length > 1) {\n // Multiple hooks - still has hooks, but no auto-fix\n return {\n start,\n end,\n replacement: rawValue,\n displayValue: formatSuggestionHooks(closestHooks),\n hasHook: true\n };\n } else {\n // No hooks - keep original value\n return {\n start,\n end,\n replacement: rawValue,\n displayValue: rawValue,\n hasHook: false\n };\n }\n}\n\n", "import { parse, walk, generate } from '@eslint/css-tree';\nimport { isValidColor } from './color-lib-utils';\nimport { parseUnitValue, type ParsedUnitValue } from './value-utils';\nimport { isCssColorFunction } from './css-functions';\n\nexport interface BoxShadowValue {\n offsetX?: string;\n offsetY?: string;\n blurRadius?: string;\n spreadRadius?: string;\n color?: string;\n inset?: boolean;\n}\n\ninterface ShadowParts {\n lengthParts: string[];\n colorParts: string[];\n inset: boolean;\n}\n\n/**\n * Check if a CSS tree node represents a color value\n */\nfunction isColorValue(node: any): boolean {\n if (!node) return false;\n \n switch (node.type) {\n case 'Hash':\n return true; // #hex colors\n case 'Identifier':\n return isValidColor(node.name);\n case 'Function':\n return isCssColorFunction(node.name.toLowerCase());\n default:\n return false;\n }\n}\n\n/**\n * Check if a CSS tree node represents a length value\n */\nfunction isLengthValue(node: any): boolean {\n if (!node) return false;\n \n switch (node.type) {\n case 'Dimension':\n // Use existing unit parsing to validate the unit\n const dimensionStr = `${node.value}${node.unit}`;\n return parseUnitValue(dimensionStr) !== null;\n case 'Number':\n // Zero values without units are valid lengths\n return Number(node.value) === 0;\n default:\n return false;\n }\n}\n\n/**\n * Check if a CSS tree node represents the 'inset' keyword\n */\nfunction isInsetKeyword(node: any): boolean {\n return node?.type === 'Identifier' && node.name.toLowerCase() === 'inset';\n}\n\n/**\n * Extract shadow parts from CSS tree nodes\n */\nfunction extractShadowParts(valueText: string): ShadowParts[] {\n const shadows: ShadowParts[] = [];\n let currentShadow: ShadowParts = {\n lengthParts: [],\n colorParts: [],\n inset: false\n };\n\n try {\n const ast = parse(valueText, { context: 'value' as const });\n \n walk(ast, {\n enter(node: any) {\n // Skip nested function content for now\n if (node.type === 'Function') {\n return this.skip;\n }\n \n if (isInsetKeyword(node)) {\n currentShadow.inset = true;\n } else if (isLengthValue(node)) {\n currentShadow.lengthParts.push(generate(node));\n } else if (isColorValue(node)) {\n currentShadow.colorParts.push(generate(node));\n }\n }\n });\n \n // Add the current shadow if it has any content\n if (currentShadow.lengthParts.length > 0 || currentShadow.colorParts.length > 0 || currentShadow.inset) {\n shadows.push(currentShadow);\n }\n \n } catch (error) {\n return [];\n }\n\n return shadows;\n}\n\n/**\n * Parse box-shadow value into structured format\n * Simplified version for ESLint v9 compatibility\n */\nexport function parseBoxShadowValue(value: string): BoxShadowValue[] {\n // Handle multiple shadows separated by commas\n const shadowStrings = value.split(',').map(s => s.trim());\n const allShadows: BoxShadowValue[] = [];\n \n for (const shadowString of shadowStrings) {\n const shadows = extractShadowParts(shadowString);\n \n const parsedShadows = shadows.map((shadow) => {\n /**\n * Box-shadow syntax:\n * Two, three, or four <length> values:\n * - offset-x offset-y [blur-radius] [spread-radius]\n * Optionally: inset keyword and color value\n */\n const shadowValue: BoxShadowValue = {};\n \n // Map length parts to shadow properties\n const lengthProps = ['offsetX', 'offsetY', 'blurRadius', 'spreadRadius'] as const;\n lengthProps.forEach((prop, index) => {\n if (shadow.lengthParts.length > index) {\n shadowValue[prop] = shadow.lengthParts[index];\n }\n });\n \n // Add color if present\n if (shadow.colorParts.length > 0) {\n shadowValue.color = shadow.colorParts[0];\n }\n \n // Add inset flag if present\n if (shadow.inset) {\n shadowValue.inset = true;\n }\n \n return shadowValue;\n });\n \n allShadows.push(...parsedShadows);\n }\n \n return allShadows;\n}\n\n/**\n * Normalize length value for comparison\n */\nfunction normalizeLengthValue(value: string | undefined): string {\n if (!value) return '0px';\n if (value === '0') return '0px';\n return value;\n}\n\n/**\n * Check if two parsed box-shadow values match\n */\nexport function isBoxShadowMatch(parsedCssValue: BoxShadowValue[], parsedValueHook: BoxShadowValue[]): boolean {\n // If the number of shadows doesn't match, they're not equal\n if (parsedCssValue.length !== parsedValueHook.length) {\n return false;\n }\n\n // Compare each shadow in the array\n for (let i = 0; i < parsedCssValue.length; i++) {\n const cssShadow = parsedCssValue[i];\n const hookShadow = parsedValueHook[i];\n\n // Compare color and inset properties\n if (cssShadow.color !== hookShadow.color || cssShadow.inset !== hookShadow.inset) {\n return false;\n }\n\n // Compare length properties\n const lengthProps = ['offsetX', 'offsetY', 'blurRadius', 'spreadRadius'] as const;\n for (const prop of lengthProps) {\n if (normalizeLengthValue(cssShadow[prop]) !== normalizeLengthValue(hookShadow[prop])) {\n return false;\n }\n }\n }\n\n return true;\n}\n", "import type { HandlerContext, DeclarationHandler } from '../../../../types';\nimport type { ValueToStylingHooksMapping } from '@salesforce-ux/sds-metadata';\nimport { parseBoxShadowValue, isBoxShadowMatch, type BoxShadowValue } from '../../../../utils/boxShadowValueParser';\nimport { formatSuggestionHooks } from '../../../../utils/css-utils';\n\n// Import shared utilities for common logic\nimport { \n handleShorthandAutoFix, \n type ReplacementInfo,\n type PositionInfo\n} from '../../../../utils/hardcoded-shared-utils';\n\n/**\n * Convert CSS value to parsed box-shadow values, filtering out empty ones\n */\nfunction toBoxShadowValue(cssValue: string): BoxShadowValue[] | null {\n const parsedCssValue = parseBoxShadowValue(cssValue).filter((shadow) => Object.keys(shadow).length > 0);\n if (parsedCssValue.length === 0) {\n return null;\n }\n return parsedCssValue;\n}\n\n/**\n * Extract box-shadow hook entries from styling hooks mapping\n */\nfunction shadowValueToHookEntries(supportedStylinghooks: ValueToStylingHooksMapping): Array<[string, string[]]> {\n return Object.entries(supportedStylinghooks).filter(([key, value]) => {\n return value.some((hook) => hook.properties.includes('box-shadow'));\n }).map(([key, value]) => {\n return [key, value.map((hook) => hook.name)];\n });\n}\n\n/**\n * Handle box-shadow declarations using CSS tree parsing\n */\nexport const handleBoxShadowDeclaration: DeclarationHandler = (node: any, context: HandlerContext) => {\n const cssProperty = node.property.toLowerCase();\n const valueText = context.sourceCode.getText(node.value);\n \n const shadowHooks = shadowValueToHookEntries(context.valueToStylinghook);\n \n const parsedCssValue = toBoxShadowValue(valueText);\n if (!parsedCssValue) {\n return;\n }\n\n // Look for matching hooks\n for (const [shadow, closestHooks] of shadowHooks) {\n const parsedValueHook = toBoxShadowValue(shadow);\n if (parsedValueHook && isBoxShadowMatch(parsedCssValue, parsedValueHook)) {\n if (closestHooks.length > 0) {\n // Create position info for the entire box-shadow value\n const positionInfo: PositionInfo = {\n start: { offset: 0, line: 1, column: 1 },\n end: { offset: valueText.length, line: 1, column: valueText.length + 1 }\n };\n \n const replacement = createBoxShadowReplacement(\n valueText,\n closestHooks,\n context,\n positionInfo\n );\n \n if (replacement) {\n const replacements: ReplacementInfo[] = [replacement];\n // Apply shorthand auto-fix when we have replacements to report\n handleShorthandAutoFix(node, context, valueText, replacements);\n }\n }\n return;\n }\n }\n \n // If no hooks found, silently ignore - don't report any violations\n};\n\n\n/**\n * Create box-shadow replacement info for shorthand auto-fix\n * Only called when hooks are available (hooks.length > 0)\n * Returns replacement data or null if invalid position info\n */\nfunction createBoxShadowReplacement(\n originalValue: string,\n hooks: string[],\n context: HandlerContext,\n positionInfo: PositionInfo\n): ReplacementInfo | null {\n if (!positionInfo?.start) {\n return null;\n }\n\n // Use position information directly from CSS tree (already 0-based offsets)\n const start = positionInfo.start.offset;\n const end = positionInfo.end.offset;\n\n if (hooks.length === 1) {\n // Has a single hook replacement - should provide autofix\n return {\n start,\n end,\n replacement: `var(${hooks[0]}, ${originalValue})`,\n displayValue: hooks[0],\n hasHook: true\n };\n } else {\n // Multiple hooks - still has hooks, but no auto-fix\n return {\n start,\n end,\n replacement: originalValue,\n displayValue: formatSuggestionHooks(hooks),\n hasHook: true\n };\n }\n}\n", "import { Rule } from 'eslint';\n\n/**\n * Check if a specific ESLint rule is enabled in the current configuration\n * @param context - ESLint rule context\n * @param ruleName - rule name\n * @returns true if the rule is enabled, false otherwise\n */\nexport function isRuleEnabled(context: Rule.RuleContext, ruleName: string): boolean {\n try {\n // get rules from context settings\n const rules: Record<string, any> = (context.settings?.sldsRules as Record<string, any>) || {};\n \n if (ruleName in rules) {\n const ruleConfig = rules[ruleName];\n \n if (Array.isArray(ruleConfig)) {\n return ruleConfig[0] === true;\n } else if (ruleConfig !== undefined && ruleConfig !== null) {\n return true;\n } else if (ruleConfig === false) {\n return false;\n }\n }\n } catch (error) {\n return false;\n }\n}\n", "import { Rule } from 'eslint';\n\nimport { \n handleColorDeclaration, \n handleDensityDeclaration,\n handleFontDeclaration,\n handleBoxShadowDeclaration\n} from './handlers/index';\nimport { colorProperties, densificationProperties, fontProperties, toSelector } from '../../../utils/property-matcher';\nimport { isRuleEnabled } from '../../../utils/rule-utils';\nimport type { RuleConfig, HandlerContext } from '../../../types';\n\n\n\n/**\n * Creates the shared no-hardcoded-value rule implementation for ESLint v9\n * Supports color, density, and font properties including font shorthand\n * Uses property-matcher.ts to ensure comprehensive coverage without missing properties\n * Complex cases like box-shadow will be handled in future iterations\n */\nexport function defineNoHardcodedValueRule(config: RuleConfig & { ruleName?: string }): Rule.RuleModule {\n const { ruleConfig, ruleName } = config;\n const { type, description, url, messages } = ruleConfig;\n\n return {\n meta: {\n type,\n docs: {\n description,\n recommended: true,\n url,\n },\n fixable: 'code',\n messages,\n },\n \n create(context) {\n if (ruleName === 'no-hardcoded-values-slds1' && \n isRuleEnabled(context, '@salesforce-ux/slds/no-hardcoded-values-slds2')) {\n return {};\n }\n\n // Create handler context\n const handlerContext: HandlerContext = {\n valueToStylinghook: config.valueToStylinghook,\n context,\n sourceCode: context.sourceCode\n };\n \n const colorOnlySelector = toSelector(colorProperties);\n const densityOnlySelector = toSelector(densificationProperties);\n const fontDensitySelector = toSelector(fontProperties);\n\n // Find overlapping properties that need both handlers\n // This includes exact matches and wildcard pattern matches\n const overlappingProperties = colorProperties.filter(colorProp => {\n return densificationProperties.some(densityProp => {\n if (densityProp === colorProp) {\n return true; // Exact match\n }\n if (densityProp.includes('*')) {\n // Check if colorProp matches the wildcard pattern\n const regexPattern = new RegExp('^' + densityProp.replace(/\\*/g, '.*') + '$');\n return regexPattern.test(colorProp);\n }\n return false;\n });\n });\n const overlappingSet = new Set(overlappingProperties);\n \n // Create property lists excluding overlaps to avoid triple processing\n const colorOnlyProps = colorProperties.filter(prop => !overlappingSet.has(prop));\n const densityOnlyProps = densificationProperties.filter(prop => !overlappingSet.has(prop));\n \n // Define CSS AST selectors and their handlers\n const visitors: Record<string, (node: any) => void> = {};\n \n // Color-only properties (excluding overlaps)\n if (colorOnlyProps.length > 0) {\n const colorOnlySelector = toSelector(colorOnlyProps);\n visitors[colorOnlySelector] = (node: any) => {\n handleColorDeclaration(node, handlerContext);\n };\n }\n\n // Density-only properties (excluding overlaps)\n if (densityOnlyProps.length > 0) {\n const densityOnlySelector = toSelector(densityOnlyProps);\n visitors[densityOnlySelector] = (node: any) => {\n handleDensityDeclaration(node, handlerContext);\n };\n }\n \n // Font shorthand property, Font density properties (font-size, font-weight)\n visitors[fontDensitySelector] = (node: any) => {\n handleFontDeclaration(node, handlerContext);\n };\n \n // Box-shadow property - special case requiring complete value matching\n visitors['Declaration[property=\"box-shadow\"]'] = (node: any) => {\n handleBoxShadowDeclaration(node, handlerContext);\n };\n\n // For overlapping properties, run both handlers\n if (overlappingProperties.length > 0) {\n const overlappingSelector = toSelector(overlappingProperties);\n visitors[overlappingSelector] = (node: any) => {\n handleColorDeclaration(node, handlerContext);\n handleDensityDeclaration(node, handlerContext);\n };\n }\n\n return visitors;\n }\n };\n}", "import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata';\nimport ruleMessages from '../../../config/rule-messages.yml';\nimport { defineNoHardcodedValueRule } from './noHardcodedValueRule';\n \nconst ruleName = 'no-hardcoded-values-slds2';\nconst ruleConfig = ruleMessages[ruleName];\nconst { type, description, url, messages } = ruleConfig;\n\nconst valueToStylinghook = metadata.valueToStylingHooksCosmos;\n\nexport default defineNoHardcodedValueRule({\n ruleConfig,\n valueToStylinghook,\n ruleName,\n}) as Rule.RuleModule;\n\n", "{\n \"css\": {\n \"@salesforce-ux/slds/no-slds-class-overrides\": \"warn\",\n \"@salesforce-ux/slds/no-deprecated-slds-classes\": \"warn\",\n \"@salesforce-ux/slds/lwc-token-to-slds-hook\": \"error\",\n \"@salesforce-ux/slds/enforce-sds-to-slds-hooks\": \"warn\",\n \"@salesforce-ux/slds/no-sldshook-fallback-for-lwctoken\": \"warn\",\n \"@salesforce-ux/slds/no-unsupported-hooks-slds2\": \"warn\",\n \"@salesforce-ux/slds/no-slds-var-without-fallback\": \"warn\",\n \"@salesforce-ux/slds/no-slds-namespace-for-custom-hooks\": \"warn\",\n \"@salesforce-ux/slds/enforce-component-hook-naming-convention\": \"error\",\n \"@salesforce-ux/slds/no-slds-private-var\": \"warn\",\n \"@salesforce-ux/slds/no-hardcoded-values-slds2\": \"warn\",\n \"@salesforce-ux/slds/reduce-annotations\": \"warn\"\n },\n \"html\": { \n \"@salesforce-ux/slds/enforce-bem-usage\": \"error\",\n \"@salesforce-ux/slds/no-deprecated-classes-slds2\": \"error\",\n \"@salesforce-ux/slds/modal-close-button-issue\": \"error\"\n }\n}"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,SAAS,SAAS,MAAM,KAAK;AAC3B,SAAO,KAAK,WAAW;AAAA,IACrB,CAAC,SAAS,KAAK,OAAO,KAAK,IAAI,MA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gB;",
|
|
6
|
+
"names": ["exports", "module", "ruleMessages", "metadata", "exports", "module", "import_sds_metadata", "import_rule_messages", "bemMapping", "metadata", "deprecatedClasses", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "enforceBemUsage", "exports", "module", "import_sds_metadata", "import_rule_messages", "deprecatedClasses", "metadata", "ruleConfig", "ruleMessages", "exports", "module", "import_rule_messages", "ruleConfig", "ruleMessages", "import_sds_metadata", "import_rule_messages", "ruleMessages", "metadata", "import_sds_metadata", "import_rule_messages", "type", "description", "url", "messages", "ruleMessages", "metadata", "import_sds_metadata", "import_rule_messages", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "metadata", "shouldIgnoreDetection", "import_sds_metadata", "import_rule_messages", "import_css_tree", "chroma", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "metadata", "type", "description", "url", "messages", "import_sds_metadata", "import_rule_messages", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "metadata", "shouldIgnoreDetection", "import_sds_metadata", "import_rule_messages", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "sldsPlusStylingHooks", "metadata", "allSldsHooks", "import_sds_metadata", "import_rule_messages", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "metadata", "shouldIgnoreDetection", "import_sds_metadata", "import_rule_messages", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "metadata", "import_sds_metadata", "import_rule_messages", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "sldsPlusStylingHooks", "metadata", "allSldsHooks", "toSldsToken", "shouldIgnoreDetection", "import_sds_metadata", "import_rule_messages", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "metadata", "shouldIgnoreDetection", "import_rule_messages", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "import_rule_messages", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "import_sds_metadata", "import_rule_messages", "import_css_tree", "ruleName", "rules", "ruleConfig", "ruleConfig", "ruleName", "type", "description", "url", "messages", "colorOnlySelector", "densityOnlySelector", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "metadata", "import_sds_metadata", "import_rule_messages", "ruleName", "ruleConfig", "ruleMessages", "type", "description", "url", "messages", "valueToStylinghook", "metadata", "import_parser", "enforceBemUsage", "noDeprecatedClassesSlds2", "modalCloseButtonIssue", "cssPlugin", "htmlParser"]
|
|
7
7
|
}
|
package/eslint.config.mjs
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { defineConfig } from "eslint/config";
|
|
2
|
-
import
|
|
3
|
-
import slds from "@salesforce-ux/eslint-plugin-slds";
|
|
2
|
+
import { sldsCssPlugin } from "@salesforce-ux/eslint-plugin-slds";
|
|
4
3
|
|
|
5
4
|
export default defineConfig([
|
|
6
5
|
{
|
|
7
6
|
plugins: {
|
|
8
|
-
|
|
9
|
-
css: cssPlugin
|
|
7
|
+
...sldsCssPlugin()
|
|
10
8
|
},
|
|
11
9
|
extends: ["@salesforce-ux/slds/recommended"]
|
|
12
|
-
//defineConfig() helper helps which config to use internally.
|
|
13
10
|
},
|
|
14
11
|
]);
|