🤖 Merge PR #46324 update(alex): minor version update 8.2 by @peterblazejewicz

- missing 'deny' property
- version bump
- minor cleanup

https://github.com/get-alex/alex/releases/tag/8.2.0

Thanks!
This commit is contained in:
Piotr Błażejewicz (Peter Blazejewicz) 2020-08-14 00:51:58 +02:00 committed by GitHub
parent 6b58148503
commit 32873ece9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 5 deletions

View File

@ -1,22 +1,32 @@
// configs
const exemption = ['word', 'noun'];
const config: alex.AlexOptions = {
const deny = ['deny', 'word'];
const config: alex.Config = {
allow: exemption,
deny,
noBinary: true,
profanitySureness: 1,
};
const denyConfig: alex.Config = {
deny,
noBinary: true,
profanitySureness: 1,
};
// api
alex('Weve confirmed his identity.'); // $ExpectType VFile
alex('Weve confirmed his identity.', exemption); // $ExpectType VFile
alex('Weve confirmed his identity.', config); // $ExpectType VFile
alex('Weve confirmed his identity.', denyConfig); // $ExpectType VFile
alex.markdown('### Weve confirmed his **identity**.'); // $ExpectType VFile
alex.markdown('### Weve confirmed his **identity**.', exemption); // $ExpectType VFile
alex.markdown('### Weve confirmed his **identity**.', config); // $ExpectType VFile
alex.markdown('### Weve confirmed his **identity**.', denyConfig); // $ExpectType VFile
alex.html('<p class="black">He walked to class.</p>'); // $ExpectType VFile
alex.html('<p class="black">He walked to class.</p>', exemption); // $ExpectType VFile
alex.html('<p class="black">He walked to class.</p>', config); // $ExpectType VFile
alex.html('<p class="black">He walked to class.</p>', denyConfig); // $ExpectType VFile
alex.text('The `boogeyman`.'); // $ExpectType VFile
alex.text('The `boogeyman`.', exemption); // $ExpectType VFile
alex.text('The `boogeyman`.', config); // $ExpectType VFile
alex.text('The `boogeyman`.', denyConfig); // $ExpectType VFile

10
types/alex/index.d.ts vendored
View File

@ -1,8 +1,7 @@
// Type definitions for alex 8.1
// Type definitions for alex 8.2
// Project: https://alexjs.com
// Definitions by: Piotr Błażejewicz (Peter Blazejewicz) <https://github.com/peterblazejewicz>
// Definitions by: Piotr Błażejewicz <https://github.com/peterblazejewicz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.0
import * as vfile from 'vfile';
@ -20,6 +19,11 @@ declare namespace alex {
interface AlexOptions {
/** an array of rules (the default is []) */
allow?: string[];
/**
* When provided, only the rules specified are reported.
* @default []
*/
deny?: string[];
/**
* When turned on (`true`), pairs such as `he` and `she` and `garbageman` or `garbagewoman` are seen as errors.
* When turned off (`false`, the default), such pairs are okay