Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ng-alain/ng-alain-codelyzer
A set of tslint rules for static code analysis of ng-alain projects.
https://github.com/ng-alain/ng-alain-codelyzer
angular codelyzer delon lint ng-alain style-guide tslint
Last synced: 2 months ago
JSON representation
A set of tslint rules for static code analysis of ng-alain projects.
- Host: GitHub
- URL: https://github.com/ng-alain/ng-alain-codelyzer
- Owner: ng-alain
- License: mit
- Created: 2019-01-21T09:27:22.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-22T11:30:46.000Z (almost 6 years ago)
- Last Synced: 2024-05-23T10:02:07.526Z (8 months ago)
- Topics: angular, codelyzer, delon, lint, ng-alain, style-guide, tslint
- Language: TypeScript
- Homepage: https://ng-alain.com
- Size: 11.7 KB
- Stars: 12
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## ng-alain-codelyzer [![Build Status](https://img.shields.io/travis/ng-alain/ng-alain-codelyzer/master.svg?style=flat-square)](https://travis-ci.org/ng-alain/ng-alain-codelyzer) [![NPM version](https://img.shields.io/npm/v/ng-alain-codelyzer.svg?style=flat-square)](https://www.npmjs.com/package/ng-alain-codelyzer)
A set of tslint rules for static code analysis of [ng-alain](https://ng-alain.com) projects.
## How to use?
Install ng-alain-codelyzer:
```shell
# via npm
npm i ng-alain-codelyzer --save-dev
# via yarn
yarn add -D ng-alain-codelyzer
```Using ng-alain-codelyzer from node_modules directory:
```json
{
"rulesDirectory": [
"node_modules/ng-alain-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:
```ts
import { I18NService } from '../core/i18n/i18n.service';
```As last step you can execute all the rules against your code with tslint:
```shell
./node_modules/.bin/tslint -c tslint.json src/app/routes/component.ts
```You should see the following output:
```text
ERROR: src/app/routes/component.ts[1, 30]: Should be imported using `@core`
```## Subdirectories
If you want to support subdirectory import styles:
```ts
import { I18NService } from '@core/i18n/i18n.service';
```Configured as:
```json
{
"use-path-mapping": [true, ["@core/*", "@shared"]]
}
```## License
MIT