Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[no-unused-var] False positive for nested namespace declaration #2573

Copy link
Copy link
Closed
@hiranya911

Description

@hiranya911
Issue body actions
  • 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

{
  root: true,
  parser: '@typescript-eslint/parser',
  plugins: [
    '@typescript-eslint',
  ],
  extends: [
    'eslint:recommended',
    'plugin:@typescript-eslint/recommended',
  ],
  rules: {
    // Following checks are temporarily disabled. We shall incrementally enable them in the
    // future, fixing any violations as we go.
    '@typescript-eslint/no-non-null-assertion': 0,

    // Disabled checks
    '@typescript-eslint/no-explicit-any': 0,
    '@typescript-eslint/no-use-before-define': 0,

    // Required checks
    'indent': ['error', 2],
    'keyword-spacing': ['error'],
    'max-len': [
      'error',
      {
        'code': 120,
        'ignoreUrls': true
      }
    ],
    "object-curly-spacing": [2, "always"],
    '@typescript-eslint/explicit-function-return-type': [
      'error',
      {
        'allowExpressions': true,
        'allowTypedFunctionExpressions': true,
        'allowHigherOrderFunctions': true
      }
    ],
    'no-unused-vars': 'off', // Must be disabled to enable the next rule
    '@typescript-eslint/no-unused-vars': ['error']
  }
}
export namespace foo.bar {
  export interface User {
    name: string;
  }
}

Expected Result

No lint errors.

Actual Result

error  'bar' is defined but never used  @typescript-eslint/no-unused-vars

Additional Info

Following doesn't trigger the error as far as I can tell.

export namespace foo {
  export namespace bar {
    export interface User {
      name: string;
    }
  }
}

Versions

package version
@typescript-eslint/eslint-plugin 4.1.0
@typescript-eslint/parser 4.1.0
TypeScript 3.7.0
ESLint 7.9.0
node 10.22.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingSomething isn't workingpackage: scope-managerIssues related to @typescript-eslint/scope-managerIssues related to @typescript-eslint/scope-managerpackage: typescript-estreeIssues related to @typescript-eslint/typescript-estreeIssues related to @typescript-eslint/typescript-estree

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.