Skip to content

Bug: [no-unnecessary-qualifier] false positive for nested namespace #7192

Closed
@Jack-Works

Description

@Jack-Works

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have searched for related issues and found none that matched my issue.
  • I have read the FAQ and my problem is not listed.

Playground Link

https://typescript-eslint.io/play#ts=5.1.6&fileType=.tsx&code=CYUwxgNghgTiAEA7KBbEBnADlMCCC8A3vAL4BQoksCyaWO%2BAdAEJFnzwgAemA9jABd4AgJ6YEALXgBeeAEYy5MqPHwpsvC0YSyQA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Jge1tiacTJTIAhtEK0AjrCGMAZpUTR0UBdA6LwYAL4hNQA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false

Repro Code

declare namespace A { }
declare namespace A.B {
  export type Z = 1
}

type Z = A.B.Z

ESLint Config

module.exports = {
  "rules": {
    "@typescript-eslint/no-unnecessary-qualifier": "error"
  }
}

tsconfig

{
  "compilerOptions": {
    "strictNullChecks": true
  }
}

Expected Result

No error

Actual Result

Reports error

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions