microsoft / microsoft/TypeScript

Typescript gets confused when renaming by only changing filename case of imported file on Windows

オープン
#60,756 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Bug Domain: Module Resolution Needs Human Review Needs More Info
主要言語
Go
スター
111k
フォーク
14.4k
平均マージ
1日 19時間
マージ済み PR(30日)
117

説明

🔎 Search Terms

windows rename already included

🕗 Version & Regression Information
  • 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

file src/vector.js

export default class Vector {}

file test/vector.test.js

import Vector from '../src/vector.js'
new Vector();

now rename the file

mv src/vector.js src/Vector.js

and update the file test/vector.test.js

import Vector from '../src/Vector.js'
new Vector();
🙁 Actual behavior

There is an error message:
Image

🙂 Expected behavior

No error message, as the imported file name matches the actual file name.

Additional information about the issue

tsconfig.json

{
    "compilerOptions": {
      "target": "ES2017",
      "module": "commonjs",
      "lib": ["es2017", "dom", "DOM.Iterable"],
      "allowJs": true,
      "checkJs": true,
      "skipLibCheck": true,
      "declaration": true,
      "noEmit": true,
      "strict": true,
      "baseUrl": ".",
      "typeRoots": [
        "./node_modules/@types",
      ],
      "esModuleInterop": true
    },
    "include": [
      "src/**/*.js",
      "test/**/*.js",
    ]
}

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Windows上で、src/vector.js、test/vector.test.js、src/Vector.jsへの大文字と小文字のみを変更するリネーム、および提供されたtsconfig.jsonを使って再現から始めます。更新されたimportをコンパイラがどのように処理するかを追跡し、リネーム後に大文字と小文字が一致するimportでエラーが発生しないことを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, typescript
領域
compilers, operating-systems
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。