Skip to content

Instantly share code, notes, and snippets.

@koshigoe
Created January 17, 2024 09:30
Show Gist options
  • Save koshigoe/e17b6d9757216476476cbc46f6851c79 to your computer and use it in GitHub Desktop.
Save koshigoe/e17b6d9757216476476cbc46f6851c79 to your computer and use it in GitHub Desktop.

textlint の --cache オプションが活きるのは、検査対象のファイルのタイムスタンプを維持できる環境だけということかな。

# https://github.com/textlint/textlint/blob/835269c28b9369ed9472516682f21fa712d46d66/packages/textlint/src/engine/execute-file-backers/cache-backer.ts#L23C26-L23C40
this.fileCache = fileEntryCache.create(config.cacheLocation);

usecheckSum: Whether to use md5 checksum to verify if file changed. If false the default will be to use the mtime and size of the file. https://github.com/jaredwray/file-entry-cache?tab=readme-ov-file#createcachename-directory-usechecksum

ググってたどり着いた記事に「変更したファイル」が対象になると書かれてたから期待したんだけど、コストの都合で内容(ハッシュ値)まではみてない感じかな。

毎回このコマンドを付けて実行すれば変更したファイルのみがチェック対象になるので、実行時間が高速化されます。 https://efcl.info/2016/12/28/textlint-cache/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment