Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Typescript Projects

Sketch was initially conceived as a typescript-centric tool, as I needed a way to deal with the chaotic typescript ecosystem in a structured and easily reproducible way.

It supports a rich feature set dedicated to typescript, with dedicated preset categories (such as tsconfig.json and package.json presets) and commands (such as generating individual config files from presets, or generating barrel files).

These are the top level configuration settings for Typescript projects, with their default values:

typescript:
  # Convert `latest` to a version range for dependencies
  no_convert_latest_to_range: false

  # Use this kind of version range when converting from `latest`
  version_range: minor

  # Do not add default dependencies to new `package.json` files (typescript and oxlint, plus vitest if enabled)
  no_default_deps: false

  # Use the pnpm catalog for default dependencies
  # and add missing dependencies to it automatically
  catalog: false

  package_manager: pnpm

  # Configuration for the generated pnpm-workspace.yaml file
  pnpm:
    # All dirs listed here will be created automatically
    packages: ["packages/*"]

  # A map containing extensible package.json presets
  package_json_presets: {}

  # A map containing extensible package presets
  package_presets: {}

  # A map containing extensible tsconfig presets
  ts_config_presets: {}

  # A map containing extensible oxlint presets
  oxlint_presets: {}

  # A map of contributors and maintainers, which can be referenced
  # in `package.json` presets with their ID
  people: {}