Registry / testing / cspell-dict-typescript

cspell-dict-typescript

JSON →
library1.1.5jsnpmunverified

@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.

npm install cspell-dict-typescript
INSTALL
IMPORT
SIG · CSPELL-DICT-TYPESC
C
cspell-dict-typescript
testingjavascriptv1.1.5
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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
musl
node 18226 runs
build_error
glibc
node 18226 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.
fix
Ensure 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.
fix
Check 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.
fix
Ensure 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.
fix
Ensure 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.
fix
Install 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.
Upgrade
Version history
1.1.5latest on npm
Audit
Dependencies
cspellrequiredThis package provides a dictionary for the `cspell` spell checker, and thus `cspell` (version >=8) is a runtime dependency for its functionality.
Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources
cspell-dict-typescript — npm install cspell-dict-typescript · libregistry