raipiot infra 通用字典。
我们使用 CSpell 来对代码进行英文拼写检查,每次提交时会检查代码中是否存在英文单词拼写错误。
pnpm add -D cspell @raipiot-infra/cspell
在项目根目录添加 .cspell.json
文件,引入 @raipiot-infra/cspell
配置文件,内容如下:
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"version": "0.2",
"language": "en",
"dictionaries": ["custom-words"],
"dictionaryDefinitions": [
{
"name": "custom-words",
"path": ".cspell.txt",
"addWords": true
}
],
"import": ["@raipiot-infra/cspell"]
}
在 package.json
中添加 cspell
脚本:
{
"scripts": {
"cspell:check": "cspell --no-progress --show-suggestion --show-context --cache **"
}
}