Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
typescript
✓ { "dictionaries": ["typescript"] }
✗ import { typescript } from '@cspell/dict-typescript';
This package is a dictionary extension for `cspell`, not a JavaScript module. Its "import" is configured within `cspell.json` or editor settings (e.g., VS Code's `cSpell.dictionaries` setting) by referencing its name 'typescript'.
cspell-ext.json
✓ { "import": ["<path to node_modules>/@cspell/dict-typescript/cspell-ext.json"] }
✗ require('@cspell/dict-typescript/cspell-ext.json');
For manual configuration or older `cspell` setups, the dictionary's configuration can be directly imported into `cspell.json` using the `import` array, specifying the path to the `cspell-ext.json` file within the installed package.
cspell-dict-typescript-link
✓ npm install -g @cspell/dict-typescript
cspell-dict-typescript-link
✗ import cspellDictTypescriptLink from 'cspell-dict-typescript/link';
For global installation and integration with `cspell`, a CLI tool `cspell-dict-typescript-link` is provided to register the dictionary with `cspell`'s global settings. This is a shell command, not a JavaScript import.
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}"
cspell --version
Debug
Known issues
gotchaThe package name in the npm registry is `@cspell/dict-typescript` (version 3.2.3), differing from the provided `cspell-dict-typescript` (version 1.1.5). Always use `@cspell/dict-typescript` for installation to get the latest and correct package.fixEnsure you install `@cspell/dict-typescript` using `npm install @cspell/dict-typescript` or `yarn add @cspell/dict-typescript`.
affects: <=3.2.3
gotchaNewer versions of `cspell` (v6.x and above) often bundle many common dictionaries, including `typescript`. You might not need to install `@cspell/dict-typescript` explicitly if your `cspell` version already includes it, as this can lead to redundant dictionary loading or configuration conflicts.fixCheck your `cspell` installation's bundled dictionaries first. If 'typescript' is already listed, you may not need to install this package. Consult the `cspell` documentation for your version.
affects: >=6.0.0 (for cspell)
gotchaWhen configuring in `cspell.json` or similar files, you enable the dictionary by its short name `typescript` in the `dictionaries` array. Attempting to use the full package name (`@cspell/dict-typescript`) or a file path directly in this array will not work for dictionary loading.fixEnsure your configuration uses `"dictionaries": ["typescript"]` and not `"dictionaries": ["@cspell/dict-typescript"]`.
affects: All versions
Errors
Common errors & fixes
Error: Dictionary 'typescript' not found.
The `@cspell/dict-typescript` package is not installed, or `cspell` cannot locate it based on your configuration or global link setup.
fixEnsure the package is installed: `npm install @cspell/dict-typescript` (local) or `npm install -g @cspell/dict-typescript && cspell-dict-typescript-link` (global). Verify your `cspell.json` properly references `"dictionaries": ["typescript"]`.
cspell-dict-typescript-link: command not found
The global linking command `cspell-dict-typescript-link` is not available in your system's PATH, usually because the package was not installed globally or the global binaries directory is not in your PATH.
fixInstall the package globally: `npm install -g @cspell/dict-typescript`. If the problem persists, ensure your npm global binaries directory is correctly added to your system's PATH environment variable.
Audit
Dependencies
cspellrequiredThis package provides a dictionary for the `cspell` spell checker, and thus `cspell` (version >=8) is a runtime dependency for its functionality.