typescript

star 1.0k

TypeScript coding standards and conventions including file naming rules

forcedotcom By forcedotcom schedule Updated 6/17/2026

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)
  • 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)
  • .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
Install via CLI
npx skills add https://github.com/forcedotcom/salesforcedx-vscode --skill typescript
Repository Details
star Stars 1,020
call_split Forks 455
navigation Branch main
article Path SKILL.md
More from Creator