diff --git a/dev/index.d.ts b/dev/index.d.ts index 8efecf2..037dac3 100644 --- a/dev/index.d.ts +++ b/dev/index.d.ts @@ -1,7 +1,26 @@ export {gfmStrikethroughHtml} from './lib/html.js' -export {gfmStrikethrough, type Options} from './lib/syntax.js' +export {gfmStrikethrough} from './lib/syntax.js' +/** + * Configuration (optional). + */ +export interface Options { + /** + * Whether to support strikethrough with a single tilde (default: `true`). + * + * Single tildes work on github.com, but are technically prohibited by the + * GFM spec. + */ + singleTilde?: boolean | null | undefined +} + +/** + * Augment. + */ declare module 'micromark-util-types' { + /** + * Token types. + */ interface TokenTypeMap { strikethroughSequence: 'strikethroughSequence' strikethroughSequenceTemporary: 'strikethroughSequenceTemporary' diff --git a/dev/lib/html.js b/dev/lib/html.js index a75d1e3..bfbf44d 100644 --- a/dev/lib/html.js +++ b/dev/lib/html.js @@ -1,5 +1,5 @@ /** - * @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension + * @import {HtmlExtension} from 'micromark-util-types' */ /** diff --git a/dev/lib/syntax.js b/dev/lib/syntax.js index 9496b0b..dc4c187 100644 --- a/dev/lib/syntax.js +++ b/dev/lib/syntax.js @@ -1,19 +1,6 @@ /** - * @typedef {import('micromark-util-types').Event} Event - * @typedef {import('micromark-util-types').Extension} Extension - * @typedef {import('micromark-util-types').Resolver} Resolver - * @typedef {import('micromark-util-types').State} State - * @typedef {import('micromark-util-types').Token} Token - * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext - * @typedef {import('micromark-util-types').Tokenizer} Tokenizer - * - * @typedef Options - * Configuration (optional). - * @property {boolean | null | undefined} [singleTilde=true] - * Whether to support strikethrough with a single tilde (default: `true`). - * - * Single tildes work on github.com, but are technically prohibited by the - * GFM spec. + * @import {Options} from 'micromark-extension-gfm-strikethrough' + * @import {Event, Extension, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types' */ import {ok as assert} from 'devlop' diff --git a/package.json b/package.json index 947dee9..cb010db 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,22 @@ { "files": "**/*.ts", "rules": { - "@typescript-eslint/consistent-type-definitions": 0 + "@typescript-eslint/array-type": [ + "error", + { + "default": "generic" + } + ], + "@typescript-eslint/ban-types": [ + "error", + { + "extendDefaults": true + } + ], + "@typescript-eslint/consistent-type-definitions": [ + "error", + "interface" + ] } }, {