Autofix Your Code
You’ve gone through the report and identified the issues to fix and the components to update.
Fix validation issues automatically in bulk by running the lint
command with the --fix
option.
Examples
Fix all files in current directory:
npx @salesforce-ux/slds-linter@latest lint --fix
Fix all files in a specific directory:
npx @salesforce-ux/slds-linter@latest lint "com/CORE/**" --fix
Fix issues by using custom configuration files. Send the configuration files to the lint
command, and run the command with the --fix
option:
npx @salesforce-ux/slds-linter@latest lint --config-eslint .eslintrc.yml --fix
Fix files with specific file types:
npx @salesforce-ux/slds-linter@latest lint "*/.{html,cmp}" --fix