-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[no-unused-vars] False positives with members of exported namespace in .d.ts file #2867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Why are you Also in declaration files - you should be |
@bradzacher In a Just |
How are you creating your declaration files for your modules? I thought the general pattern was declare module './foo' {
export namespace Foo {
// ..
}
} and not just declaring your namespaces in the root. |
With a text editor? A |
The issue is that our selectors target
Happy to accept a PR - simple fix. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I'll take a look at this 👨🏽💻 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
To anyone seeing this issue. This issue is ONLY about ALL OTHER ISSUES ARE NOT RELATED TO THIS ISSUE. We have an FAQ you should read before commenting |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment was marked as off-topic.
This comment was marked as off-topic.
I was hoping to add this rule to DefinitelyTyped (microsoft/DefinitelyTyped-tools#968), but noticed this problem as well as most namespaces on DT have implicit export modifiers. I may look into this (though please don't take this as cookie licking and please still attempt it even if I forget or fail). A gotcha is that this namespace does not have any unused vars: export namespace Foo {
const value: 1234;
export import Something = something.Something;
} Yay namespaces. |
Repro
Expected Result
No error. In a
.d.ts
file, members of an exported namespace are implicitly exported, unless the namespace contains an explicit bracedexport {}
declaration.Actual Result
Additional Info
Similar to #2456, which was about a different kind of implicit export in
.d.ts
files, namely interface declarations.Versions
@typescript-eslint/eslint-plugin
4.9.1
@typescript-eslint/parser
4.9.1
TypeScript
4.1.2
ESLint
7.15.0
node
14.15.1
The text was updated successfully, but these errors were encountered: