Open t-yng opened 3 years ago
mispellを使った感想
cat index.ts | mispell
setsupport
などをミススペルとして判定してくれないmispell -i 'hoge,fuga'
と指定する必要があり管理がしづらいcspellを使った感想
setsupport
などもミススペルとしてチェックしてくれるcspellを使う
cspellだと弱い気がしたので再検討する
cspellは setsupport
などの 複合語に対しての提案が support
などになってしまうので弱い。
可能なら、 setsupport
=> setSupport
などにしたい。
codespell
スペルミスだと判定されるのが、かなり甘いイメージがあった。
$ codespell frontend/src/lib/validate/index.ts
frontend/src/lib/validate/index.ts:8: adn ==> and
const setsupport = (support) => console.log("hoge");
const helo = (name) => {
const unmunt = true;
console.log(name);
};
const adn = "";
const drodown = "";
const unSubscription = "";
helo("test");
nodehun
hunspellのNode.jsラッパー 渡した単語に対してのスペルチェックを実施するライブラリなので、ファイルの形態素解析などは自前で実装する必要がありそう。
eslint-plugin-spellchecker
実行結果が微妙だった
frontend/src/lib/validate/index.ts
1:7 warning You have a misspelled word: setsupport on Identifier spellcheck/spell-checker
1:45 warning You have a misspelled word: hoge on String spellcheck/spell-checker
3:7 warning You have a misspelled word: helo on Identifier spellcheck/spell-checker
4:11 warning You have a misspelled word: unmunt on Identifier spellcheck/spell-checker
8:7 warning You have a misspelled word: adn on Identifier spellcheck/spell-checker
9:7 warning You have a misspelled word: drodown on Identifier spellcheck/spell-checker
11:7 warning You have a misspelled word: un on Identifier spellcheck/spell-checker
13:1 warning You have a misspelled word: helo on Identifier spellcheck/spell-checker
候補のスペルチェックのCLIツール