-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuebugSomething isn't workingSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
Description
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
Repro Code
export const x = 0;
export const y = 0;
// no error, works as expected
export type Ident = <T>(x: T) => T;
// no error, works as expected
export interface Obj {
add: (x: number, y: number) => number;
}
export const someFunc: {
// error 'x' is already declared in the upper scope
// error not expected
<T>(x: T): T;
// error 'x' is already declared in the upper scope
// error 'y' is already declared in the upper scope
// error not expected
<T>(x: T, y: number): T | number;
} = (a, b?: number) => b ?? a;
export interface IFunc {
// error 'x' is already declared in the upper scope
// error not expected
<T>(x: T): T;
// error 'x' is already declared in the upper scope
// error 'y' is already declared in the upper scope
// error not expected
<T>(x: T, y: number): T | number;
}
export type TFunc = {
// error 'x' is already declared in the upper scope
// error not expected
<T>(x: T): T;
// error 'x' is already declared in the upper scope
// error 'y' is already declared in the upper scope
// error not expected
<T>(x: T, y: number): T | number;
}
ESLint Config
module.exports = {
"rules": {
"@typescript-eslint/no-shadow": [
"error",
{
"ignoreTypeValueShadow": false,
"ignoreFunctionTypeParameterNameValueShadow": true
}
]
}
}
tsconfig
Expected Result
with ignoreFunctionTypeParameterNameValueShadow
set to true,
expected no errors when shadowing variables in function interface parameters
Actual Result
with ignoreFunctionTypeParameterNameValueShadow
set to true,
received errors when shadowing variables in function interface parameters
Additional Info
was working as expected in v5.42.1, errors as of v5.43.0
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
5.44.0 |
@typescript-eslint/parser |
5.44.0 |
TypeScript |
4.8.4 |
ESLint |
8.15.0 |
node |
web |
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuebugSomething isn't workingSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin