Closed akabekobeko closed 3 years ago
数式対応で以下の変更をおこなっていた。しかし目的が異なるためリファクタリング用 PR として切り分ける。
HastNode
hast
Element
undefined
src/utils/debug.ts
src/util.ts
utils/
export
util.ts
inspect
debug.enabled: true
console
package-lock.json
.gitignore
yarn.lock
yarn
npm
数式対応で以下の変更をおこなっていた。しかし目的が異なるためリファクタリング用 PR として切り分ける。
HastNode
を定義していたがhast
に対応するElement
が存在するため、そちらを参照するようにしたhast
として型を公開しているなら汎用性の面から優先したほうがよいと判断Element
のほうが型として厳密なので、より明示的にundefined
をチェックするようにしたsrc/utils/debug.ts
をsrc/util.ts
に変更utils/
に他のファイルを追加する予定がないexport
可能なので必要になるまで単体のutil.ts
ファイルで十分export
しているinspect
も将来は廃止するかもしれないdebug.enabled: true
の状態でコミットする危険性があるconsole
系でも十分な情報を得られるうえ、これは ESLint が警告してくれるpackage-lock.json
を削除して.gitignore
へ追加yarn.lock
があるため冗長yarn
ではなくnpm
コマンドを利用しているため生成 & コミットしてしまったyarn
でいいのか?というのはある