Barrel and Circular dependency
See original GitHub issue- [ ] bug report -> please search issues before submitting
- [ x ] feature request
Versions.
@angular/cli: 1.3.0
node: 6.11.0
os: linux x64
@angular/animations: 4.3.4
@angular/common: 4.3.4
@angular/compiler: 4.3.4
@angular/core: 4.3.4
@angular/flex-layout: 2.0.0-beta.8
@angular/forms: 4.3.4
@angular/http: 4.3.4
@angular/material: 2.0.0-beta.8
@angular/cdk: 2.0.0-beta.8
@angular/platform-browser: 4.3.4
@angular/platform-browser-dynamic: 4.3.4
@angular/router: 4.3.4
@angular/cli: 1.3.0
@angular/compiler-cli: 4.3.4
@angular/language-service: 4.3.4
Repro steps.
The following will generate circular deps warning between a.compoentnt.ts
-> index.ts
-> a.component.ts
module/
|- a.component.ts
|- b.model.ts
|- index.ts
a.compoennt.ts:
import {B} from '.'
b.component.ts
export class B { }
index.ts
export * from './b.model.ts';
export * from './a.component.ts';
Desired functionality.
An option to ignore these kind of circular deps A => barrel => A
Circular deps check is great (I was able to find real ones), and I would like to keep this option always on, but its too noisy with barrels.
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (1 by maintainers)
Top Results From Across the Web
Circular Dependency - A progressive Node.js framework
Warning A circular dependency might also be caused when using "barrel files"/index.ts files to group imports. Barrel files should be omitted when it...
Read more >Barrel files: to use or not to use? - Blog by Adrian Fâciu
We just don't want to have too many barrel files since that is counter productive and usually leads to circular dependency issues which ......
Read more >Use directory import (barrel file) only if it's outside the current ...
Use directory import (barrel file) only if it's outside the current path — to avoid circular dependency in some build systems.
Read more >WARNING in Circular dependency detected - Stack Overflow
I am getting circular dependency warning while using barrelsby in Angular 10. Error: WARNING in Circular dependency detected: ...
Read more >How to fix nasty circular dependency issues once and for all in ...
The module loading order in JavaScript is deterministic. Yet it is not very easy to follow in large projects. The reason for this,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just don’t import from the barrels, import from the stuff1.service itself…
Barrels works great when you have multiple module.
Simple rule: Do not import a symbol from a barrel that export the current file.