doc: Error for "." and ".." specifiers differs from documented Resolver Algorithm
まだ誰も着手していません。
- 主要言語
- JavaScript
- スター
- 122k
- フォーク
- 37.3k
- 平均マージ
- 4日 2時間
- マージ済み PR(30日)
- 283
説明
- Version: ✍️
16.7.0
- Platform: ✍️
Linux penguin 5.4.119-14945-gafc97d54f809 #1 SMP PREEMPT Tue Aug 10 21:49:04 PDT 2021 x86_64 GNU/Linux
- Subsystem: ✍️
module
Location
Affected URL(s):
Description
I'm not sure if this is a bug with the ESM resolver or with the docs but basically if we do:
import foo from ".";
Then Node throws a ERR_UNSUPPORTED_DIR_IMPORT error, based on a reading of the Resolver Algorithm I expected this to be ERR_INVALID_MODULE_SPECIFIER.
As CommonJS already treats require(".") and require("..") as directory imports the current behaviour in Node is probably the best, so the docs should be updated to reflect it. This would involve changing ESM_RESOLVE step 3 to:
- Otherwise, if specifier starts with "/", "./" or "../", or specifier equals "." or ".." then
Although if the current documented behaviour is the intended behaviour then the error needs updating.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
リンクされている esm.html セクションの ESM Resolver Algorithm 仕様から始め、手順 3 と "." および ".." に対して観測された import の動作を比較してください。文書化されたアルゴリズムとランタイムの動作のどちらが意図されたものかを確認し、その後、アルゴリズムと報告されたエラーが一致するようにドキュメントを更新してください。文書化された結果が Node の動作と一致した時点で issue は完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, node.js
- 領域
- backend, documentation
- issue の種類
- ドキュメント
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 68/100