cspell
- Version 9.2.0
- Published
- 196 kB
- 18 dependencies
- MIT license
Install
npm i cspell
yarn add cspell
pnpm add cspell
Overview
A Spelling Checker for Code!
Index
Functions
Interfaces
Type Aliases
Functions
function checkText
checkText: ( filename: string, options: BaseOptions & LegacyOptions) => Promise<CheckTextResult>;
function createInit
createInit: (options: InitOptions) => Promise<void>;
function getDefaultReporter
getDefaultReporter: ( options: ReporterOptions, config?: CSpellReporterConfiguration) => CSpellReporter;
function lint
lint: ( fileGlobs: string[], options: LinterCliOptions, reporter?: CSpellReporter) => Promise<RunResult>;
function listDictionaries
listDictionaries: ( options: DictionariesOptions) => Promise<ListDictionariesResult[]>;
function parseApplicationFeatureFlags
parseApplicationFeatureFlags: (flags: string[] | undefined) => FeatureFlags;
function suggestions
suggestions: ( words: string[], options: SuggestionOptions) => AsyncIterable<TimedSuggestionsForWordResult>;
function trace
trace: ( words: string[], options: TraceOptions) => AsyncIterableIterator<TraceWordResult>;
Interfaces
interface BaseOptions
interface BaseOptions {}
property color
color?: boolean | undefined;
Use color in the output.
true
to force color,false
to turn off color.undefined
to use color if the output is a TTY.
property config
config?: string;
Path to configuration file.
property defaultConfiguration
defaultConfiguration?: boolean;
Load the default configuration true
property exitCode
exitCode?: boolean;
Return an exit code if there are issues found. true
property flag
flag?: string[];
Execution flags. Used primarily for releasing experimental features. Flags are of the form key:value
property languageId
languageId?: string;
Programming Language ID.
property locale
locale?: string;
Locale to use.
property validateDirectives
validateDirectives?: boolean;
Check In-Document CSpell directives for correctness.
interface CSpellApplicationOptions
interface LinterCliOptions extends LinterOptions {}
property configSearch
configSearch?: boolean;
Prevents searching for local configuration files
When
--no-config-search
is passed on the command line, this will betrue
. If the flag is not passed, it defaults tofalse
.
property issues
issues?: boolean;
Show issues
property issuesSummaryReport
issuesSummaryReport?: boolean;
Generate a summary report of issues.
property issueTemplate
issueTemplate?: string;
Set the template to use when reporting issues.
The template is a string that can contain the following placeholders: -
$filename
- the file name -$col
- the column number -$row
- the row number -$text
- the word that is misspelled -$message
- the issues message: "unknown word", "word is misspelled", etc. -$messageColored
- the issues message with color based upon the message type. -$uri
- the URI of the file -$suggestions
- suggestions for the misspelled word (if requested) -$quickFix
- possible quick fixes for the misspelled word. -$contextFull
- the full context of the misspelled word. -$contextLeft
- the context to the left of the misspelled word. -$contextRight
- the context to the right of the misspelled word.Color is supported using the following template pattern: -
{<style[.style]> <text>}
- where<style>
is a style name and<text>
is the text to style.Styles -
bold
,italic
,underline
,strikethrough
,dim
,inverse
-black
,red
,green
,yellow
,blue
,magenta
,cyan
,white
Example:
Example 1
"{green $filename}:{yellow $row}:{yellow $col} $message {red $text} $quickFix {dim $suggestions}" 8.12.0
property legacy
legacy?: boolean;
Show legacy output
property mustFindFiles
mustFindFiles?: boolean;
Files must be found or cli will exit with an error.
property progress
progress?: boolean;
Show progress
property relative
relative?: boolean;
issues are shown with a relative path to the root or
cwd
property report
report?: ReportChoices | undefined;
property showPerfSummary
showPerfSummary?: boolean;
Generate a summary report of performance.
property silent
silent?: boolean;
Run in silent mode. false
property stopConfigSearchAt
stopConfigSearchAt?: string[];
Directory paths at which CSpell should stop searching for configuration files.
These are set via one or more
--stop-config-search-at <dir>
CLI options. If no flags are passed, this will beundefined
.
property summary
summary?: boolean;
Show summary at the end
interface CSpellReporterConfiguration
interface CSpellReporterConfiguration extends Readonly<ReporterConfiguration>, Readonly<LinterCliOptions> {}
property console
readonly console?: ReporterConsole;
The console to use for reporting. 8.11.1
interface CSpellReporterModule
interface CSpellReporterModule {}
property getReporter
getReporter: <T>( settings: T, config: CSpellReporterConfiguration) => CSpellReporter;
interface TraceOptions
interface TraceOptions extends BaseOptions {}
property all
all?: boolean;
Show all dictionaries, not just the ones that contain the words or are enabled.
property allowCompoundWords
allowCompoundWords?: boolean;
Enable the
allowCompoundWords
option.
property dictionary
dictionary?: string[] | undefined;
Names of dictionaries to use.
property dictionaryPath
dictionaryPath?: 'hide' | 'long' | 'short' | 'full';
Configure how to display the dictionary path.
property ignoreCase
ignoreCase?: boolean;
Ignore case and accents when searching for words.
property onlyFound
onlyFound?: boolean;
Show only dictionaries that contain the words. If
all
is set, this option is ignored.
property stdin
stdin?: boolean;
Use stdin for the input.
Type Aliases
type AppError
type AppError = NodeJS.ErrnoException;
type CheckTextResult
type CheckTextResult = CheckTextInfo;
Package Files (3)
Dependencies (18)
Dev Dependencies (5)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/cspell
.
- Markdown[](https://www.jsdocs.io/package/cspell)
- HTML<a href="https://www.jsdocs.io/package/cspell"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 3438 ms. - Missing or incorrect documentation? Open an issue for this package.