nodejs / nodejs/node

Warn when package.json contains an invalid "type" value

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

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

feature request never-stale
主要言語
JavaScript
スター
122k
フォーク
37.3k
平均マージ
4日 2時間
マージ済み PR(30日)
283

説明

What is the problem this feature will solve?

Valid (meaningful) values are:

  • commonjs
  • module

I had set CommonJS, and it behaves the same as if type was unset, which is so close to the actual commonjs behavior, that I thought I had set it correctly. But I kept having cases resulting in the MODULE_TYPELESS_PACKAGE_JSON warning, instead of failing hard.

Note that while tsconfig.js ignores case, the canonical version is CommonJS, so I never considered that I was using incorrect case.

What is the feature you are proposing to solve the problem?

Raise warning/error if "type" is set, but value is none of commonjs or module.

What alternatives have you considered?

No response

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

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

はじめの一歩

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

調査の方向性

まず、Node.js が package.json の type フィールドを処理し、MODULE_TYPELESS_PACKAGE_JSON 警告を出力する箇所を追跡します。この issue ではソースファイルもテストも指定されていないため、最初にその経路と既存のカバレッジを把握してください。commonjs と module 以外の値に対して選択した警告またはエラーの動作を定義してテストし、これらの正規の値は維持してください。

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

評価

技術スタック
javascript
領域
backend
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

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

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