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 |