Skip to main content

typescript

TypeScript coding standards and conventions including file naming rules

跳到安装

来源信息

仓库
forcedotcom/apex-language-support
最近来源活动
2026年6月23日 22:16
检测到的 SKILL.md 语言
英语
星标
11
分支
3

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

文件资源管理器
2 个文件

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
typescript
description
TypeScript coding standards and conventions including file naming rules
- new file copyright header: use year **2026** (e.g. `Copyright (c) 2026, salesforce.com, inc.`) - no barrel files - avoid type assertions (`as Foo` or `as unknown as` or `Foo!`). do guards or Effect.schema stuff (ex `is`) instead - no `void` for async - use async/effect (exception [vscode-window-messages](../vscode-window-messages/SKILL.md)) - no `export *` - name exports explicitly - prefer `undefined` over null (unless server requires null) - prefer `undefined` over empty string - prefer map/filter over loops/conditionals - avoid mutation - avoid `any` - no enums or namespaces (enums compile to weird JS; use string union types instead; exception: interfaces defined outside this repo that we can't change) - no runtime errors for developer mistakes (use types to ensure exhaustive switch/case; don't throw for null/undefined when input/consumer is within our control) - avoid fallbacks unless absolutely necessary — a fallback path is usually a bandaid on a bug that should be fixed upstream. Fix the root cause; don't paper over it with a default/alternate path that hides the real failure. If a fallback is genuinely required, comment why the upstream fix isn't possible. - .ts filenames: camelCase, no hyphens, no leading capitals - preserve comments when refactoring; remove if wrong/obsolete - exported functions: single-line jsdoc /\*_ foo _/ if name unclear; no params/return (TS provides types) - look for uses of (Object|Map).groupBy instead of older patterns LSP position indexing and VS Code web extension constraints: [references/lsp-and-web-extension.md](references/lsp-and-web-extension.md)
在 GitHub 查看