Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>validatorBuilderNew to Visual Studio Code? Get it now.
validatorBuilder

validatorBuilder

klausbai0706

|
45 installs
| (0) | Free
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

validatorbuilder README

这是一款根据函数的返回值的typescript生成对应的class-validator的插件

Features

选择想要转化的函数名,cmd+p 输入> build validator等待片刻便可生成对应的class validator临时文件.需要注意的是,暂时没有做删除上一次生成的产物,所以如果保存了,后续需要手动删除,否则会产生错误。

Requirements

请安装typescript , ts-node

Extension Settings

暂无setting,考虑后续加入

Known Issues

  • 暂不支持literalType
  • 无法正常转化时缺少相应的提示
  • 层级遍历对应的tsconfig,时间较长,后续考虑在config中加入配置项,以便去除这一步的开支
  • 使用命令的形式较为繁琐
  • 当tsconfig.json无法被JSON.parse正常解析时会发生错误

Release Notes

1.0.0

提供了基础的validator转化能力,暂不支持literalType

Following extension guidelines

这原本着手于解决一些工作项目中重复中的工作,所以有时会缺少对更复杂情形的处理。如有任何问题,请及时反馈。klausbai0706@outlook.com

Working with Markdown

Note: You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:

  • Split the editor (Cmd+\ on macOS or Ctrl+\ on Windows and Linux)
  • Toggle preview (Shift+CMD+V on macOS or Shift+Ctrl+V on Windows and Linux)
  • Press Ctrl+Space (Windows, Linux) or Cmd+Space (macOS) to see a list of Markdown snippets

For more information

  • Visual Studio Code's Markdown Support
  • Markdown Syntax Reference

Enjoy!

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft