---
schema_version: "1"
id: f5f90906ca0319f8986c4b9e9ef3c7003113c421e744c14fe23c1953725a0883
title: Commands
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/lwc/slds_linter/guides/reference/reference-commands.md
canonical_url: https://developer.salesforce.com/docs/platform/slds-linter/guide/reference-commands.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: f9d0c9c93d9305d6f82843559b312983d1bf5caa1b641f7b9061cb78d23878f5
products:
  - SLDS Linter
  - lwc
---
# Commands

Use these commands to work with SLDS Linter. To uplift your code to SLDS 2 best practices, review and fix the issues that are captured in the generated report.

## lint

Performs style and component linting on your files.

### Description

This command runs SLDS Linter on your code and identifies all the instances where the code doesn’t meet the SLDS 2 rules. It runs ESLint rules on HTML, CMP, and CSS files.

### Examples

See the lint output in the Terminal:

```
npx @salesforce-ux/slds-linter@latest lint
```

Recursively lint all style and markup files in a single directory:

```
npx @salesforce-ux/slds-linter@latest lint aura
```

Recursively lint all style and markup files in multiple directories:

```
npx @salesforce-ux/slds-linter@latest lint "**/{aura,lwc}/**"
```

Recursively lint all CSS files in a single directory:

```
npx @salesforce-ux/slds-linter@latest lint "aura/**/*.css"
```

Lint multiple types of style files:

```
npx @salesforce-ux/slds-linter@latest lint "**/*.{css,scss,sass}"
```

Recursively lint all HTML files in a single directory:

```
npx @salesforce-ux/slds-linter@latest lint "aura/**/*.html"
```

Lint multiple types of markup files:

```
npx @salesforce-ux/slds-linter@latest lint "**/*.{html,cmp}"
```

### Flags

`--fix`  
Optional

Automatically fix problems.

Type: Boolean

`–config-eslint <path>`  
Optional

Path to ESLint configuration file.

Type: Option/String

`--editor <editor>`  
Optional

Editor to open files. For example, VS Code, Atom, Sublime.

Type: Option/String

Default value: `VS Code`

## report

Generates a SARIF or CSV report for analyzing the issues identified by SLDS Linter. The default format is SARIF.

### Description

This command generates a report containing all the instances in your code that don’t align with SLDS 2 guidelines. The report is generated in .csv or .sarif format.

### Examples

Generate a SARIF report:

```
npx @salesforce-ux/slds-linter@latest report --format sarif
```

Generate a CSV report:

```
npx @salesforce-ux/slds-linter@latest report --format csv
```

Generate a CSV report to a specific directory:

```
npx @salesforce-ux/slds-linter@latest report --format csv /mydirectory
```

### Flags

`-o, --output <path>`  
Optional

Output directory for reports. Defaults to the current directory.

Type: Option/String

`--config-eslint <path>`  
Optional

Path to ESLint configuration file.

Type: Option/String

`–format <type>`  
Optional

Output format for the report. Allowed values are `sarif` and `csv`.

Type: Option/String

Default value: `sarif`

## emit

Generates the custom configuration files used by SLDS Linter. By default, the files are placed in the current directory.

### Description

This command generates the `.eslintrc.yml` configuration file used by the SLDS Linter CLI. In this file, you can add new rules and enable or disable existing rules.

### Examples

```
npx @salesforce-ux/slds-linter@latest emit
```

### Flags

`-d, –directory <path>`  
Optional

Target directory to scan. Defaults to the current directory. Supports glob patterns.

Type: Option/String

## help

Displays help for the various commands.

### Description

To view help, add `--help` to each command.

### Examples

See which options you can use with the `lint` command:

```
npx @salesforce-ux/slds-linter@latest lint --help
```

### Flags

`-V, --version`  
Optional

Displays the version number.

Type: Option/String

`-h, –help`  
Optional

Displays help for the various commands.

Type: Option/String
