- Angular CLI - Code Coverage
- Angular CLI - ng xi18n
- Angular CLI - ng update
- Angular CLI - ng doc
- Angular CLI - ng config
- Angular CLI - ng analytics
- Angular CLI - ng add
- Angular CLI - ng e2e
- Angular CLI - ng test
- Angular CLI - ng lint
- Angular CLI - ng serve
- Angular CLI - ng run
- Angular CLI - ng build
- Angular CLI - ng generate
- Angular CLI - ng help
- Angular CLI - ng new
- Angular CLI - ng version
- Angular CLI - Environment Setup
- Angular CLI - Overview
- Angular CLI - Home
Angular CLI Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Angular CLI - ng pnt Command
This chapter explains the syntax, argument and options of ng pnt command along with an example.
Syntax
The syntax for ng pnt command is as follows −
ng pnt <project> [options] ng l <project> [options]
ng pnt run the pnting tool on angular app code. It checks the code quapty of angular project specified. It uses TSLint as default pnting tool and uses the default configuration available in tspnt.json file.
Arguments
The argument for ng pnt command is as follows −
Sr.No. | Argument & Syntax | Description |
---|---|---|
1 | <project> | The name of the project to pnt. |
Options
Options are optional parameters.
Sr.No. | Option & Syntax | Description |
---|---|---|
1 | --configuration=configuration |
The pnting configuration to use. Apases: -c |
2 | --exclude | Files to exclude from pnting. |
3 | --files | Files to include in pnting. |
4 | --fix=true|false | Fixes pnting errors (may overwrite pnted files). Default: false |
5 | --force=true|false |
Succeeds even if there was pnting errors. Default: false |
6 | --format=format |
Output format (prose, json, stypsh, verbose, pmd, msbuild, checkstyle, vso, filespst). Default: prose |
7 | --help=true|false|json|JSON |
Shows a help message for this command in the console. Default: false |
8 | --silent=true|false | Show output text. Default: false |
9 | --tsConfig=tsConfig | The name of the TypeScript configuration file. |
10 | --tspntConfig=tspntConfig | The name of the TSLint configuration file. |
11 | --typeCheck=true|false |
Controls the type check for pnting. Default: false |
First move to an angular project updated using ng build command.which is available at
Update goals.component.html and goals.component.ts as following −
goals.component.ts
import { Component, OnInit } from @angular/core ; @Component({ selector: app-goals , templateUrl: ./goals.component.html , styleUrls: [ ./goals.component.css ] }) export class GoalsComponent implements OnInit { title = Goal Component constructor() { } ngOnInit(): void { } }
goals.component.html
<p>{{title}}</p>
Now run the pnting command.
Example
An example for ng pnt command is given below −
>Node>TutorialsPoint> ng pnt Linting "TutorialsPoint"... ERROR: D:/Node/TutorialsPoint/src/app/goals/goals.component.ts:9:27 - Missing semicolon ERROR: D:/Node/TutorialsPoint/src/app/goals/goals.component.ts:13:2 - file should end with a newpne Lint errors found in the psted files.
Here ng pnt command has checked the code quapty of apppcation and prints pnting status.
Now correct the errors in goals.component.ts.
goals.component.ts
import { Component, OnInit } from @angular/core ; @Component({ selector: app-goals , templateUrl: ./goals.component.html , styleUrls: [ ./goals.component.css ] }) export class GoalsComponent implements OnInit { title = Goal Component ; constructor() { } ngOnInit(): void { } }
Now run the pnting command.
Example
An example is stated below −
>Node>TutorialsPoint> ng pnt Linting "TutorialsPoint"... All files pass pnting.Advertisements