@salesforce-ux/eslint-plugin-slds 1.0.7 → 1.0.9-internal
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 +62 -0
- package/build/config/rule-messages.d.ts +2 -0
- package/build/config/rule-messages.js +197 -0
- package/build/config/rule-messages.js.map +7 -0
- package/build/index.js +40 -2332
- package/build/index.js.map +4 -4
- package/build/rules/enforce-bem-usage.js +18 -234
- package/build/rules/enforce-bem-usage.js.map +4 -4
- package/build/rules/modal-close-button-issue.js +11 -183
- package/build/rules/modal-close-button-issue.js.map +4 -4
- package/build/rules/no-deprecated-classes-slds2.js +6 -178
- package/build/rules/no-deprecated-classes-slds2.js.map +4 -4
- package/build/rules/v9/enforce-bem-usage.js +3 -163
- package/build/rules/v9/enforce-bem-usage.js.map +4 -4
- package/build/rules/v9/enforce-component-hook-naming-convention.js +3 -163
- package/build/rules/v9/enforce-component-hook-naming-convention.js.map +4 -4
- package/build/rules/v9/enforce-sds-to-slds-hooks.js +3 -163
- package/build/rules/v9/enforce-sds-to-slds-hooks.js.map +4 -4
- package/build/rules/v9/lwc-token-to-slds-hook.js +6 -264
- package/build/rules/v9/lwc-token-to-slds-hook.js.map +4 -4
- package/build/rules/v9/no-deprecated-slds-classes.js +3 -163
- package/build/rules/v9/no-deprecated-slds-classes.js.map +4 -4
- package/build/rules/v9/no-deprecated-tokens-slds1.js +30 -169
- package/build/rules/v9/no-deprecated-tokens-slds1.js.map +4 -4
- package/build/rules/v9/no-hardcoded-values/handlers/boxShadowHandler.js +29 -253
- package/build/rules/v9/no-hardcoded-values/handlers/boxShadowHandler.js.map +4 -4
- package/build/rules/v9/no-hardcoded-values/handlers/colorHandler.js +31 -289
- package/build/rules/v9/no-hardcoded-values/handlers/colorHandler.js.map +4 -4
- package/build/rules/v9/no-hardcoded-values/handlers/densityHandler.js +23 -286
- package/build/rules/v9/no-hardcoded-values/handlers/densityHandler.js.map +4 -4
- package/build/rules/v9/no-hardcoded-values/handlers/fontHandler.js +24 -316
- package/build/rules/v9/no-hardcoded-values/handlers/fontHandler.js.map +4 -4
- package/build/rules/v9/no-hardcoded-values/handlers/index.js +8 -799
- package/build/rules/v9/no-hardcoded-values/handlers/index.js.map +4 -4
- package/build/rules/v9/no-hardcoded-values/no-hardcoded-values-slds1.js +5 -1090
- package/build/rules/v9/no-hardcoded-values/no-hardcoded-values-slds1.js.map +4 -4
- package/build/rules/v9/no-hardcoded-values/no-hardcoded-values-slds2.js +5 -1090
- package/build/rules/v9/no-hardcoded-values/no-hardcoded-values-slds2.js.map +4 -4
- package/build/rules/v9/no-hardcoded-values/noHardcodedValueRule.js +31 -882
- package/build/rules/v9/no-hardcoded-values/noHardcodedValueRule.js.map +4 -4
- package/build/rules/v9/no-hardcoded-values/ruleOptionsSchema.d.ts +40 -0
- package/build/rules/v9/no-hardcoded-values/ruleOptionsSchema.js +63 -0
- package/build/rules/v9/no-hardcoded-values/ruleOptionsSchema.js.map +7 -0
- package/build/rules/v9/no-slds-class-overrides.js +3 -163
- package/build/rules/v9/no-slds-class-overrides.js.map +4 -4
- package/build/rules/v9/no-slds-namespace-for-custom-hooks.js +5 -254
- package/build/rules/v9/no-slds-namespace-for-custom-hooks.js.map +4 -4
- package/build/rules/v9/no-slds-private-var.js +1 -161
- package/build/rules/v9/no-slds-private-var.js.map +4 -4
- package/build/rules/v9/no-slds-var-without-fallback.js +5 -257
- package/build/rules/v9/no-slds-var-without-fallback.js.map +4 -4
- package/build/rules/v9/no-sldshook-fallback-for-lwctoken.js +3 -163
- package/build/rules/v9/no-sldshook-fallback-for-lwctoken.js.map +4 -4
- package/build/rules/v9/no-unsupported-hooks-slds2.js +3 -163
- package/build/rules/v9/no-unsupported-hooks-slds2.js.map +4 -4
- package/build/rules/v9/reduce-annotations.js +1 -161
- package/build/rules/v9/reduce-annotations.js.map +4 -4
- package/build/types/index.d.ts +57 -0
- package/build/types/index.js.map +1 -1
- package/build/{src/utils → utils}/boxShadowValueParser.d.ts +1 -1
- package/build/utils/boxShadowValueParser.js +63 -93
- package/build/utils/boxShadowValueParser.js.map +4 -4
- package/build/utils/color-lib-utils.d.ts +25 -0
- package/build/utils/color-lib-utils.js +28 -79
- package/build/utils/color-lib-utils.js.map +3 -3
- package/build/{src/utils → utils}/css-utils.d.ts +7 -0
- package/build/utils/css-utils.js +10 -71
- package/build/utils/css-utils.js.map +4 -4
- package/build/utils/custom-mapping-utils.d.ts +9 -0
- package/build/utils/custom-mapping-utils.js +62 -0
- package/build/utils/custom-mapping-utils.js.map +7 -0
- package/build/{src/utils → utils}/hardcoded-shared-utils.d.ts +1 -0
- package/build/utils/hardcoded-shared-utils.js +46 -98
- package/build/utils/hardcoded-shared-utils.js.map +4 -4
- package/build/{src/utils → utils}/property-matcher.d.ts +3 -1
- package/build/utils/property-matcher.js +22 -8
- package/build/utils/property-matcher.js.map +2 -2
- package/build/utils/styling-hook-utils.js +16 -39
- package/build/utils/styling-hook-utils.js.map +3 -3
- package/build/{src/utils → utils}/value-utils.d.ts +2 -2
- package/build/utils/value-utils.js +8 -8
- package/build/utils/value-utils.js.map +2 -2
- package/package.json +6 -11
- package/build/src/types/index.d.ts +0 -26
- package/build/src/utils/color-lib-utils.d.ts +0 -18
- package/src/config/rule-messages.yml +0 -143
- /package/build/{src/index.d.ts → index.d.ts} +0 -0
- /package/build/{src/rules → rules}/enforce-bem-usage.d.ts +0 -0
- /package/build/{src/rules → rules}/modal-close-button-issue.d.ts +0 -0
- /package/build/{src/rules → rules}/no-deprecated-classes-slds2.d.ts +0 -0
- /package/build/{src/rules → rules}/v9/enforce-bem-usage.d.ts +0 -0
- /package/build/{src/rules → rules}/v9/enforce-component-hook-naming-convention.d.ts +0 -0
- /package/build/{src/rules → rules}/v9/enforce-sds-to-slds-hooks.d.ts +0 -0
- /package/build/{src/rules → rules}/v9/lwc-token-to-slds-hook.d.ts +0 -0
- /package/build/{src/rules → rules}/v9/no-deprecated-slds-classes.d.ts +0 -0
- /package/build/{src/rules → rules}/v9/no-deprecated-tokens-slds1.d.ts +0 -0
- /package/build/{src/rules → rules}/v9/no-hardcoded-values/handlers/boxShadowHandler.d.ts +0 -0
- /package/build/{src/rules → rules}/v9/no-hardcoded-values/handlers/colorHandler.d.ts +0 -0
- /package/build/{src/rules → rules}/v9/no-hardcoded-values/handlers/densityHandler.d.ts +0 -0
- /package/build/{src/rules → rules}/v9/no-hardcoded-values/handlers/fontHandler.d.ts +0 -0
- /package/build/{src/rules → rules}/v9/no-hardcoded-values/handlers/index.d.ts +0 -0
- /package/build/{src/rules → rules}/v9/no-hardcoded-values/no-hardcoded-values-slds1.d.ts +0 -0
- /package/build/{src/rules → rules}/v9/no-hardcoded-values/no-hardcoded-values-slds2.d.ts +0 -0
- /package/build/{src/rules → rules}/v9/no-hardcoded-values/noHardcodedValueRule.d.ts +0 -0
- /package/build/{src/rules → rules}/v9/no-slds-class-overrides.d.ts +0 -0
- /package/build/{src/rules → rules}/v9/no-slds-namespace-for-custom-hooks.d.ts +0 -0
- /package/build/{src/rules → rules}/v9/no-slds-private-var.d.ts +0 -0
- /package/build/{src/rules → rules}/v9/no-slds-var-without-fallback.d.ts +0 -0
- /package/build/{src/rules → rules}/v9/no-sldshook-fallback-for-lwctoken.d.ts +0 -0
- /package/build/{src/rules → rules}/v9/no-unsupported-hooks-slds2.d.ts +0 -0
- /package/build/{src/rules → rules}/v9/reduce-annotations.d.ts +0 -0
- /package/build/{src/utils → utils}/css-functions.d.ts +0 -0
- /package/build/{src/utils → utils}/node.d.ts +0 -0
- /package/build/{src/utils → utils}/rule-utils.d.ts +0 -0
- /package/build/{src/utils → utils}/styling-hook-utils.d.ts +0 -0
|
@@ -29,16 +29,16 @@ function isGlobalValue(value) {
|
|
|
29
29
|
return value === "initial" || value === "inherit" || value === "unset" || value === "revert" || value === "revert-layer";
|
|
30
30
|
}
|
|
31
31
|
var ALLOWED_UNITS = ["px", "em", "rem", "%", "ch"];
|
|
32
|
-
function parseUnitValue(
|
|
33
|
-
if (!
|
|
32
|
+
function parseUnitValue(valueStr) {
|
|
33
|
+
if (!valueStr) return null;
|
|
34
34
|
const unitsPattern = ALLOWED_UNITS.join("|");
|
|
35
35
|
const regex = new RegExp(`^(-?\\d*\\.?\\d+)(${unitsPattern})?$`);
|
|
36
|
-
const match =
|
|
36
|
+
const match = valueStr.match(regex);
|
|
37
37
|
if (!match) return null;
|
|
38
|
-
const
|
|
38
|
+
const numValue = parseFloat(match[1]);
|
|
39
39
|
const unit = match[2] ? match[2] : null;
|
|
40
|
-
if (isNaN(
|
|
41
|
-
return {
|
|
40
|
+
if (isNaN(numValue)) return null;
|
|
41
|
+
return { value: numValue, unit };
|
|
42
42
|
}
|
|
43
43
|
function toAlternateUnitValue(numberVal, unitType) {
|
|
44
44
|
if (unitType === "px") {
|
|
@@ -46,7 +46,7 @@ function toAlternateUnitValue(numberVal, unitType) {
|
|
|
46
46
|
if (!isNaN(floatValue)) {
|
|
47
47
|
return {
|
|
48
48
|
unit: "rem",
|
|
49
|
-
|
|
49
|
+
value: parseFloat(floatValue.toFixed(4))
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
} else if (unitType === "rem") {
|
|
@@ -54,7 +54,7 @@ function toAlternateUnitValue(numberVal, unitType) {
|
|
|
54
54
|
if (!isNaN(intValue)) {
|
|
55
55
|
return {
|
|
56
56
|
unit: "px",
|
|
57
|
-
|
|
57
|
+
value: intValue
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/value-utils.ts"],
|
|
4
|
-
"sourcesContent": ["// 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
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmCO,SAAS,cAAc,OAAwB;AAClD,SAAO,UAAU,aAAa,UAAU,aAAa,UAAU,WAAW,UAAU,YAAY,UAAU;AAC5G;AAGK,IAAM,gBAAgB,CAAC,MAAM,MAAM,OAAO,KAAK,IAAI;AAOnD,SAAS,eAAe,
|
|
4
|
+
"sourcesContent": ["// 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 value: number | string; // string for keyword values like 'bold', 'normal'\n} | null;\n\nexport function parseUnitValue(valueStr: string): ParsedUnitValue {\n if (!valueStr) 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 = valueStr.match(regex);\n if (!match) return null;\n \n const numValue = 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(numValue)) return null;\n \n return { value: numValue, 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 value: 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 value: 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}"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmCO,SAAS,cAAc,OAAwB;AAClD,SAAO,UAAU,aAAa,UAAU,aAAa,UAAU,WAAW,UAAU,YAAY,UAAU;AAC5G;AAGK,IAAM,gBAAgB,CAAC,MAAM,MAAM,OAAO,KAAK,IAAI;AAOnD,SAAS,eAAe,UAAmC;AAChE,MAAI,CAAC,SAAU,QAAO;AAGtB,QAAM,eAAe,cAAc,KAAK,GAAG;AAC3C,QAAM,QAAQ,IAAI,OAAO,qBAAqB,YAAY,KAAK;AAC/D,QAAM,QAAQ,SAAS,MAAM,KAAK;AAClC,MAAI,CAAC,MAAO,QAAO;AAEnB,QAAM,WAAW,WAAW,MAAM,CAAC,CAAC;AACpC,QAAM,OAAO,MAAM,CAAC,IAAK,MAAM,CAAC,IAAyC;AAEzE,MAAI,MAAM,QAAQ,EAAG,QAAO;AAE5B,SAAO,EAAE,OAAO,UAAU,KAAK;AACjC;AAEO,SAAS,qBAAqB,WAAmB,UAAoE;AACxH,MAAI,aAAa,MAAM;AACrB,QAAI,aAAa,WAAW,GAAG,YAAY,EAAE,EAAE;AAC/C,QAAI,CAAC,MAAM,UAAU,GAAG;AACtB,aAAO;AAAA,QACL,MAAM;AAAA,QACN,OAAO,WAAW,WAAW,QAAQ,CAAC,CAAC;AAAA,MACzC;AAAA,IACF;AAAA,EACF,WAAW,aAAa,OAAO;AAC7B,UAAM,WAAW,SAAS,GAAG,YAAY,EAAE,EAAE;AAC7C,QAAI,CAAC,MAAM,QAAQ,GAAG;AACpB,aAAO;AAAA,QACL,MAAM;AAAA,QACN,OAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AAGA,SAAO;AACX;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,25 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce-ux/eslint-plugin-slds",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9-internal",
|
|
4
4
|
"main": "build/index.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./build/index.d.ts",
|
|
8
|
-
"
|
|
9
|
-
"require": "./build/index.js"
|
|
8
|
+
"default": "./build/index.js"
|
|
10
9
|
},
|
|
11
|
-
"./config":
|
|
12
|
-
|
|
13
|
-
"require": "./eslint.config.mjs"
|
|
14
|
-
},
|
|
15
|
-
"./rule-messages.yml": "./src/config/rule-messages.yml"
|
|
10
|
+
"./config": "./eslint.config.mjs",
|
|
11
|
+
"./rule-messages": "./build/config/rule-messages.js"
|
|
16
12
|
},
|
|
17
13
|
"files": [
|
|
18
14
|
"build/**",
|
|
19
15
|
"README.md",
|
|
20
16
|
"RULES.md",
|
|
21
|
-
"eslint.config.mjs"
|
|
22
|
-
"src/config/rule-messages.yml"
|
|
17
|
+
"eslint.config.mjs"
|
|
23
18
|
],
|
|
24
19
|
"engines": {
|
|
25
20
|
"node": ">=18.18.0"
|
|
@@ -38,7 +33,7 @@
|
|
|
38
33
|
"@eslint/css-tree": "^3.6.5",
|
|
39
34
|
"@html-eslint/eslint-plugin": "^0.34.0",
|
|
40
35
|
"@html-eslint/parser": "^0.34.0",
|
|
41
|
-
"@salesforce-ux/sds-metadata": "^1.1
|
|
36
|
+
"@salesforce-ux/sds-metadata": "^1.2.1",
|
|
42
37
|
"chroma-js": "^3.1.2"
|
|
43
38
|
},
|
|
44
39
|
"peerDependencies": {
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Rule } from 'eslint';
|
|
2
|
-
import type { ValueToStylingHooksMapping } from '@salesforce-ux/sds-metadata';
|
|
3
|
-
/**
|
|
4
|
-
* Context interface for handlers to access necessary dependencies
|
|
5
|
-
*/
|
|
6
|
-
export interface HandlerContext {
|
|
7
|
-
valueToStylinghook: ValueToStylingHooksMapping;
|
|
8
|
-
context: Rule.RuleContext;
|
|
9
|
-
sourceCode: any;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Configuration for creating the rule
|
|
13
|
-
*/
|
|
14
|
-
export interface RuleConfig {
|
|
15
|
-
ruleConfig: {
|
|
16
|
-
type: 'problem' | 'suggestion' | 'layout';
|
|
17
|
-
description: string;
|
|
18
|
-
url?: string;
|
|
19
|
-
messages: Record<string, string>;
|
|
20
|
-
};
|
|
21
|
-
valueToStylinghook: ValueToStylingHooksMapping;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Handler function signature for CSS declarations
|
|
25
|
-
*/
|
|
26
|
-
export type DeclarationHandler = (node: any, context: HandlerContext) => void;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ValueToStylingHooksMapping } from '@salesforce-ux/sds-metadata';
|
|
2
|
-
declare const isHardCodedColor: (color: string) => boolean;
|
|
3
|
-
declare const isHexCode: (color: string) => boolean;
|
|
4
|
-
declare const convertToHex: (color: string) => string | null;
|
|
5
|
-
declare const findClosestColorHook: (color: string, supportedColors: ValueToStylingHooksMapping, cssProperty: string) => string[];
|
|
6
|
-
/**
|
|
7
|
-
* This method is usefull to identify all possible css color values.
|
|
8
|
-
* - names colors
|
|
9
|
-
* - 6,8 digit hex
|
|
10
|
-
* - rgb and rgba
|
|
11
|
-
* - hsl and hsla
|
|
12
|
-
*/
|
|
13
|
-
declare const isValidColor: (val: string) => boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Extract color value from CSS AST node
|
|
16
|
-
*/
|
|
17
|
-
declare const extractColorValue: (node: any) => string | null;
|
|
18
|
-
export { findClosestColorHook, convertToHex, isHexCode, isHardCodedColor, isValidColor, extractColorValue };
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
# ESLint Rule Messages - Complete Configuration
|
|
2
|
-
# This file contains all rule metadata: descriptions, documentation URLs, user-facing messages etc.
|
|
3
|
-
|
|
4
|
-
# =============================================================================
|
|
5
|
-
# CSS Rules (ESLint v9 with @eslint/css)
|
|
6
|
-
# =============================================================================
|
|
7
|
-
|
|
8
|
-
no-slds-class-overrides:
|
|
9
|
-
description: "Create new custom CSS classes instead of overriding SLDS selectors"
|
|
10
|
-
url: "https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-slds-class-overrides"
|
|
11
|
-
type: "problem"
|
|
12
|
-
messages:
|
|
13
|
-
sldsClassOverride: "Overriding .{{className}} isn't supported. To differentiate SLDS and custom classes, create a CSS class in your namespace. Examples: myapp-input, myapp-button."
|
|
14
|
-
|
|
15
|
-
no-deprecated-slds-classes:
|
|
16
|
-
description: "Please replace the deprecated classes with a modern equivalent"
|
|
17
|
-
url: "https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-deprecated-slds-classes"
|
|
18
|
-
type: "problem"
|
|
19
|
-
messages:
|
|
20
|
-
deprecatedClass: "The class {{className}} is deprecated and not available in SLDS2. Please update to a supported class."
|
|
21
|
-
|
|
22
|
-
no-deprecated-tokens-slds1:
|
|
23
|
-
description: "Update outdated design tokens to SLDS 2 styling hooks with similar values. For more information, see Styling Hooks on lightningdesignsystem.com."
|
|
24
|
-
url: "https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-deprecated-tokens-slds1"
|
|
25
|
-
type: "problem"
|
|
26
|
-
messages:
|
|
27
|
-
deprecatedToken: "Consider removing {{oldValue}} or replacing it with {{newValue}}. Set the fallback to {{oldValue}}. For more info, see Styling Hooks on lightningdesignsystem.com."
|
|
28
|
-
noReplacement: "Update outdated design tokens to SLDS 2 styling hooks with similar values. For more information, see Styling Hooks on lightningdesignsystem.com."
|
|
29
|
-
|
|
30
|
-
enforce-sds-to-slds-hooks:
|
|
31
|
-
description: "Convert your existing --sds styling hooks to --slds styling hooks. See lightningdesignsystem.com for more info."
|
|
32
|
-
url: "https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#enforce-sds-to-slds-hooks"
|
|
33
|
-
type: "problem"
|
|
34
|
-
messages:
|
|
35
|
-
replaceSdsWithSlds: "Replace {{oldValue}} with {{suggestedMatch}} styling hook."
|
|
36
|
-
|
|
37
|
-
# =============================================================================
|
|
38
|
-
# HTML/Component Rules (ESLint v8 & v9)
|
|
39
|
-
# =============================================================================
|
|
40
|
-
|
|
41
|
-
enforce-bem-usage:
|
|
42
|
-
description: "Replace BEM double-dash syntax in class names with single underscore syntax"
|
|
43
|
-
url: "https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#enforce-bem-usage"
|
|
44
|
-
type: "problem"
|
|
45
|
-
messages:
|
|
46
|
-
bemDoubleDash: "{{actual}} has been retired. Update it to the new name {{newValue}}."
|
|
47
|
-
fixBemNaming: "Update to correct BEM naming convention"
|
|
48
|
-
|
|
49
|
-
modal-close-button-issue:
|
|
50
|
-
description: "Update component attributes or CSS classes for the modal close button to comply with the modal component blueprint"
|
|
51
|
-
url: "https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#modal-close-button-issue"
|
|
52
|
-
type: "problem"
|
|
53
|
-
messages:
|
|
54
|
-
modalCloseButtonIssue: "Update component attributes or CSS classes for the modal close button to comply with the modal component blueprint."
|
|
55
|
-
removeClass: "Remove the slds-button_icon-inverse class from the modal close button in components that use the SLDS modal blueprint."
|
|
56
|
-
changeVariant: "Change the variant attribute value from bare-inverse to bare in <lightning-button-icon> or <lightning-icon>."
|
|
57
|
-
removeVariant: "Remove the variant attribute from the <lightning-icon> component inside the <button> element."
|
|
58
|
-
ensureButtonClasses: "Add or move slds-button and slds-button_icon to the class attribute of the <button> element or <lightning-button-icon> component."
|
|
59
|
-
ensureSizeAttribute: "To size icons properly, set the size attribute to large in the <lightning-icon> and <lightning-button-icon> components."
|
|
60
|
-
|
|
61
|
-
no-deprecated-classes-slds2:
|
|
62
|
-
description: "Replace classes that aren't available with SLDS 2 classes"
|
|
63
|
-
url: "https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-deprecated-classes-slds2"
|
|
64
|
-
type: "problem"
|
|
65
|
-
messages:
|
|
66
|
-
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."
|
|
67
|
-
updateToModernClass: "Replace deprecated class with modern equivalent"
|
|
68
|
-
checkDocumentation: "See lightningdesignsystem.com for SLDS 2 class alternatives"
|
|
69
|
-
|
|
70
|
-
lwc-token-to-slds-hook:
|
|
71
|
-
description: "Replace the deprecated --lwc tokens with the latest --slds tokens. See lightningdesignsystem.com for more info."
|
|
72
|
-
url: "https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#lwc-token-to-slds-hook"
|
|
73
|
-
type: "problem"
|
|
74
|
-
messages:
|
|
75
|
-
errorWithReplacement: "The '{{oldValue}}' design token is deprecated. Replace it with '{{newValue}}'. For more info, see Global Styling Hooks on lightningdesignsystem.com."
|
|
76
|
-
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."
|
|
77
|
-
errorWithNoRecommendation: "The '{{oldValue}}' design token is deprecated. For more info, see the New Global Styling Hook Guidance on lightningdesignsystem.com."
|
|
78
|
-
|
|
79
|
-
no-sldshook-fallback-for-lwctoken:
|
|
80
|
-
description: "Avoid using --slds styling hooks as fallback values for --lwc tokens."
|
|
81
|
-
url: "https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-sldshook-fallback-for-lwctoken"
|
|
82
|
-
type: "problem"
|
|
83
|
-
messages:
|
|
84
|
-
unsupportedFallback: "Remove the {{sldsToken}} styling hook that is used as a fallback value for {{lwcToken}}."
|
|
85
|
-
|
|
86
|
-
no-unsupported-hooks-slds2:
|
|
87
|
-
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."
|
|
88
|
-
url: "https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-unsupported-hooks-slds2"
|
|
89
|
-
type: "problem"
|
|
90
|
-
messages:
|
|
91
|
-
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."
|
|
92
|
-
|
|
93
|
-
no-slds-var-without-fallback:
|
|
94
|
-
description: "Add fallback values to SLDS styling hooks. The fallback values are used in Salesforce environments where styling hooks are unavailable."
|
|
95
|
-
url: "https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-slds-var-without-fallback"
|
|
96
|
-
type: "problem"
|
|
97
|
-
messages:
|
|
98
|
-
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."
|
|
99
|
-
|
|
100
|
-
no-slds-namespace-for-custom-hooks:
|
|
101
|
-
description: "To differentiate custom styling hooks from SLDS styling hooks, create custom styling hooks in your namespace."
|
|
102
|
-
url: "https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-slds-namespace-for-custom-hooks"
|
|
103
|
-
type: "problem"
|
|
104
|
-
messages:
|
|
105
|
-
customHookNamespace: "Using the --slds namespace for {{token}} isn't supported. Create the custom styling hook in your namespace. Example: --myapp-{{tokenWithoutNamespace}}"
|
|
106
|
-
|
|
107
|
-
no-slds-private-var:
|
|
108
|
-
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."
|
|
109
|
-
url: "https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-slds-private-var"
|
|
110
|
-
type: "problem"
|
|
111
|
-
messages:
|
|
112
|
-
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."
|
|
113
|
-
|
|
114
|
-
enforce-component-hook-naming-convention:
|
|
115
|
-
description: "Replace component styling hooks that use a deprecated naming convention."
|
|
116
|
-
url: "https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#enforce-component-hook-naming-convention"
|
|
117
|
-
type: "problem"
|
|
118
|
-
messages:
|
|
119
|
-
replace: "Replace the deprecated {{oldValue}} component styling hook with {{suggestedMatch}}."
|
|
120
|
-
|
|
121
|
-
no-hardcoded-values-slds1:
|
|
122
|
-
description: "Replace static values with SLDS 1 design tokens. For more information, look up design tokens on lightningdesignsystem.com."
|
|
123
|
-
url: "https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-hardcoded-value"
|
|
124
|
-
type: "suggestion"
|
|
125
|
-
messages:
|
|
126
|
-
hardcodedValue: "Replace the {{oldValue}} static value with an SLDS 1 styling hook: {{newValue}}."
|
|
127
|
-
noReplacement: "There's no replacement styling hook for the {{oldValue}} static value. Remove the static value."
|
|
128
|
-
|
|
129
|
-
no-hardcoded-values-slds2:
|
|
130
|
-
description: "Replace static values with SLDS 2 styling hooks. For more information, look up design tokens on lightningdesignsystem.com."
|
|
131
|
-
url: "https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-hardcoded-values-slds2"
|
|
132
|
-
type: "suggestion"
|
|
133
|
-
messages:
|
|
134
|
-
hardcodedValue: "Consider replacing the {{oldValue}} static value with an SLDS 2 styling hook that has a similar value: {{newValue}}."
|
|
135
|
-
noReplacement: "There's no replacement styling hook for the {{oldValue}} static value. Remove the static value."
|
|
136
|
-
|
|
137
|
-
reduce-annotations:
|
|
138
|
-
description: "Remove your annotations and update your code."
|
|
139
|
-
url: "https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#reduce-annotations"
|
|
140
|
-
type: "problem"
|
|
141
|
-
messages:
|
|
142
|
-
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/"
|
|
143
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|