-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
spell-checker.d.ts
71 lines (67 loc) · 2.5 KB
/
spell-checker.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import { LiteralUnion } from '../../utility-types';
import type { RuleConfig } from '../rule-config';
/**
* Option.
*/
export type SpellCheckerOption = {
/** Check Spelling inside comments. */
comments?: boolean;
/** Check Spelling inside strings. */
strings?: boolean;
/** Check Spelling inside identifiers. */
identifiers?: boolean;
/** Exclude `require()` imports from spell-checking. Useful for excluding NPM package name false-positives. */
ignoreRequire?: boolean;
/**
* Check Spelling inside ES6 templates you should enable parser options for ES6 features for this to work.
*
* @see [specifying-parser-options](http://eslint.org/docs/user-guide/configuring#specifying-parser-options)
*/
templates?: boolean;
/**
* Choose the language you want to use.
*
* Options are: "en_US", "en_CA", "en_AU", and "en_GB".
*/
lang?: LiteralUnion<'en_US' | 'en_CA' | 'en_AU' | 'en_GB'>;
/** Array of words that will not be checked. */
skipWords?: string[];
/**
* Array of Regular Expressions the plugin will try to match the js node element value (identifier, comment, string, string template, etc) and will not check the entire node content if matched,
* be careful in comments because if a part of the comment is matched the entire comment will not be checked, same for strings.
*
* i.e: `"^[-\\w]+\/[-\\w\\.]+$"` will ignore MIME types.
*/
skipIfMatch?: string[];
/**
* Array of Regular Expressions the plugin will try to match every single word that is found in the nodes (identifier, comment, string, string template, etc) and will not check the single word if matched.
*
* i.e: `"^[-\\w]+\/[-\\w\\.]+$"` will ignore MIME types.
*/
skipWordIfMatch?: string[];
/** Words with a character-amount of less than the minLength will not be spell-checked. */
minLength?: number;
};
/**
* Options.
*/
export type SpellCheckerOptions = [SpellCheckerOption?];
/**
* Spell check words on identifiers, Strings and comments.
*
* @see [spell-checker](https://github.com/aotaduy/eslint-plugin-spellcheck)
*/
export type SpellCheckerRuleConfig = RuleConfig<SpellCheckerOptions>;
/**
* Spell check words on identifiers, Strings and comments.
*
* @see [spell-checker](https://github.com/aotaduy/eslint-plugin-spellcheck)
*/
export interface SpellCheckerRule {
/**
* Spell check words on identifiers, Strings and comments.
*
* @see [spell-checker](https://github.com/aotaduy/eslint-plugin-spellcheck)
*/
'spellcheck/spell-checker': SpellCheckerRuleConfig;
}