Skip to content

[no-shadow.ignoreTypeValueShadow] false positive against imported types #3862

@ghost

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

{
  "rules": {
   "@typescript-eslint/no-shadow": [
      "error",
      { "ignoreTypeValueShadow": true }
    ]
  }
}
import type { foo } from './foo';
type bar = number;

// 'foo' is already declared in the upper scope
// 'bar' is fine
function doThing(foo: number, bar: number) {}

tsconfig:

{
  "extends": "@tsconfig/node16/tsconfig.json",
  "compileOnSave": true,
  "compilerOptions": {
    "baseUrl": "./",
    "composite": true,
    "esModuleInterop": true,
    "exactOptionalPropertyTypes": true,
    "experimentalDecorators": true,
    "forceConsistentCasingInFileNames": true,
    "importHelpers": true,
    "isolatedModules": true,
    "module": "ESNext",
    "moduleResolution": "node",
    "noEmit": true,
    "noImplicitAny": true,
    "noImplicitOverride": true,
    "noImplicitReturns": true,
    "noImplicitThis": true,
    "noUncheckedIndexedAccess": true,
    "noUnusedLocals": true,
    "paths": {
      "@applications/*": ["src/applications/*"],
      "@modules/*": ["src/modules/*"],
      "package.json": ["package.json"]
    },
    "resolveJsonModule": true,
    "rootDirs": [".", "src/modules/seams"],
    "strict": true,
    "typeRoots": ["src/modules/@types", "node_modules/@types"]
  },
  "exclude": ["**/node_modules", "**/build", "**/dist"],
  "include": ["src/**/*", "./*", "./*.json", "config/*", "config/*.json"]
}

Expected Result

rule should ignore imported types just like it ignores types defined in the file

Versions

package version
@typescript-eslint/eslint-plugin 4.31.0
@typescript-eslint/parser 4.31.0
TypeScript 4.4.2
ESLint 7.32.0
node 16.8.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy