question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Export interfaces at the root level

See original GitHub issue

I’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:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kamilmysliwieccommented, May 2, 2018

Thanks for reporting. I’ll fix it in the next RC. Btw. 5.0.0-rc.1 is available already

0reactions
lock[bot]commented, Sep 25, 2019

This 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found