<section class="usage-guides">

## Linting

<hr>

### TypeScript

<hr class="ta-shortDivider">

The Cardinal digital standards for TypeScript linting can be injected into your  application and extended as needed.  Following are details on how to install, import, and set up linting rules.

They are agnostic of IDE configuration and are MVVM framework agnostic.

**Note:**  Best practices for using the Angular CLI or React Framework are not yet included. The focus here is for a TypeScript Project.

</section>

<section class="usage-guides">

#### TypeScript Installation

<ol class="ta-ol -ordered -py-none">
  <li> Locate the <code class="-semiBold"> .npmrc </code> file at the root of the application.</li>
  <li>Set the NEXUS digital release package repository as the target for <code class="-semiBold">@cardinal</code> modules. </li>
</ol>

</section>

<section class="usage-guides">

</section>

<section class="usage-guides">

#### Add Cardinal Registry

```bash
  @cardinal:registry=http://nexus.us.aegon.com/repository/transamerica.digital.ui.release/
```

1. Open a terminal or command line window and navigate to the root of the application.

2. Install the Cardinal Design System dev dependency node module for the linting configuration.

</section>

<section class="usage-guides">

#### Install Dev Dependency

```npm
  npm i --save-dev @cardinal/tslint-config
```

<ol class="ol -ordered">
  <li>Navigate to the root directory and add tslint to your TypeScript application.</li>
  <li>Run the ts-lint command.</li>
</ol>

<p class="note -my-none"><span>Note:</span> Yarn is a package management tool and required for this step. See <a href="(https://yarnpkg.com/lang/en/docs/install/#mac-stable" target="_blank" rel="noopener noreferrer">Yarn Installation</a>. </p>

</section>

<section class="usage-guides">

```npm
yarn global add tslint typescript
  
#install the tslint tool into your application
npm install tslint --save-dev
```

#### Install  Cardinal Design System Linting Rules

<ol class="ol -ordered -py-none">
  <li>In the terminal or command line window, navigate to the <em class="-semiBold">root</em> of the application.</li>
  <li>Create a <em class="-semiBold"> tslint.json </em> file.</li>
  <li>Add the following <em class="-semiBold">extends</em> object to the <em class="-semiBold">tslint.json</em> file.</li>
</ol>

</section>

<section class="usage-guides">

```json
{
  "extends": "./node_modules/@cardinal/tslint-config/tslint-config.json"
}
```

That's it. Now run linting on your application!

`Error rendering macro 'code': Invalid value specified for parameter 'firstline'`

`npm run lint`

</section>
