-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Copy link
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuebugSomething isn't workingSomething isn't workinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
Description
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I have read the FAQ and my problem is not listed.
Repro
{
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"rules": {
"@typescript-eslint/no-unused-vars": "error"
}
}
// foo.d.ts
export namespace Foo {
const bar: string;
namespace Baz {
const quux: string;
}
}
Expected Result
No error. In a .d.ts
file, members of an exported namespace are implicitly exported, unless the namespace contains an explicit braced export {}
declaration.
Actual Result
/tmp/test/foo.d.ts
2:9 error 'bar' is defined but never used @typescript-eslint/no-unused-vars
3:13 error 'Baz' is defined but never used @typescript-eslint/no-unused-vars
4:11 error 'quux' is defined but never used @typescript-eslint/no-unused-vars
✖ 3 problems (3 errors, 0 warnings)
Additional Info
Similar to #2456, which was about a different kind of implicit export in .d.ts
files, namely interface declarations.
Versions
package | version |
---|---|
@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 |
tryggvigy, MartinMa, swain and gustavopch
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuebugSomething isn't workingSomething isn't workinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin