UNPKG

@cspell/eslint-plugin

Version:
45 lines 1.54 kB
import type { Options } from '../common/options.cjs'; export type SpellCheckOptions = Options & { cwd: string; }; interface ExtendedSuggestion { /** * The suggestion. */ word: string; /** * The word is preferred above others, except other "preferred" words. */ isPreferred?: boolean; /** * The suggested word adjusted to match the original case. */ wordAdjustedToMatchCase?: string; } export type Suggestions = ExtendedSuggestion[] | undefined; export interface SpellCheckIssue { /** the starting offset of the issue */ start: number; /** the ending offset of the issue */ end: number; /** the word that was flagged */ word: string; /** the severity of the issue. */ severity: 'Forbidden' | 'Unknown' | 'Hint'; /** suggestions to be presented. */ suggestions: Suggestions; /** The range of text in which this issue occurred. */ range: CheckTextRange; /** The index of the range in which this issues occurred. */ rangeIdx: number; } export interface SpellCheckResults { issues: SpellCheckIssue[]; errors?: Error[]; } export type CheckTextRange = readonly [number, number]; export type SpellCheckFn = typeof spellCheck; export type SpellCheckSyncFn = (...p: Parameters<SpellCheckFn>) => Awaited<ReturnType<SpellCheckFn>>; export declare function spellCheck(filename: string, text: string, ranges: CheckTextRange[], options: SpellCheckOptions): Promise<SpellCheckResults>; export {}; //# sourceMappingURL=spellCheck.d.mts.map