A [Stylelint] plugin to help teams identify antipatterns and deprecated practices in LWC stylesheets. Plugin is an implementation of many of the rules found in SLDS Architecture Update (released April 2024).
npm i --save-dev stylelint @mvogelgesang/stylelint-plugin-slds
Add a .stylelintrc.json
file to your project root directory.
Update with the following:
{
"plugins": ["@mvogelgesang/stylelint-plugin-slds"],
"rules": {
"stylelint-plugin-slds/no-lwc-custom-properties":true,
"stylelint-plugin-slds/no-sds-custom-properties": true,
"stylelint-plugin-slds/no-slds-class-overrides": true
}
}
Update package.json to include a new stylelint
command. This can also be chained with other linting checks.
{
"scripts": {
"stylelint": "stylelint -c .stylelintrc.json ./force-app/default/main/lwc/**/*.css"
},
}
https://help.salesforce.com/s/articleView?id=001622574&type=1
https://help.salesforce.com/s/articleView?id=001622574&type=1