Microsoft/TypeScript

Wrong import attribute typed as any, but should be typed as string

Open

#61,469 建立於 2025年3月23日

在 GitHub 查看
 (5 留言) (0 反應) (0 負責人)TypeScript (6,726 fork)batch import
Domain: ES ModulesHelp WantedPossible Improvement

倉庫指標

Star
 (48,455 star)
PR 合併指標
 (平均合併 6天 17小時) (30 天內合併 9 個 PR)

描述

🔎 Search Terms

According to the documentation at MDN for Import attributes, the attribute value ie. dataN is of typestring.

In my VSCode setup using Typescript 5.8.2, this is typed as any in my .ts file:

My tsconfig is as follows:

{
  "exclude": ["dist"],
  "compilerOptions": {
    "jsx": "react",
    "target": "ES2022",
    "module": "esnext",
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "moduleResolution": "node",
    "strict": true,
    "skipLibCheck": true,
    "noImplicitAny": true,
    "isolatedModules": false
  }
}

🕗 Version & Regression Information

  • This changed between versions ______ and _______
  • This changed in commit or PR _______
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
  • I was unable to test this on prior versions because _______

⏯ Playground Link

No response

💻 Code

// Your code here

🙁 Actual behavior

Import attribute is typed as any instead of string.

🙂 Expected behavior

Import attribute should be typed as string.

Additional information about the issue

No response

貢獻者指南