microsoft / microsoft/TypeScript

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

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

@andrewbranch がすでに取り組んでいます。

2025年4月9日 から。

Needs Investigation
主要言語
Go
スター
111k
フォーク
14.3k
平均マージ
2日 4時間
マージ済み PR(30日)
132

説明

### 🔎 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

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

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

はじめの一歩

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

評価

この issue はまだ評価されていません。

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

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