Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bcherny/tslint-no-circular-imports
TSLint plugin to detect and warn about circular imports
https://github.com/bcherny/tslint-no-circular-imports
tslint typescript
Last synced: 10 days ago
JSON representation
TSLint plugin to detect and warn about circular imports
- Host: GitHub
- URL: https://github.com/bcherny/tslint-no-circular-imports
- Owner: bcherny
- License: mit
- Created: 2016-11-15T05:43:36.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-08-10T22:17:11.000Z (about 3 years ago)
- Last Synced: 2024-10-18T11:27:00.263Z (23 days ago)
- Topics: tslint, typescript
- Language: TypeScript
- Homepage:
- Size: 56.6 KB
- Stars: 86
- Watchers: 8
- Forks: 12
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# tslint-no-circular-imports [![Build Status][build]](https://circleci.com/gh/bcherny/tslint-no-circular-imports) [![npm]](https://www.npmjs.com/package/tslint-no-circular-imports) [![mit]](https://opensource.org/licenses/MIT)
[build]: https://img.shields.io/circleci/project/bcherny/tslint-no-circular-imports.svg?branch=master&style=flat-square
[npm]: https://img.shields.io/npm/v/tslint-no-circular-imports.svg?style=flat-square
[mit]: https://img.shields.io/npm/l/tslint-no-circular-imports.svg?style=flat-square> [TSLint](https://palantir.github.io/tslint/) plugin to detect and warn about circular imports
## Installation
```sh
# Using Yarn:
yarn add --dev tslint-no-circular-imports# Or, using NPM:
npm install --save-dev tslint-no-circular-imports
```## Usage
Add the following to your tslint.json:
```json
{
"extends": ["tslint-no-circular-imports"]
}
```Run TSLint:
```sh
$ tslint .
Circular import detected: foo.ts -> bar.ts -> foo.ts
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:```json
{
"rules": {
"no-circular-imports": { "severity": "warn" }
}
}
```
## Running the tests```sh
npm test
```## License
MIT