Closed as not planned
Closed as not planned
Copy link
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.
Issue Description
./src/modules.d.ts
declare module 'my-module' {
import {EMyEnum} from './common.types.js';
// INCORRECT: ESLINT HIGHLIGHTS AN ERROR
function externalFunction(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 ERROR
externalFunction('TEST');
// CORRECT: TS HIGHLIGHTS ERROR BECAUSE THE ARGUMENT MUST BE AN ENUM
internalFunction('TEST');
./src/utilities.ts
import {EMyEnum} from './common.types.js';
function internalFunction(arg: EMyEnum | null): void {
console.log(arg);
}
export {internalFunction};
./src/common.types.ts
enum EMyEnum {
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 |
Metadata
Metadata
Assignees
Labels
Something isn't workingSomething isn't workingThis issue is with another package, not typescript-eslint itselfThis issue is with another package, not typescript-eslint itselfIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin