ng lint

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

ng lint <project> [options]
      
      ng lint <project> [options]
    
ng l <project> [options]
      
      ng l <project> [options]
    

说明

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.

参数

参数说明
<project>

The name of the project to lint.

选项

选项说明
--configuration=configuration

The linting configuration to use.

别名: -c

--exclude

Files to exclude from linting.

--files

Files to include in linting.

--fix=true|false

Fixes linting errors (may overwrite linted files).

默认值: false

--force=true|false

Succeeds even if there was linting errors.

默认值: false

--format=format

Output format (prose, json, stylish, verbose, pmd, msbuild, checkstyle, vso, fileslist).

默认值: prose

--help=
true|false|json|JSON

Shows a help message for this command in the console.

默认值: false

--silent=true|false

Show output text.

默认值: false

--tsConfig=tsConfig

The name of the TypeScript configuration file.

--tslintConfig=tslintConfig

The name of the TSLint configuration file.

--typeCheck=true|false

Controls the type check for linting.

默认值: false