Export interfaces at the root level
See original GitHub issueI’m submitting a…
[ ] Regression
[X] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
The Provider interface has to be imported from a submodule:
import { Provider } from '@nestjs/common/interfaces/modules/provider.interface';
export const requestSchedulerProvider: Provider = {....}
Expected behavior
The interface should be exposed at it’s root level
import { Provider } from '@nestjs/common';
What is the motivation / use case for changing the behavior?
[tslint] Submodule import paths from this package are disallowed; import from the root instead (no-submodule-imports)
Reasoning for this rule from palantir: “Submodules of some packages are treated as private APIs and the import paths may change without deprecation periods. It’s best to stick with top-level package exports.”
Environment
Nest version: 5.0.0-beta.7
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
javascript - How do I export multiple interfaces in a nested way ...
In the easiest case, you just have separate index.d.ts files inside the my-module and my-module/sub-part folder of the published npm package ...
Read more >Interface Configurations for Root and Vsys Overview
Interfaces can be dedicated, shared, imported, and exported between root and vsys. Note. When the root system is in L2V, you cannot import...
Read more >Understanding and using interfaces in TypeScript
In this file, we can define any interfaces and types we plan on using throughout the application. export interface Post { title: string...
Read more >Documentation - Modules - TypeScript
Any declaration (such as a variable, function, class, type alias, or interface) can be exported by adding the export keyword. StringValidator.ts. ts. export...
Read more >Chapter 7. Packages and Modules - Oracle Help Center
A module categorizes some or all of its packages as exported, which means their classes and interfaces may be accessed from code outside...
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
Thanks for reporting. I’ll fix it in the next RC. Btw.
5.0.0-rc.1
is available alreadyThis thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.