On this page
ng lint
Runs linting tools on Angular app code in a given project folder.
ng lint <project> [options]
ng l <project> [options]
Description
Takes the name of the project, as specified in the projects
section of the angular.json
workspace configuration file. When a project name is not supplied, it will execute for all projects.
The default linting tool is TSLint, and the default configuration is specified in the project's tslint.json
file.
Note: TSLint has been discontinued and support has been deprecated in the Angular CLI. The options shown below are for the deprecated TSLint builder. To opt-in using the community driven ESLint builder, see angular-eslint README.
Arguments
Argument | Description | Value Type |
---|---|---|
<project> |
The name of the project to lint. |
string |
Options
Option | Description | Value Type | Default Value |
---|---|---|---|
--configuration |
The linting configuration to use. Aliases: -c |
string |
|
--exclude |
Files to exclude from linting. |
array |
|
--files |
Files to include in linting. |
array |
|
--fix |
Fixes linting errors (may overwrite linted files). |
boolean |
false |
--force |
Succeeds even if there was linting errors. |
boolean |
false |
--format |
Output format (prose, json, stylish, verbose, pmd, msbuild, checkstyle, vso, fileslist). |
string |
stylish |
--help |
Shows a help message for this command in the console. |
true|false|json|JSON |
false |
--silent |
Show output text. |
boolean |
false |
--ts-config |
The name of the TypeScript configuration file. |
string |
|
--tslint-config |
The name of the TSLint configuration file. |
string |
|
--type-check |
Controls the type check for linting. |
boolean |
false |
© 2010–2021 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v11.angular.io/cli/lint