microsoft / microsoft/TypeScript

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

Aperta
#60,756 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Bug Domain: Module Resolution Needs Human Review Needs More Info
Lingua principale
Go
Stelle
111k
Fork
14.3k
Merge medio
1g 19h
PR unite (30g)
117

Descrizione

🔎 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",
    ]
}

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con la riproduzione usando src/vector.js, test/vector.test.js, la ridenominazione che differisce solo per le maiuscole/minuscole in src/Vector.js e il tsconfig.json fornito su Windows. Traccia la gestione dell’import aggiornato da parte del compilatore e verifica che l’import con maiuscole/minuscole corrispondenti non produca errori dopo la ridenominazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, typescript
Ambito
compilers, operating-systems
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.