W3cubDocs

/Angular

ng lint

Runs linting tools on Angular app code in a given project folder.

ng lint <project> [options]

ng l <project> [options]

Description

The command takes an optional project name, as specified in the projects section of the angular.json workspace configuration file. When a project name is not supplied, executes the lint builder for all projects.

To use the ng lint command, use ng add to add a package that implements linting capabilities. Adding the package automatically updates your workspace configuration, adding a lint CLI builder. For example:

"projects": {
  "my-project": {
    ...
    "architect": {
      ...
      "lint": {
        "builder": "@angular-eslint/builder:lint",
        "options": {}
      }
    }
  }
}

Arguments

Argument Description Value Type
<project>

The name of the project to lint.

string

Options

Option Description Value Type Default Value
--configuration

One or more named builder configurations as a comma-separated list as specified in the "configurations" section of angular.json. The builder uses the named configurations to run the given target. For more information, see https://angular.io/guide/workspace-config#alternate-build-configurations.

Aliases: -c

string
--help

Shows a help message for this command in the console.

true|false|json|JSON false

© 2010–2021 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://angular.io/cli/lint