Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Bug: [typescript-eslint/no-shadow] Rest (...args) parameter name in generic declaration shadows actual parameter name #5853

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

Description

@andsens

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 havesearched for related issues and found none that matched my issue.
  • I haveread the FAQ and my problem is not listed.

Playground Link

https://typescript-eslint.io/play/#ts=4.8.4&sourceType=module&code=PTAEDEEMEsBsGdQHdoBcAWoBEBySAnAc3h1GkUlnwFNIATAT1DuoGNYDq6yA7UDaqACuABxHV8oeKwD240DL6xoPQQCZQs2EIC2fAGwBWAHRYAUADMhPVqmiL+1eKihwAjAB5woagA9U1Dx0iAAUxuEExABcoJA8DADaALoAlKAAvAB8sfGZIRY8MeAANKDhxpHwMXGJqaAA3magoDSoQvh8CQWllUkA3GYAvmZmIBAwCMhomHhEJGQUVLSMzGwcNNwq-OiCouKS0nKCDsqqoADsmjLaeqD6asaW1rb2fAHOrrBqXj7+gcGgMIRObVeLJNJZHIMPIFIo9EFQ8ENJotahtDqgLo8eHEfpDEZjAAiMicoB4MlQoAsEyeNjsDneqAA6jJ8ABreA-PwBIKhSqghgQ7I1GGFCClcr8xF1RrNVrtTrdWJzPHDIA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUBILkB2A9gLTIAWAhgCYEDu6UBAZo5ADQg6QACALgJ4AHFAGNoASwE8iKeGLw8A9IRIVqdDJETRoBaJHBgAviENA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYwYAviDUA

Repro Code

// Fails with "'args' is already declared in the upper scope on line 2 column 65."functiontestFail1<Fextends(...args:any[])=>any>(fn:F, ...args:any[]){return[fn,args];}

ESLint Config

module.exports={parser:"@typescript-eslint/parser",rules:{"no-shadow":"off","@typescript-eslint/no-shadow":"error"},};

tsconfig

{"compilerOptions": {  }}

Expected Result

I expect no errors.

Actual Result

I get the error'args' is already declared in the upper scope on line 2 column 65.

Additional Info

The argument name in the generic has no effect on the rest of the code. Granted, it's a bit confusing to read, because the twoargs are completely unrelated, but there's no shadowing going on here.

Versions

packageversion
@typescript-eslint/eslint-plugin5.40.1
@typescript-eslint/parser5.40.1
TypeScript4.7.4
ESLint8.25.0
node16.18.0

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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp