Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed as not planned
Closed as not planned
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 havesearched for related issues and found none that matched my issue.
- I haveread the FAQ and my problem is not listed.
Issue Description
./src/modules.d.ts
declare module'my-module'{import{EMyEnum}from'./common.types.js';// INCORRECT: ESLINT HIGHLIGHTS AN ERRORfunctionexternalFunction(arg:EMyEnum|null):void;export{externalFunction};}
ESLint: 'EMyEnum' is an 'error' type that acts as 'any' and overrides all other types in this union type. (@typescript-eslint/no-redundant-type-constituents)
It also seems to be an issue in TS:
./src/index.ts
import{externalFunction}from'my-module';import{internalFunction}from'./utilities.js';// INCORRECT: TS DOES NOT HIGHLIGHT THE ERRORexternalFunction('TEST');// CORRECT: TS HIGHLIGHTS ERROR BECAUSE THE ARGUMENT MUST BE AN ENUMinternalFunction('TEST');
./src/utilities.ts
import{EMyEnum}from'./common.types.js';functioninternalFunction(arg:EMyEnum|null):void{console.log(arg);}export{internalFunction};
./src/common.types.ts
enumEMyEnum{Value='value'}export{EMyEnum};
Reproduction Repository Link
https://github.com/ernestostifano/typescript-eslint-issue-1
Repro Steps
- Clone the repo.
- See
README.md
.
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin | 8.32.1 |
TypeScript | 5.8.3 |
ESLint | 9.27.0 |
node | 22.6.0 |