@salesforce-ux/eslint-plugin-slds 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/config/rule-messages.js +9 -17
- package/build/config/rule-messages.js.map +2 -2
- package/build/index.js +2 -4
- package/build/index.js.map +3 -3
- package/build/rules/no-deprecated-classes-slds2.d.ts +4 -3
- package/build/rules/no-deprecated-classes-slds2.js +29 -12
- package/build/rules/no-deprecated-classes-slds2.js.map +3 -3
- package/build/rules/v9/no-deprecated-slds-classes.d.ts +5 -0
- package/build/rules/v9/no-deprecated-slds-classes.js +2 -2
- package/build/rules/v9/no-deprecated-slds-classes.js.map +2 -2
- package/package.json +1 -1
|
@@ -34,19 +34,11 @@ var require_rule_messages = __commonJS({
|
|
|
34
34
|
"yaml-file:rule-messages.yml"(exports2, module2) {
|
|
35
35
|
module2.exports = {
|
|
36
36
|
"no-slds-class-overrides": {
|
|
37
|
-
"description": "Create new custom CSS classes instead of overriding SLDS selectors",
|
|
37
|
+
"description": "Create new custom CSS classes instead of overriding SLDS selectors. For more information, see the Lightning Web Components Developer Guide.",
|
|
38
38
|
"url": "https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-slds-class-overrides",
|
|
39
39
|
"type": "problem",
|
|
40
40
|
"messages": {
|
|
41
|
-
"sldsClassOverride": "Overriding
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
"no-deprecated-slds-classes": {
|
|
45
|
-
"description": "Please replace the deprecated classes with a modern equivalent",
|
|
46
|
-
"url": "https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-deprecated-slds-classes",
|
|
47
|
-
"type": "problem",
|
|
48
|
-
"messages": {
|
|
49
|
-
"deprecatedClass": "The class {{className}} is deprecated and not available in SLDS2. Please update to a supported class."
|
|
41
|
+
"sldsClassOverride": "Overriding {{className}} isn't supported. To differentiate SLDS and custom classes, create a CSS class in your namespace. Examples: myapp-input, myapp-button"
|
|
50
42
|
}
|
|
51
43
|
},
|
|
52
44
|
"no-deprecated-tokens-slds1": {
|
|
@@ -85,15 +77,15 @@ var require_rule_messages = __commonJS({
|
|
|
85
77
|
"changeVariant": "Change the variant attribute value from bare-inverse to bare in <lightning-button-icon> or <lightning-icon>.",
|
|
86
78
|
"removeVariant": "Remove the variant attribute from the <lightning-icon> component inside the <button> element.",
|
|
87
79
|
"ensureButtonClasses": "Add or move slds-button and slds-button_icon to the class attribute of the <button> element or <lightning-button-icon> component.",
|
|
88
|
-
"ensureSizeAttribute": "To size icons properly, set the size attribute
|
|
80
|
+
"ensureSizeAttribute": "To size icons properly, set the size attribute to large in the <lightning-icon> and <lightning-button-icon> components."
|
|
89
81
|
}
|
|
90
82
|
},
|
|
91
83
|
"no-deprecated-classes-slds2": {
|
|
92
|
-
"description": "Replace classes that aren't available with SLDS 2 classes",
|
|
84
|
+
"description": "Replace classes that aren't available with SLDS 2 classes. See lightningdesignsystem.com for more info.",
|
|
93
85
|
"url": "https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-deprecated-classes-slds2",
|
|
94
86
|
"type": "problem",
|
|
95
87
|
"messages": {
|
|
96
|
-
"deprecatedClass": "The class {{className}} isn't available in SLDS 2. Update it to a class supported in SLDS 2. See lightningdesignsystem.com for more
|
|
88
|
+
"deprecatedClass": "The class {{className}} isn't available in SLDS 2. Update it to a class supported in SLDS 2. See lightningdesignsystem.com for more info.",
|
|
97
89
|
"updateToModernClass": "Replace deprecated class with modern equivalent",
|
|
98
90
|
"checkDocumentation": "See lightningdesignsystem.com for SLDS 2 class alternatives"
|
|
99
91
|
}
|
|
@@ -103,7 +95,7 @@ var require_rule_messages = __commonJS({
|
|
|
103
95
|
"url": "https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#lwc-token-to-slds-hook",
|
|
104
96
|
"type": "problem",
|
|
105
97
|
"messages": {
|
|
106
|
-
"errorWithReplacement": "The '{{oldValue}}' design token is deprecated. Replace it with '{{newValue}}'. For more info, see Global Styling Hooks on lightningdesignsystem.com.",
|
|
98
|
+
"errorWithReplacement": "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.",
|
|
107
99
|
"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.",
|
|
108
100
|
"errorWithNoRecommendation": "The '{{oldValue}}' design token is deprecated. For more info, see the New Global Styling Hook Guidance on lightningdesignsystem.com."
|
|
109
101
|
}
|
|
@@ -117,11 +109,11 @@ var require_rule_messages = __commonJS({
|
|
|
117
109
|
}
|
|
118
110
|
},
|
|
119
111
|
"no-unsupported-hooks-slds2": {
|
|
120
|
-
"description": "
|
|
112
|
+
"description": "Replace deprecated --slds styling hooks. See lightningdesignsystem.com for more info.",
|
|
121
113
|
"url": "https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-unsupported-hooks-slds2",
|
|
122
114
|
"type": "problem",
|
|
123
115
|
"messages": {
|
|
124
|
-
"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."
|
|
116
|
+
"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."
|
|
125
117
|
}
|
|
126
118
|
},
|
|
127
119
|
"no-slds-var-without-fallback": {
|
|
@@ -145,7 +137,7 @@ var require_rule_messages = __commonJS({
|
|
|
145
137
|
"url": "https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-slds-private-var",
|
|
146
138
|
"type": "problem",
|
|
147
139
|
"messages": {
|
|
148
|
-
"privateVar": "This styling hook is reserved for internal Salesforce use. Remove the --_slds- or
|
|
140
|
+
"privateVar": "This styling hook is reserved for internal Salesforce use. Remove the --_slds- or --slds-s private variable within selector {{prop}}. For more information, look up private CSS in lightningdesignsystem.com."
|
|
149
141
|
}
|
|
150
142
|
},
|
|
151
143
|
"enforce-component-hook-naming-convention": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["yaml-file:rule-messages.yml", "../../src/config/rule-messages.ts"],
|
|
4
|
-
"sourcesContent": ["module.exports = {\n \"no-slds-class-overrides\": {\n \"description\": \"Create new custom CSS classes instead of overriding SLDS selectors\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-slds-class-overrides\",\n \"type\": \"problem\",\n \"messages\": {\n \"sldsClassOverride\": \"Overriding .{{className}} isn't supported. To differentiate SLDS and custom classes, create a CSS class in your namespace. Examples: myapp-input, myapp-button.\"\n }\n },\n \"no-deprecated-slds-classes\": {\n \"description\": \"Please replace the deprecated classes with a modern equivalent\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-deprecated-slds-classes\",\n \"type\": \"problem\",\n \"messages\": {\n \"deprecatedClass\": \"The class {{className}} is deprecated and not available in SLDS2. Please update to a supported class.\"\n }\n },\n \"no-deprecated-tokens-slds1\": {\n \"description\": \"Update outdated design tokens to SLDS 2 styling hooks with similar values. For more information, see Styling Hooks on lightningdesignsystem.com.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-deprecated-tokens-slds1\",\n \"type\": \"problem\",\n \"messages\": {\n \"deprecatedToken\": \"Consider removing {{oldValue}} or replacing it with {{newValue}}. Set the fallback to {{oldValue}}. For more info, see Styling Hooks on lightningdesignsystem.com.\",\n \"noReplacement\": \"Update outdated design tokens to SLDS 2 styling hooks with similar values. For more information, see Styling Hooks on lightningdesignsystem.com.\"\n }\n },\n \"enforce-sds-to-slds-hooks\": {\n \"description\": \"Convert your existing --sds styling hooks to --slds styling hooks. See lightningdesignsystem.com for more info.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#enforce-sds-to-slds-hooks\",\n \"type\": \"problem\",\n \"messages\": {\n \"replaceSdsWithSlds\": \"Replace {{oldValue}} with {{suggestedMatch}} styling hook.\"\n }\n },\n \"enforce-bem-usage\": {\n \"description\": \"Replace BEM double-dash syntax in class names with single underscore syntax\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#enforce-bem-usage\",\n \"type\": \"problem\",\n \"messages\": {\n \"bemDoubleDash\": \"{{actual}} has been retired. Update it to the new name {{newValue}}.\",\n \"fixBemNaming\": \"Update to correct BEM naming convention\"\n }\n },\n \"modal-close-button-issue\": {\n \"description\": \"Update component attributes or CSS classes for the modal close button to comply with the modal component blueprint\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#modal-close-button-issue\",\n \"type\": \"problem\",\n \"messages\": {\n \"modalCloseButtonIssue\": \"Update component attributes or CSS classes for the modal close button to comply with the modal component blueprint.\",\n \"removeClass\": \"Remove the slds-button_icon-inverse class from the modal close button in components that use the SLDS modal blueprint.\",\n \"changeVariant\": \"Change the variant attribute value from bare-inverse to bare in <lightning-button-icon> or <lightning-icon>.\",\n \"removeVariant\": \"Remove the variant attribute from the <lightning-icon> component inside the <button> element.\",\n \"ensureButtonClasses\": \"Add or move slds-button and slds-button_icon to the class attribute of the <button> element or <lightning-button-icon> component.\",\n \"ensureSizeAttribute\": \"To size icons properly, set the size attribute \u200Cto large in the <lightning-icon> and <lightning-button-icon> components.\"\n }\n },\n \"no-deprecated-classes-slds2\": {\n \"description\": \"Replace classes that aren't available with SLDS 2 classes\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-deprecated-classes-slds2\",\n \"type\": \"problem\",\n \"messages\": {\n \"deprecatedClass\": \"The class {{className}} isn't available in SLDS 2. Update it to a class supported in SLDS 2. See lightningdesignsystem.com for more information.\",\n \"updateToModernClass\": \"Replace deprecated class with modern equivalent\",\n \"checkDocumentation\": \"See lightningdesignsystem.com for SLDS 2 class alternatives\"\n }\n },\n \"lwc-token-to-slds-hook\": {\n \"description\": \"Replace the deprecated --lwc tokens with the latest --slds tokens. See lightningdesignsystem.com for more info.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#lwc-token-to-slds-hook\",\n \"type\": \"problem\",\n \"messages\": {\n \"errorWithReplacement\": \"The '{{oldValue}}' design token is deprecated. Replace it with '{{newValue}}'. For more info, see Global Styling Hooks on lightningdesignsystem.com.\",\n \"errorWithStyleHooks\": \"The '{{oldValue}}' design token is deprecated. Replace it with the SLDS 2 '{{newValue}}' styling hook and set the fallback to '{{oldValue}}'. For more info, see Global Styling Hooks on lightningdesignsystem.com.\",\n \"errorWithNoRecommendation\": \"The '{{oldValue}}' design token is deprecated. For more info, see the New Global Styling Hook Guidance on lightningdesignsystem.com.\"\n }\n },\n \"no-sldshook-fallback-for-lwctoken\": {\n \"description\": \"Avoid using --slds styling hooks as fallback values for --lwc tokens.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-sldshook-fallback-for-lwctoken\",\n \"type\": \"problem\",\n \"messages\": {\n \"unsupportedFallback\": \"Remove the {{sldsToken}} styling hook that is used as a fallback value for {{lwcToken}}.\"\n }\n },\n \"no-unsupported-hooks-slds2\": {\n \"description\": \"Identifies styling hooks that aren't present in SLDS 2. They must be replaced with styling hooks that have a similar effect, or they must be removed.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-unsupported-hooks-slds2\",\n \"type\": \"problem\",\n \"messages\": {\n \"deprecated\": \"The {{token}} styling hook isn't present in SLDS 2 and there's no equivalent replacement. Remove it or replace it with a styling hook with a similar effect.\"\n }\n },\n \"no-slds-var-without-fallback\": {\n \"description\": \"Add fallback values to SLDS styling hooks. The fallback values are used in Salesforce environments where styling hooks are unavailable.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-slds-var-without-fallback\",\n \"type\": \"problem\",\n \"messages\": {\n \"varWithoutFallback\": \"Your code uses the {{cssVar}} styling hook without a fallback value. Styling hooks are unavailable in some Salesforce environments. To render your component correctly in all environments, add this fallback value: var({{cssVar}}, {{recommendation}}). To make this fallback value brand-aware, use a branded design token instead of a static value. See Design Tokens on v1.lightningdesignsystem.com.\"\n }\n },\n \"no-slds-namespace-for-custom-hooks\": {\n \"description\": \"To differentiate custom styling hooks from SLDS styling hooks, create custom styling hooks in your namespace.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-slds-namespace-for-custom-hooks\",\n \"type\": \"problem\",\n \"messages\": {\n \"customHookNamespace\": \"Using the --slds namespace for {{token}} isn't supported. Create the custom styling hook in your namespace. Example: --myapp-{{tokenWithoutNamespace}}\"\n }\n },\n \"no-slds-private-var\": {\n \"description\": \"Some SLDS styling hooks are private and reserved only for internal Salesforce use. Private SLDS styling hooks have prefixes --_slds- and --slds-s-. For more information, look up private CSS in lightningdesignsystem.com.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-slds-private-var\",\n \"type\": \"problem\",\n \"messages\": {\n \"privateVar\": \"This styling hook is reserved for internal Salesforce use. Remove the --_slds- or \u2013slds-s private variable within selector {{prop}}. For more information, look up private CSS in lightningdesignsystem.com.\"\n }\n },\n \"enforce-component-hook-naming-convention\": {\n \"description\": \"Replace component styling hooks that use a deprecated naming convention.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#enforce-component-hook-naming-convention\",\n \"type\": \"problem\",\n \"messages\": {\n \"replace\": \"Replace the deprecated {{oldValue}} component styling hook with {{suggestedMatch}}.\"\n }\n },\n \"no-hardcoded-values-slds1\": {\n \"description\": \"Replace static values with SLDS 1 design tokens. For more information, look up design tokens on lightningdesignsystem.com.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-hardcoded-value\",\n \"type\": \"suggestion\",\n \"messages\": {\n \"hardcodedValue\": \"Replace the {{oldValue}} static value with an SLDS 1 styling hook: {{newValue}}.\",\n \"noReplacement\": \"There's no replacement styling hook for the {{oldValue}} static value. Remove the static value.\"\n }\n },\n \"no-hardcoded-values-slds2\": {\n \"description\": \"Replace static values with SLDS 2 styling hooks. For more information, look up design tokens on lightningdesignsystem.com.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-hardcoded-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 ruleMessages from './rule-messages.yml';\n\nexport default ruleMessages;\n\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;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;AAAA,QACR,YAAY;AAAA,UACV,mBAAmB;AAAA,
|
|
4
|
+
"sourcesContent": ["module.exports = {\n \"no-slds-class-overrides\": {\n \"description\": \"Create new custom CSS classes instead of overriding SLDS selectors. For more information, see the Lightning Web Components Developer Guide.\",\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-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 to 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. See lightningdesignsystem.com for more info.\",\n \"url\": \"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-deprecated-classes-slds2\",\n \"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 info.\",\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 the SLDS 2 '{{newValue}}' styling hook and set the fallback to '{{oldValue}}'. 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\": \"Replace deprecated --slds styling hooks. See lightningdesignsystem.com for more info.\",\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 --slds-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 ruleMessages from './rule-messages.yml';\n\nexport default ruleMessages;\n\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;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;AAAA,QACR,YAAY;AAAA,UACV,mBAAmB;AAAA,UACnB,iBAAiB;AAAA,QACnB;AAAA,MACF;AAAA,MACA,6BAA6B;AAAA,QAC3B,eAAe;AAAA,QACf,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,YAAY;AAAA,UACV,sBAAsB;AAAA,QACxB;AAAA,MACF;AAAA,MACA,qBAAqB;AAAA,QACnB,eAAe;AAAA,QACf,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,YAAY;AAAA,UACV,iBAAiB;AAAA,UACjB,gBAAgB;AAAA,QAClB;AAAA,MACF;AAAA,MACA,4BAA4B;AAAA,QAC1B,eAAe;AAAA,QACf,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,YAAY;AAAA,UACV,yBAAyB;AAAA,UACzB,eAAe;AAAA,UACf,iBAAiB;AAAA,UACjB,iBAAiB;AAAA,UACjB,uBAAuB;AAAA,UACvB,uBAAuB;AAAA,QACzB;AAAA,MACF;AAAA,MACA,+BAA+B;AAAA,QAC7B,eAAe;AAAA,QAC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F;AAAA,MACA,6BAA6B;AAAA,QAC3B,eAAe;AAAA,QACf,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,YAAY;AAAA,UACV,kBAAkB;AAAA,UAClB,iBAAiB;AAAA,QACnB;AAAA,MACF;AAAA,MACA,sBAAsB;AAAA,QACpB,eAAe;AAAA,QACf,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,YAAY;AAAA,UACV,oBAAoB;AAAA,QACtB;AAAA,MACF;AAAA,IACF;AAAA;AAAA;;;AC9IA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAyB;AAEzB,IAAO,wBAAQ,qBAAAC;",
|
|
6
6
|
"names": ["exports", "module", "ruleMessages"]
|
|
7
7
|
}
|
package/build/index.js
CHANGED
|
@@ -30,7 +30,7 @@ var require_eslint_rules = __commonJS({
|
|
|
30
30
|
module2.exports = {
|
|
31
31
|
"css": {
|
|
32
32
|
"@salesforce-ux/slds/no-slds-class-overrides": "warn",
|
|
33
|
-
"@salesforce-ux/slds/no-deprecated-
|
|
33
|
+
"@salesforce-ux/slds/no-deprecated-classes-slds2": "warn",
|
|
34
34
|
"@salesforce-ux/slds/lwc-token-to-slds-hook": "error",
|
|
35
35
|
"@salesforce-ux/slds/enforce-sds-to-slds-hooks": "warn",
|
|
36
36
|
"@salesforce-ux/slds/no-sldshook-fallback-for-lwctoken": "warn",
|
|
@@ -56,7 +56,6 @@ var import_enforce_bem_usage = __toESM(require("./rules/enforce-bem-usage"));
|
|
|
56
56
|
var import_no_deprecated_classes_slds2 = __toESM(require("./rules/no-deprecated-classes-slds2"));
|
|
57
57
|
var import_modal_close_button_issue = __toESM(require("./rules/modal-close-button-issue"));
|
|
58
58
|
var import_no_slds_class_overrides = __toESM(require("./rules/v9/no-slds-class-overrides"));
|
|
59
|
-
var import_no_deprecated_slds_classes = __toESM(require("./rules/v9/no-deprecated-slds-classes"));
|
|
60
59
|
var import_no_deprecated_tokens_slds1 = __toESM(require("./rules/v9/no-deprecated-tokens-slds1"));
|
|
61
60
|
var import_lwc_token_to_slds_hook = __toESM(require("./rules/v9/lwc-token-to-slds-hook"));
|
|
62
61
|
var import_enforce_sds_to_slds_hooks = __toESM(require("./rules/v9/enforce-sds-to-slds-hooks"));
|
|
@@ -77,7 +76,6 @@ var rules = {
|
|
|
77
76
|
"no-deprecated-classes-slds2": import_no_deprecated_classes_slds2.default,
|
|
78
77
|
"modal-close-button-issue": import_modal_close_button_issue.default,
|
|
79
78
|
"no-slds-class-overrides": import_no_slds_class_overrides.default,
|
|
80
|
-
"no-deprecated-slds-classes": import_no_deprecated_slds_classes.default,
|
|
81
79
|
"no-deprecated-tokens-slds1": import_no_deprecated_tokens_slds1.default,
|
|
82
80
|
"lwc-token-to-slds-hook": import_lwc_token_to_slds_hook.default,
|
|
83
81
|
"enforce-sds-to-slds-hooks": import_enforce_sds_to_slds_hooks.default,
|
|
@@ -94,7 +92,7 @@ var rules = {
|
|
|
94
92
|
var plugin = {
|
|
95
93
|
meta: {
|
|
96
94
|
name: "@salesforce-ux/eslint-plugin-slds",
|
|
97
|
-
version: "1.1.
|
|
95
|
+
version: "1.1.1"
|
|
98
96
|
},
|
|
99
97
|
rules,
|
|
100
98
|
configs: {}
|
package/build/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["json-inline:eslint.rules.json", "../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["module.exports = {\n \"css\": {\n \"@salesforce-ux/slds/no-slds-class-overrides\": \"warn\",\n \"@salesforce-ux/slds/no-deprecated-
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,kCAAAA,UAAAC,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA,MACf,OAAO;AAAA,QACL,+CAA+C;AAAA,QAC/C,
|
|
6
|
-
"names": ["exports", "module", "enforceBemUsage", "noDeprecatedClassesSlds2", "modalCloseButtonIssue", "noSldsClassOverrides", "
|
|
4
|
+
"sourcesContent": ["module.exports = {\n \"css\": {\n \"@salesforce-ux/slds/no-slds-class-overrides\": \"warn\",\n \"@salesforce-ux/slds/no-deprecated-classes-slds2\": \"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};", "// 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 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-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"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,kCAAAA,UAAAC,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA,MACf,OAAO;AAAA,QACL,+CAA+C;AAAA,QAC/C,mDAAmD;AAAA,QACnD,8CAA8C;AAAA,QAC9C,iDAAiD;AAAA,QACjD,yDAAyD;AAAA,QACzD,kDAAkD;AAAA,QAClD,oDAAoD;AAAA,QACpD,0DAA0D;AAAA,QAC1D,gEAAgE;AAAA,QAChE,2CAA2C;AAAA,QAC3C,iDAAiD;AAAA,QACjD,0CAA0C;AAAA,MAC5C;AAAA,MACA,QAAQ;AAAA,QACN,yCAAyC;AAAA,QACzC,mDA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AAW,EAAE,GAAG,oBAAAA,QAAY,IAAI;AAAA,EAClC;AACF;AAGA,IAAM,iBAAiB,CAAC,uBAAuB;AAE/C,IAAM,kBAAkB;AAAA;AAAA,EAEtB;AAAA,IACE,OAAO,CAAC,aAAa,UAAU;AAAA,IAC/B,iBAAiB;AAAA,MACf,QAAQ,cAAAC;AAAA,MACR,aAAa;AAAA,MACb,YAAY;AAAA,IACd;AAAA,IACA,SAAS;AAAA,MACP,uBAAuB;AAAA,IACzB;AAAA,IACA,OAAO,oBAAAD,QAAY;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,oBAAAA,QAAY;AAAA,IACnB,QAAQ,cAAAC;AAAA,IACR,eAAe;AAAA,MACb,aAAa;AAAA,MACb,YAAY;AAAA,IACd;AAAA,EACF;AACF,CAAC;AAED,SAAS,gBAAgB;AACvB,SAAO;AAAA,IACL,GAAG,wBAAwB;AAAA,EAC7B;AACF;AAEA,OAAO,UAAU;AACjB,OAAO,QAAQ,gBAAgB;",
|
|
6
|
+
"names": ["exports", "module", "enforceBemUsage", "noDeprecatedClassesSlds2", "modalCloseButtonIssue", "noSldsClassOverrides", "noDeprecatedTokensSlds1", "lwcTokenToSldsHook", "enforceSdsToSldsHooks", "noSldshookFallbackForLwctoken", "noUnsupportedHooksSlds2", "noSldsVarWithoutFallback", "noSldsNamespaceForCustomHooks", "enforceComponentHookNamingConvention", "noSldsPrivateVar", "noHardcodedValuesSlds1", "noHardcodedValuesSlds2", "reduceAnnotations", "cssPlugin", "ruleConfigs", "htmlParser"]
|
|
7
7
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { Rule } from 'eslint';
|
|
2
|
+
declare const noDeprecatedClassesSlds2: {
|
|
2
3
|
meta: {
|
|
3
4
|
type: "problem" | "suggestion" | "layout";
|
|
4
5
|
docs: {
|
|
@@ -10,8 +11,8 @@ declare const _default: {
|
|
|
10
11
|
schema: any[];
|
|
11
12
|
messages: Record<string, string>;
|
|
12
13
|
};
|
|
13
|
-
create(context: any): {
|
|
14
|
+
create(context: any): Rule.NodeListener | {
|
|
14
15
|
Tag: (node: any) => void;
|
|
15
16
|
};
|
|
16
17
|
};
|
|
17
|
-
export =
|
|
18
|
+
export = noDeprecatedClassesSlds2;
|
|
@@ -25,20 +25,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
25
|
var import_node = require("../utils/node");
|
|
26
26
|
var import_sds_metadata = __toESM(require("@salesforce-ux/sds-metadata"));
|
|
27
27
|
var import_rule_messages = __toESM(require("../config/rule-messages"));
|
|
28
|
+
var import_no_deprecated_slds_classes = __toESM(require("./v9/no-deprecated-slds-classes"));
|
|
28
29
|
var deprecatedClasses = import_sds_metadata.default.deprecatedClasses;
|
|
29
30
|
var ruleConfig = import_rule_messages.default["no-deprecated-classes-slds2"];
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
type: ruleConfig.type,
|
|
33
|
-
docs: {
|
|
34
|
-
category: "Best Practices",
|
|
35
|
-
recommended: true,
|
|
36
|
-
description: ruleConfig.description,
|
|
37
|
-
url: ruleConfig.url
|
|
38
|
-
},
|
|
39
|
-
schema: [],
|
|
40
|
-
messages: ruleConfig.messages
|
|
41
|
-
},
|
|
31
|
+
var { type, description, url, messages } = ruleConfig;
|
|
32
|
+
var noDeprecatedClassesSlds2Html = {
|
|
42
33
|
create(context) {
|
|
43
34
|
function check(node) {
|
|
44
35
|
if ((0, import_node.isAttributesEmpty)(node)) {
|
|
@@ -76,4 +67,30 @@ module.exports = {
|
|
|
76
67
|
};
|
|
77
68
|
}
|
|
78
69
|
};
|
|
70
|
+
var noDeprecatedClassesSlds2 = {
|
|
71
|
+
meta: {
|
|
72
|
+
type,
|
|
73
|
+
docs: {
|
|
74
|
+
category: "Best Practices",
|
|
75
|
+
recommended: true,
|
|
76
|
+
description,
|
|
77
|
+
url
|
|
78
|
+
},
|
|
79
|
+
schema: [],
|
|
80
|
+
messages
|
|
81
|
+
},
|
|
82
|
+
create(context) {
|
|
83
|
+
const filename = context.filename || context.getFilename();
|
|
84
|
+
if (filename.endsWith(".css") || filename.endsWith(".scss")) {
|
|
85
|
+
try {
|
|
86
|
+
return import_no_deprecated_slds_classes.default.create(context);
|
|
87
|
+
} catch (error) {
|
|
88
|
+
return {};
|
|
89
|
+
}
|
|
90
|
+
} else {
|
|
91
|
+
return noDeprecatedClassesSlds2Html.create(context);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
module.exports = noDeprecatedClassesSlds2;
|
|
79
96
|
//# sourceMappingURL=no-deprecated-classes-slds2.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/rules/no-deprecated-classes-slds2.ts"],
|
|
4
|
-
"sourcesContent": ["import { Rule } from 'eslint';\nimport { findAttr, isAttributesEmpty } from \"../utils/node\";\nimport metadata from '@salesforce-ux/sds-metadata';\nimport ruleMessages from '../config/rule-messages';\n\nconst deprecatedClasses = metadata.deprecatedClasses;\nconst ruleConfig = ruleMessages['no-deprecated-classes-slds2'];\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AACA,kBAA4C;AAC5C,0BAAqB;AACrB,2BAAyB;
|
|
6
|
-
"names": ["metadata", "ruleMessages"]
|
|
4
|
+
"sourcesContent": ["import { Rule } from 'eslint';\nimport { findAttr, isAttributesEmpty } from \"../utils/node\";\nimport metadata from '@salesforce-ux/sds-metadata';\nimport ruleMessages from '../config/rule-messages';\nimport noDeprecatedSldsClassesCss from './v9/no-deprecated-slds-classes';\n\nconst deprecatedClasses = metadata.deprecatedClasses;\nconst ruleConfig = ruleMessages['no-deprecated-classes-slds2'];\nconst { type, description, url, messages } = ruleConfig;\n\n/**\n * HTML implementation for detecting deprecated SLDS classes in HTML templates.\n * Checks class attributes on HTML elements for deprecated class names.\n */\nconst noDeprecatedClassesSlds2Html = {\n create(context) {\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 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};\n\n// Create a hybrid rule that works for both HTML and CSS\nconst noDeprecatedClassesSlds2 = {\n meta: {\n type,\n docs: {\n category: \"Best Practices\",\n recommended: true,\n description,\n url\n },\n schema: [],\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 noDeprecatedSldsClassesCss.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 noDeprecatedClassesSlds2Html.create(context);\n }\n },\n};\n\nexport = noDeprecatedClassesSlds2;"],
|
|
5
|
+
"mappings": ";;;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AAAA,IACA,QAAQ,CAAC;AAAA,IACT;AAAA,EACF;AAAA,EAEA,OAAO,SAAS;AACd,UAAM,WAAW,QAAQ,YAAY,QAAQ,YAAY;AAGzD,QAAI,SAAS,SAAS,MAAM,KAAK,SAAS,SAAS,OAAO,GAAG;AAG3D,UAAI;AAEF,eAAO,kCAAAC,QAA2B,OAAO,OAAO;AAAA,MAClD,SAAS,OAAO;AAGd,eAAO,CAAC;AAAA,MACV;AAAA,IACF,OAAO;AAEL,aAAO,6BAA6B,OAAO,OAAO;AAAA,IACpD;AAAA,EACF;AACF;AAEA,iBAAS;",
|
|
6
|
+
"names": ["metadata", "ruleMessages", "noDeprecatedSldsClassesCss"]
|
|
7
7
|
}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import { Rule } from 'eslint';
|
|
2
|
+
/**
|
|
3
|
+
* CSS implementation for detecting deprecated SLDS classes in CSS files.
|
|
4
|
+
* Checks class selectors for deprecated class names.
|
|
5
|
+
* Used by the hybrid no-deprecated-classes-slds2 rule for CSS contexts.
|
|
6
|
+
*/
|
|
2
7
|
declare const _default: Rule.RuleModule;
|
|
3
8
|
export default _default;
|
|
@@ -34,7 +34,7 @@ __export(no_deprecated_slds_classes_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(no_deprecated_slds_classes_exports);
|
|
35
35
|
var import_sds_metadata = __toESM(require("@salesforce-ux/sds-metadata"));
|
|
36
36
|
var import_rule_messages = __toESM(require("../../config/rule-messages"));
|
|
37
|
-
var { type, description, url, messages } = import_rule_messages.default["no-deprecated-
|
|
37
|
+
var { type, description, url, messages } = import_rule_messages.default["no-deprecated-classes-slds2"];
|
|
38
38
|
var deprecatedClasses = import_sds_metadata.default.deprecatedClasses;
|
|
39
39
|
var deprecatedClassesSet = new Set(deprecatedClasses);
|
|
40
40
|
var no_deprecated_slds_classes_default = {
|
|
@@ -49,7 +49,7 @@ var no_deprecated_slds_classes_default = {
|
|
|
49
49
|
},
|
|
50
50
|
create(context) {
|
|
51
51
|
return {
|
|
52
|
-
//
|
|
52
|
+
// Check all class selectors for deprecated classes
|
|
53
53
|
"SelectorList Selector ClassSelector"(node) {
|
|
54
54
|
const cssClassSelector = context.sourceCode.getText(node);
|
|
55
55
|
const className = cssClassSelector.substring(1);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/rules/v9/no-deprecated-slds-classes.ts"],
|
|
4
|
-
"sourcesContent": ["import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata';\nimport ruleMessages from '../../config/rule-messages';\n\nconst {type, description, url, messages} = ruleMessages['no-deprecated-
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAAqB;AACrB,2BAAyB;
|
|
4
|
+
"sourcesContent": ["import { Rule } from 'eslint';\nimport metadata from '@salesforce-ux/sds-metadata';\nimport ruleMessages from '../../config/rule-messages';\n\n// Use the same config as the main hybrid rule (no-deprecated-classes-slds2)\nconst { type, description, url, messages } = ruleMessages['no-deprecated-classes-slds2'];\n\nconst deprecatedClasses = metadata.deprecatedClasses;\nconst deprecatedClassesSet = new Set(deprecatedClasses);\n\n/**\n * CSS implementation for detecting deprecated SLDS classes in CSS files.\n * Checks class selectors for deprecated class names.\n * Used by the hybrid no-deprecated-classes-slds2 rule for CSS contexts.\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 // 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"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAAqB;AACrB,2BAAyB;AAGzB,IAAM,EAAE,MAAM,aAAa,KAAK,SAAS,IAAI,qBAAAA,QAAa,6BAA6B;AAEvF,IAAM,oBAAoB,oBAAAC,QAAS;AACnC,IAAM,uBAAuB,IAAI,IAAI,iBAAiB;AAOtD,IAAO,qCAAQ;AAAA,EACb,MAAM;AAAA,IACJ;AAAA,IACA,MAAM;AAAA,MACJ;AAAA,MACA,aAAa;AAAA,MACb;AAAA,IACF;AAAA,IACA;AAAA,EACF;AAAA,EAEA,OAAO,SAAS;AACd,WAAO;AAAA;AAAA,MAEL,sCAAsC,MAAM;AAC1C,cAAM,mBAAmB,QAAQ,WAAW,QAAQ,IAAI;AAGxD,cAAM,YAAY,iBAAiB,UAAU,CAAC;AAG9C,YAAI,aAAa,qBAAqB,IAAI,SAAS,GAAG;AACpD,kBAAQ,OAAO;AAAA,YACb;AAAA,YACA,WAAW;AAAA,YACX,MAAM,EAAE,UAAU;AAAA,UACpB,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["ruleMessages", "metadata"]
|
|
7
7
|
}
|