SuperAPI AI 工具集

typescript-style

编程与开发

查看项目

更新于 10-15 20:28

技能介绍

用途:该技能用于 kickstart-next 项目中的 TypeScript 风格与类型约定,适合在修改 tsconfig.json 或 eslint.config.mjs,以及为 Contentstack 条目或 Live Preview 字段元数据添加、调整 TypeScript 类型时使用。

编译器选项:tsconfig.json 中 strict 为 true,noEmit 为 true,moduleResolution 使用 bundler,jsx 使用 react-jsx,paths 包含 @/* 映射到 ./。include 模式覆盖 **/.ts、**/*.tsx 以及 .next 下由 Next 生成的类型。

ESLint:eslint.config.mjs 组合了 eslint-config-next 的 core-web-vitals 与 typescript 预设。@typescript-eslint/no-explicit-any 被显式设为 off;项目建议避免无理由引入 any,但不会因此导致 lint 失败。

内容模型:优先扩展 lib/types.ts 来定义由 stack 支撑的结构(Page、blocks、files、CSLP $ 映射)。当 Live Preview 需要新的可编辑区域时,在接口上添加对应的 $ 字段形状。

限制:资料未提供更多关于具体类型定义、完整配置内容或版本要求的信息。