Skip to content

Conversation

@randi274
Copy link
Contributor

This PR:

  • Creates new SLDS CSS rules

@randi274 randi274 marked this pull request as draft September 10, 2025 19:22
// Add CSS config if CSS files are configured
if (this.engineConfig.file_extensions.css.length > 0) {
const cssConfig = sldsEslintPlugin.configs['flat/recommended'].find(conf =>
conf.files && conf.files.includes('**/*.{css,scss}')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed in person. If the other team can separate their config so that we didn't need to do these lookups our code would dramatically simplify and be more robust against future changes. So propose to them that they do something like:

Object.assign(plugin.configs, {
  // Flat config for ESLint v9+
  "flat/recommended-css": cssConfigArray,
  "flat/recommended-html": htmlConfigArray,
  "flat/recommended": [... cssConfigArray, ... htmlConfigArray]
...

on their end.

tags: [COMMON_TAGS.RECOMMENDED, SLDS, COMMON_TAGS.CATEGORIES.BEST_PRACTICES, COMMON_TAGS.LANGUAGES.CSS]
},
"@salesforce-ux/slds/no-slds-private-var": {
severity: SeverityLevel.High,
Copy link
Contributor

@stephen-carter-at-sf stephen-carter-at-sf Sep 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"description": "Replace static values with SLDS 2 styling hooks. For more information, look up design tokens on lightningdesignsystem.com.",
"name": "@salesforce-ux/slds/no-hardcoded-values-slds2",
"resourceUrls": [
"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-hardcoded-value"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-hardcoded-value"
"https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-rules.html#no-hardcoded-values-slds2"


// =================================================================================================================
// SLDS/HTML BASE RULES - @salesforce-ux/eslint-plugin-slds
// SLDS - HTML BASE RULES - @salesforce-ux/eslint-plugin-slds
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had approval to lower these all by 1 level; todo with the update to pull in the final rule updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants