microsoft / microsoft/TypeScript

Filename with two dollar signs ($$) behaves differently when using paths config

Ouverte
#61,538 0 commentaires 2 réactions 1 personne assignée Voir sur GitHub

@andrewbranch y travaille déjà.

Depuis le 9/4/2025.

Needs Investigation
Langage dominant
Go
Étoiles
111k
Forks
14.3k
Merge moyen
2 j 4 h
PR mergées (30 j)
132

Description

### 🔎 Search Terms

"dollar signs", "two dollar signs", "$$", "paths config"

### 🕗 Version & Regression Information

- This is the behavior in every version I tried, and I reviewed the FAQ for entries about (nothing relevant found in FAQ)

### ⏯ Playground Link

https://github.com/its-jman/ts-dollar-import-repro

### 💻 Code

```ts
// The files: "code", "$code", and "$$code" all exist. "$$$$code" does not.
// However, the first line is the only one that has an error:
// "'"~server/$$code"' has no exported member named 'test2'. Did you mean 'test1'?"
import {test2 as test2_error} from "~server/$$code"
import {test2 as test2_working} from "~server/$$$$code"
import {test1} from "~server/$code"
import {test0} from "~server/code"

import {test2 as test2_2} from "./server/$$code"
import {test1 as test1_2} from "./server/$code"
import {test0 as test0_2} from "./server/code"
```

### 🙁 Actual behavior

It appears that `$$` gets escaped / interpreted as reduced to a single `$` but ONLY when using paths config.

### 🙂 Expected behavior

The filename imported matches the filename that you've written.

### Additional information about the issue

Suggested cause / solution mentioned in responses on TS Discord here: https://discord.com/channels/508357248330760243/1357697438990995488/1357697438990995488

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.