Closed as not planned
Description
π Search Terms
"module declaration enum issue", "module declaration enum any"
π Version & Regression Information
Difficult to test in previous version because multi-file setup is required for reproduction.
β― Playground Link
https://github.com/ernestostifano/typescript-eslint-issue-1
π» Code
Issue Description
./src/common.types.ts
enum EMyEnum {
Value = 'value'
}
export {EMyEnum};
./src/utilities.ts
import {EMyEnum} from './common.types.js';
function internalFunction(arg: EMyEnum | null): void {
console.log(arg);
}
export {internalFunction};
./src/modules.d.ts
declare module 'my-module' {
import {EMyEnum} from './common.types.js';
function externalFunction(arg: EMyEnum | null): void;
export {externalFunction};
}
./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');
Reproduction Repository Link
https://github.com/ernestostifano/typescript-eslint-issue-1
Repro Steps
- Clone the repo.
- See
README.md
.
π Actual behavior
See above.
π Expected behavior
See above.
Additional information about the issue
Versions
package | version |
---|---|
TypeScript |
5.8.3 |
node |
22.6.0 |