Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Both commands fail on an unsaved tab (cjs-to-es6 None, TypeError)

オープン 初心者向け
#2 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
1/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
tooling

調査の方向性

JsModules.pyから始めます。ここではjs_modules_dirがView.file_name()を呼び出し、その結果をos.path.dirnameに渡しています。レポートによると、ファイルコマンドもNoneをcjs-to-es6に渡しているため、こちらも調べてください。名前のないタブで両方のコマンドを再現し、未保存のビューに対するSublime Text APIの動作を確認してください。両方のコマンドが、エラーを発生させず、Noneを指定してコンバーターを呼び出すこともなく、未保存のタブを処理できれば完了です。

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

説明

Claude reports: both commands fail on an unsaved tab. "JsModules: Convert file to ES module" runs cjs-to-es6 None, and "JsModules: Convert all files in current directory to ES module" raises a TypeError.

Tested with JsModules 0.0.2 on Sublime Text 4215 (Windows), with cjs-to-es6 installed globally with npm. In a new untitled tab:

js_modules_file prints Running cjs-to-es6 None in the console, and the exec panel shows jscodeshift's usage text with "Found 0 files" and "Error: You have to provide at least one file/directory to transform."

js_modules_dir raises in the console:

  File ".../JsModules.py", line 15, in run
    active_dir = os.path.dirname(self.view.file_name())
TypeError: expected str, bytes or os.PathLike object, not NoneType

View.file_name() returns None for a buffer that is not on disk (https://www.sublimetext.com/docs/api_reference.html#sublime.View.file_name). A check for None with a status message, or is_enabled() returning False when there is no file, would avoid both.

主要言語
Python
スター
0
フォーク
0
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

luwes/SublimeJsModules のほかの issue

luwes/SublimeJsModules の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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