UNPKG

retext-syntax-mentions

Version:

retext plugin to classify @mentions as syntax, not natural language

28 lines (27 loc) 955 B
/** * Classify `@mentions` as source (external ungrammatical values) instead of * natural language. * * This hides mentions from `retext-spell`, `retext-readability`, * `retext-equality`, etc. * * @param {Readonly<Options> | null | undefined} [options] * Configuration (optional). * @returns * Transform. */ export default function retextSyntaxMentions(options?: Readonly<Options> | null | undefined): (tree: Root) => undefined; export type Root = import('nlcst').Root; export type RootContent = import('nlcst').RootContent; export type Source = import('nlcst').Source; /** * Configuration. */ export type Options = { /** * Style of mentions (default: `'github'`); can be either `'github'` (for * GitHub user and team mentions), `'twitter'` (for Twitter handles), or a * regular expression (such as `/^@\w{1,15}$/i`, which is the Twitter regex). */ style?: RegExp | 'github' | 'twitter' | null | undefined; };