CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-cspell--dict-typescript

TypeScript and JavaScript dictionary for cspell spell checking with configuration patterns for ignoring JS-specific syntax

Pending
Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

CSpell TypeScript Dictionary

@cspell/dict-typescript provides a comprehensive spell-checking dictionary specifically designed for TypeScript and JavaScript development environments. It contains a curated collection of programming terms, language keywords, API names, and commonly used identifiers to enable accurate spell-checking in development tools and editors.

Package Information

  • Package Name: @cspell/dict-typescript
  • Package Type: npm
  • Language: TypeScript/JavaScript (Dictionary Data)
  • Installation: Bundled with CSpell (no separate installation needed)

Core Imports

This package exports JSON configuration files, not JavaScript modules:

// Main configuration export
require("@cspell/dict-typescript") // → "./cspell-ext.json"
// Explicit configuration imports
require("@cspell/dict-typescript/cspell-ext.json")
require("@cspell/dict-typescript/cspell") // → same as above

Basic Usage

CSpell Configuration

Add to your cspell.json:

{
  "dictionaries": ["typescript"]
}

VS Code Settings

Add to .vscode/settings.json:

{
  "cSpell.dictionaries": ["typescript"]
}

YAML Configuration

Add to cspell.config.yaml:

dictionaries:
  - typescript

Capabilities

Dictionary Configuration

Main CSpell extension configuration providing dictionary definitions, patterns, and language settings for TypeScript and JavaScript spell checking.

{
  "id": "typescript",
  "name": "TypeScript/JavaScript",
  "description": "TypeScript and JavaScript dictionary.",
  "readonly": true,
  "dictionaryDefinitions": [
    {
      "name": "typescript",
      "path": "./dict/typescript.txt",
      "description": "TypeScript and JavaScript dictionary."
    }
  ],
  "patterns": [
    {
      "name": "js-hex-number",
      "pattern": "/\\b0[xX][a-fA-F0-9]+n?\\b/g",
      "description": "JavaScript Hexadecimal Number including BigInt."
    }
  ],
  "languageSettings": [
    {
      "languageId": "typescript,javascript,typescriptreact,javascriptreact,mdx,astro",
      "locale": "*",
      "ignoreRegExpList": ["js-hex-escape", "js-unicode-escape", "js-regexp-flags", "js-hex-number"],
      "dictionaries": ["typescript"]
    }
  ]
}

Dictionary Content

The package contains approximately 3,688 TypeScript and JavaScript programming terms including:

  • Language Keywords: async, await, interface, type, namespace
  • Built-in APIs: Array, Promise, ArrayBuffer, BigInt, Symbol
  • DOM APIs: addEventListener, querySelector, innerHTML
  • Framework Terms: Common identifiers from popular JavaScript frameworks
  • TypeScript Types: ReadonlyArray, Partial, Omit, Pick

Pattern Matching

Built-in regex patterns to ignore JavaScript-specific syntax during spell checking:

{
  "patterns": [
    {
      "name": "js-hex-number",
      "pattern": "/\\b0[xX][a-fA-F0-9]+n?\\b/g",
      "description": "JavaScript Hexadecimal Number including BigInt."
    },
    {
      "name": "js-hex-escape",
      "pattern": "/\\\\x[a-f0-9]{2}/gi",
      "description": "JavaScript String Hexadecimal Escape sequence."
    },
    {
      "name": "js-unicode-escape",
      "pattern": "/\\\\u[a-f0-9]{4}/gi",
      "description": "JavaScript String Unicode Escape sequence."
    },
    {
      "name": "js-regexp-flags",
      "pattern": "/\\/[dgimsuy]{1,7}\\b(?=(?:\\.flags\\b)|\\s*$|[;),])/g",
      "description": "JavaScript Match Regular Expression Flags"
    }
  ]
}

Language Support

Provides spell checking configuration for multiple language types:

{
  "languageSettings": [
    {
      "languageId": "typescript,javascript,typescriptreact,javascriptreact,mdx,astro",
      "locale": "*",
      "ignoreRegExpList": ["js-hex-escape", "js-unicode-escape", "js-regexp-flags", "js-hex-number"],
      "dictionaries": ["typescript"]
    },
    {
      "languageId": "astro",
      "dictionaries": ["html", "html-symbol-entities"]
    }
  ]
}

Supported file types:

  • TypeScript: .ts, .tsx
  • JavaScript: .js, .jsx
  • React: .tsx, .jsx
  • MDX: .mdx
  • Astro: .astro

File Overrides

Specific configuration overrides for certain file patterns:

{
  "overrides": [
    {
      "filename": "**/*.astro",
      "languageId": "astro"
    }
  ]
}

Integration

This dictionary integrates seamlessly with:

  • CSpell: Command-line spell checker
  • VS Code: Code Spell Checker extension
  • Build Tools: CI/CD pipeline spell checking
  • Editors: Any editor supporting CSpell configuration

File Structure

The package includes these key files:

  • cspell-ext.json: Main configuration export (3 export paths point to this)
  • dict/typescript.txt: Dictionary file with ~3,688 terms
  • package.json: Package metadata and exports configuration

Pattern Examples

The dictionary ignores these JavaScript/TypeScript constructs:

  • Hexadecimal numbers: 0xFF, 0xDEADBEEFn (including BigInt)
  • Hex escape sequences: \x41
  • Unicode escape sequences: \u0041
  • RegExp flags: /pattern/gi, /test/dgimsuy

Dependencies

This package has no runtime dependencies and is designed to be lightweight and self-contained as part of the CSpell ecosystem.

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/@cspell/dict-typescript@3.2.x
Publish Source
CLI
Badge
tessl/npm-cspell--dict-typescript badge