本项目是从 CorentinTh/it-tools fork
而来的。
推荐使用VSCode 进行开发,并建议安装以下扩展:
- Volar (and disable Vetur)
- TypeScript Vue Plugin (Volar).
- ESLint
- i18n Ally
并在VSCode的配置文件中添加:
{
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"i18n-ally.localesPaths": ["locales", "src/tools/*/locales"],
"i18n-ally.keystyle": "nested"
}
默认情况下,TypeScript无法处理.vue
导入的类型信息,因此我们将tsc
CLI替换为vue-tsc
进行类型检查。在编辑器中,我们需要 TypeScript Vue Plugin (Volar) ,以使typescript语言服务知道.vue
类型。
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a Take Over Mode that is more performant. You can enable it by the following steps:
如果你觉得独立的TypeScript插件不够快,Volar还实现了 托管模式 更具性能。您可以通过以下步骤启用它:
- 禁用内置的TypeScript扩展
- 在VSCode的指令输入框中输入
Extensions: Show Built-in Extensions
- 找到
TypeScript and JavaScript Language Features
,右键并选择Disable (Workspace)
- 在VSCode的指令输入框中输入
- 在指令输入框中输入
Developer: Reload Window
以重新加载VSCode。
npm install
npm run dev
npm run build
使用 Vitest 进行单元测试
npm run test
使用 ESLint 进行检查
npm run lint
如果要创建一个新的工具,可以运行预先设置好的脚本,运行以下指令:
npm run script:create:tool my-tool-name
它将在src/tools
中创建一个包含正确文件的目录,并在src/tools/index.ts
中创建导入。您只需要将导入的工具添加到适当的类别中并开发该工具。
本项目基于 GNU GPLv3 开源许可。