TypeScript and JavaScript dictionary for cspell spell checking with configuration patterns for ignoring JS-specific syntax
npx @tessl/cli install tessl/npm-cspell--dict-typescript@3.2.0@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.
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 aboveAdd to your cspell.json:
{
"dictionaries": ["typescript"]
}Add to .vscode/settings.json:
{
"cSpell.dictionaries": ["typescript"]
}Add to cspell.config.yaml:
dictionaries:
- typescriptMain 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"]
}
]
}The package contains approximately 3,688 TypeScript and JavaScript programming terms including:
async, await, interface, type, namespaceArray, Promise, ArrayBuffer, BigInt, SymboladdEventListener, querySelector, innerHTMLReadonlyArray, Partial, Omit, PickBuilt-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"
}
]
}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:
.ts, .tsx.js, .jsx.tsx, .jsx.mdx.astroSpecific configuration overrides for certain file patterns:
{
"overrides": [
{
"filename": "**/*.astro",
"languageId": "astro"
}
]
}This dictionary integrates seamlessly with:
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 termspackage.json: Package metadata and exports configurationThe dictionary ignores these JavaScript/TypeScript constructs:
0xFF, 0xDEADBEEFn (including BigInt)\x41\u0041/pattern/gi, /test/dgimsuyThis package has no runtime dependencies and is designed to be lightweight and self-contained as part of the CSpell ecosystem.