ng-stamy-codelyzer

0.0.1 • Public • Published

ng-stamy-codelyzer Build Status NPM version

A set of tslint rules for static code analysis of ng-stamy projects.

How to use?

Install ng-stamy-codelyzer:

# via npm 
npm i ng-stamy-codelyzer --save-dev
# via yarn 
yarn add -D ng-stamy-codelyzer

Using ng-stamy-codelyzer from node_modules directory:

{
  "rulesDirectory": [
    "node_modules/ng-stamy-codelyzer"
  ],
  "rules": {
    "use-path-mapping": [true, ["@core", "@shared"]]
  }
}

Next you can create a component file in the src/app/routes directory with name component.ts and the following content:

import { I18NService } from '../core/i18n/i18n.service';

As last step you can execute all the rules against your code with tslint:

./node_modules/.bin/tslint -c tslint.json src/app/routes/component.ts

You should see the following output:

ERROR: src/app/routes/component.ts[1, 30]: Should be imported using `@core`

Subdirectories

If you want to support subdirectory import styles:

import { I18NService } from '@core/i18n/i18n.service';

Configured as:

{
  "use-path-mapping": [true, ["@core/*", "@shared"]]
}

License

MIT

Package Sidebar

Install

npm i ng-stamy-codelyzer

Weekly Downloads

2

Version

0.0.1

License

MIT

Unpacked Size

26.8 kB

Total Files

17

Last publish

Collaborators

  • steven728