项目作者: bcherny

项目描述 :
TSLint plugin to detect and warn about circular imports
高级语言: TypeScript
项目地址: git://github.com/bcherny/tslint-no-circular-imports.git
创建时间: 2016-11-15T05:43:36Z
项目社区:https://github.com/bcherny/tslint-no-circular-imports

开源协议:MIT License

下载


tslint-no-circular-imports Build Status npm mit

TSLint plugin to detect and warn about circular imports

Installation

  1. # Using Yarn:
  2. yarn add --dev tslint-no-circular-imports
  3. # Or, using NPM:
  4. npm install --save-dev tslint-no-circular-imports

Usage

Add the following to your tslint.json:

  1. {
  2. "extends": ["tslint-no-circular-imports"]
  3. }

Run TSLint:

  1. $ tslint .
  2. Circular import detected: foo.ts -> bar.ts -> foo.ts
  3. Circular import detected: baz.ts -> bar.ts -> baz.ts

Note, if you wish to have circular references reported as
a warning, rather than as an error, then add this to your tslint.json:

  1. {
  2. "rules": {
  3. "no-circular-imports": { "severity": "warn" }
  4. }
  5. }

Running the tests

  1. npm test

License

MIT