CSpell TypeScript Dictionary

1.1.5 · active · verified Sun Apr 19

@cspell/dict-typescript (current stable version 3.2.3) provides a specialized dictionary for spell-checking TypeScript and JavaScript-specific terms, keywords, and common libraries within projects using the `cspell` spell checker. As part of the larger `cspell-dicts` monorepo, it receives updates as new programming terms emerge, often aligned with the monorepo's generally frequent release cadence. This dictionary is crucial for developers seeking to reduce false positives and improve the accuracy of spell checks in JavaScript and TypeScript codebases, differentiating it from general English dictionaries by its focus on programming-specific vocabulary like "camelCase", "enum", "typedef", "ESM", and framework-specific terms. It acts as an extension to `cspell`, enhancing its ability to understand code context, helping maintain consistency and reduce errors in technical documentation and code comments.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to configure `cspell.json` to enable the `typescript` dictionary for a project. It assumes `cspell` is already installed or will be installed as a dev dependency alongside the dictionary package. This JSON configuration directs `cspell` to use the specialized dictionary when spell-checking TypeScript and JavaScript files.

{
  "$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
  "version": "0.2",
  "language": "en",
  "dictionaries": [
    "typescript" // Enable the TypeScript dictionary
  ],
  "words": [],
  "ignorePaths": [
    "node_modules",
    "dist",
    "build",
    "coverage"
  ]
}

// To use this, first install cspell and the dictionary:
// npm install -D cspell @cspell/dict-typescript
// Then run cspell:
// npx cspell "**/*.{ts,tsx,js,jsx}"

view raw JSON →