Skip to content

Commit

Permalink
Refactor to use @imports
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jul 5, 2024
1 parent 3cfd2ef commit d61c093
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 8 deletions.
7 changes: 6 additions & 1 deletion dev/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
export {gfmTaskListItemHtml} from './lib/html.js'
export {gfmTaskListItem} from './lib/syntax.js'

/**
* Augment types.
*/
declare module 'micromark-util-types' {
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
/**
* Token types.
*/
interface TokenTypeMap {
taskListCheck: 'taskListCheck'
taskListCheckMarker: 'taskListCheckMarker'
Expand Down
2 changes: 1 addition & 1 deletion dev/lib/html.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension
* @import {HtmlExtension} from 'micromark-util-types'
*/

/**
Expand Down
5 changes: 1 addition & 4 deletions dev/lib/syntax.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
/**
* @typedef {import('micromark-util-types').Extension} Extension
* @typedef {import('micromark-util-types').State} State
* @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext
* @typedef {import('micromark-util-types').Tokenizer} Tokenizer
* @import {Extension, State, TokenizeContext, Tokenizer} from 'micromark-util-types'
*/

import {ok as assert} from 'devlop'
Expand Down
25 changes: 24 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,35 @@
"unicorn/prefer-string-replace-all": "off"
},
"overrides": [
{
"files": [
"**/*.d.ts"
],
"rules": {
"@typescript-eslint/array-type": [
"error",
{
"default": "generic"
}
],
"@typescript-eslint/ban-types": [
"error",
{
"extendDefaults": true
}
],
"@typescript-eslint/consistent-type-definitions": [
"error",
"interface"
]
}
},
{
"files": [
"test/**/*.js"
],
"rules": {
"no-await-in-loop": 0
"no-await-in-loop": "off"
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test('markdown -> html (micromark)', async function (t) {
})

await t.test(
'should skip tasklistCheck construct if `disable.null` includes `tasklistCheck`',
'should skip `tasklistCheck` construct if `disable.null` includes `tasklistCheck`',
async function () {
assert.deepEqual(
micromark('* [ ] foo', {
Expand Down

0 comments on commit d61c093

Please sign in to comment.