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-redundant-type-constituents issue within declare module statement #11233

Closed as not planned
Labels
bugSomething isn't workingexternalThis issue is with another package, not typescript-eslint itselfpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin
@ernestostifano

Description

@ernestostifano

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

  1. Clone the repo.
  2. SeeREADME.md.

Versions

packageversion
@typescript-eslint/eslint-plugin8.32.1
TypeScript5.8.3
ESLint9.27.0
node22.6.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingexternalThis issue is with another package, not typescript-eslint itselfpackage: 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