8000 [no-shadow.ignoreTypeValueShadow] false positive against imported types · Issue #3862 · typescript-eslint/typescript-eslint · GitHub
[go: up one dir, main page]

Skip to content
[no-shadow.ignoreTypeValueShadow] false positive against imported types #3862
Closed
@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

      0