Advertisement · 728 × 90
#
Hashtag
#fukts
Advertisement · 728 × 90
Preview
no-floating-promises | typescript-eslint Require Promise-like statements to be handled appropriately.

型情報が必要なルールの例 #fukts
typescript-eslint.io/rules/no-flo...

1 0 0 0

eslint の明確な利点は型を参照するルールが使えるところ
#fukts

0 0 0 0

結論: Biome or Deno を使おう #fukts

1 0 0 0

eslint の設定本質でないわりに難しすぎる、わかりみが深い
#fukts

0 0 0 0

Eslintに対してテストを書くっていうのがなるほどという感じ
#fukts

0 0 0 0

「もう Biome でいいと思う」
#fukts

1 0 0 0

サブプロジェクトは運用負荷を軽減するのが大事
#fukts

0 0 0 0

そうか最終的にオブジェクトを export してるだけだから値として出力できるのか
#fukts

0 0 0 0

データ構造はシンプルに保ちつつヘルパーを追加する戦略、よい
#fukts

0 0 0 0

eslintrc はカスケードが複雑すぎて実際に適用されるルールを計算するのがつらかったらしい
#fukts

0 0 0 0

airbnbのEslintの設定、結構好きだったんだけど
更新されないからな...
#fukts

0 0 0 0

flat config への移行こないだ試みたけどムズすぎて棚上げしました...
#fukts

0 0 0 0

airbnb が更新されなくてつらい、わかる
#fukts

0 0 0 0

CommonJSとESMがぶつかるやつやったことあるから
あれなんとかできるんだって思った
#fukts

0 0 0 0

「実は今骨折してます」
#fukts

0 0 0 0

top-level await がいちばん嬉しいのはたぶんエントリポイント
#fukts

0 0 0 0
Preview
esm: 'module.exports' export on ESM CJS wrapper by guybedford · Pull Request #53848 · nodejs/node This provides a 'module.exports' export on the wrapper namespaces created for CommonJS modules when they are imported into ES modules. This mirrors the PR at #54563, which was split out fro...

Node.js の require(esm) には面白い機能が入っていて、ES Modules で

class Foo {}
export { Foo as "module.exports" };

と書くと CommonJS で Namespace Object の代わりに直接読み込めたりしますね。 #fukts
github.com/nodejs/node/...

1 0 0 0

require(esm)!!!! #fukts

0 0 0 0

CJS/ESM、雰囲気で向き合っている #fukts

1 0 0 0

CommonJS なプロジェクトで ES Modules を Dynamic Import しようとしたら tsc が require に変換して駄目だった。 #fukts

0 0 0 0

「dynamic import をするだけのパッケージを作ってトランスパイルを回避」
#fukts

0 0 0 0

dual package はそれはそれでオブジェクトの実体がズレたり
#fukts

0 0 0 0

そういえば先日 `require(esm)` が規定で有効になりました
#fukts

0 0 0 0

NestJS は CommonJS パッケージ。 #fukts

0 0 0 0

「vscode でプレゼンをします」
#fukts

0 0 0 0

パフォーマンスを出すためにネイティブ実装を利用するのはアイデアとしてはストレートだけど、わりと考慮しなきゃならない要素も多いしいざ実装するとたいへんそう
#fukts

0 0 0 0

「どこかのJSCを触っている人が同じように最適化してる」 #fukts

0 0 0 0

「こんな TypedArray 書かないでください」
#fukts

0 0 0 0

align するときのオーバーヘッドどれくらいなのかな
#fukts

0 0 0 0

indexOf が存在しない要素に undefined ではなく -1 を返す仕様でバグ生やしたプログラマは多い(諸説)
#fukts

0 0 0 0