[import/no-cycle] possible false-positive with re-exported names
See original GitHub issueGiven these files:
a.js
import {b} from './internal';
export const a = 'a';
b.js
import {a} from './internal';
export const b = 'b';
internal.js
export * from './a';
export * from './b';
.eslintrc
plugins:
- import
parserOptions:
ecmaVersion: 2020
sourceType: module
rules:
import/no-cycle: [2]
I see these errors:
a.js
1:1 error Dependency cycle detected import/no-cycle
b.js
1:1 error Dependency cycle detected import/no-cycle
internal.js
1:1 error Dependency cycle detected import/no-cycle
2:1 error Dependency cycle detected import/no-cycle
This is a example of @mweststrate’s internal module pattern and if I understand correctly, there are no actual circular dependencies here. Is it a false-positive or a error in the pattern itself?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
[import/no-cycle] possible false-positive with re-exported names
Being a cycle is not about touching the filesystem; it's about conceptually creating a situation where two files mutually depend on each other....
Read more >How to fix/disable seemingly erroneous "No named exports ...
I believe the report is a false positive because when I run the code, everything works fine and I can indeed import the...
Read more >eslint-plugin-import | Yarn - Package Manager
This plugin intends to support linting of ES2015+ (ES6+) import/export syntax, and prevent issues with misspelling of file paths and import names.
Read more >eslint-plugin-import - NPM Package Overview - Socket.dev
Start using Socket to analyze eslint-plugin-import and its 13 ... export ( no-named-as-default ); Report use of exported name as property of ...
Read more >node_modules/eslint-plugin-import/CHANGELOG.md · master ...
no -unused-modules : consider exported TypeScript interfaces, types and enums (#1819, thanks @nicolashenry); no-cycle : allow maxDepth option to be ...
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 FreeTop 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
Top GitHub Comments
I guess technically you’re correct. I didn’t really like that pattern anyways so I will avoid it.