Refactor code-style
This commit is contained in:
parent
4fbc22e300
commit
e55aa2a8b7
6 changed files with 1441 additions and 1273 deletions
2
dev/index.d.ts
vendored
2
dev/index.d.ts
vendored
|
@ -9,7 +9,6 @@ export {
|
||||||
} from './lib/html.js'
|
} from './lib/html.js'
|
||||||
|
|
||||||
declare module 'micromark-util-types' {
|
declare module 'micromark-util-types' {
|
||||||
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
|
||||||
interface TokenTypeMap {
|
interface TokenTypeMap {
|
||||||
directiveContainer: 'directiveContainer'
|
directiveContainer: 'directiveContainer'
|
||||||
directiveContainerAttributes: 'directiveContainerAttributes'
|
directiveContainerAttributes: 'directiveContainerAttributes'
|
||||||
|
@ -74,7 +73,6 @@ declare module 'micromark-util-types' {
|
||||||
directiveTextName: 'directiveTextName'
|
directiveTextName: 'directiveTextName'
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
|
||||||
interface CompileData {
|
interface CompileData {
|
||||||
directiveAttributes?: Attribute[]
|
directiveAttributes?: Attribute[]
|
||||||
directiveStack?: Directive[]
|
directiveStack?: Directive[]
|
||||||
|
|
|
@ -33,9 +33,8 @@ import {types} from 'micromark-util-symbol/types.js'
|
||||||
* @param {TokenType} attributeValueType
|
* @param {TokenType} attributeValueType
|
||||||
* @param {TokenType} attributeValueMarker
|
* @param {TokenType} attributeValueMarker
|
||||||
* @param {TokenType} attributeValueData
|
* @param {TokenType} attributeValueData
|
||||||
* @param {boolean} [disallowEol=false]
|
* @param {boolean | undefined} [disallowEol=false]
|
||||||
*/
|
*/
|
||||||
/* eslint-disable-next-line max-params */
|
|
||||||
export function factoryAttributes(
|
export function factoryAttributes(
|
||||||
effects,
|
effects,
|
||||||
ok,
|
ok,
|
||||||
|
|
|
@ -23,9 +23,8 @@ import {types} from 'micromark-util-symbol/types.js'
|
||||||
* @param {TokenType} type
|
* @param {TokenType} type
|
||||||
* @param {TokenType} markerType
|
* @param {TokenType} markerType
|
||||||
* @param {TokenType} stringType
|
* @param {TokenType} stringType
|
||||||
* @param {boolean} [disallowEol=false]
|
* @param {boolean | undefined} [disallowEol=false]
|
||||||
*/
|
*/
|
||||||
// eslint-disable-next-line max-params
|
|
||||||
export function factoryLabel(
|
export function factoryLabel(
|
||||||
effects,
|
effects,
|
||||||
ok,
|
ok,
|
||||||
|
|
|
@ -22,8 +22,9 @@
|
||||||
* Current context.
|
* Current context.
|
||||||
* @param {Directive} directive
|
* @param {Directive} directive
|
||||||
* Directive.
|
* Directive.
|
||||||
* @returns {boolean | void}
|
* @returns {boolean | undefined}
|
||||||
* Signal whether the directive was handled.
|
* Signal whether the directive was handled.
|
||||||
|
*
|
||||||
* Yield `false` to let the fallback (a special handle for `'*'`) handle it.
|
* Yield `false` to let the fallback (a special handle for `'*'`) handle it.
|
||||||
*
|
*
|
||||||
* @typedef Directive
|
* @typedef Directive
|
||||||
|
@ -54,8 +55,8 @@ const own = {}.hasOwnProperty
|
||||||
* Create an extension for `micromark` to support directives when serializing
|
* Create an extension for `micromark` to support directives when serializing
|
||||||
* to HTML.
|
* to HTML.
|
||||||
*
|
*
|
||||||
* @param {HtmlOptions | null | undefined} [options]
|
* @param {HtmlOptions | null | undefined} [options={}]
|
||||||
* Configuration.
|
* Configuration (default: `{}`).
|
||||||
* @returns {HtmlExtension}
|
* @returns {HtmlExtension}
|
||||||
* Extension for `micromark` that can be passed in `htmlExtensions`, to
|
* Extension for `micromark` that can be passed in `htmlExtensions`, to
|
||||||
* support directives when serializing to HTML.
|
* support directives when serializing to HTML.
|
||||||
|
@ -285,7 +286,7 @@ export function directiveHtml(options) {
|
||||||
assert(directive, 'expected directive')
|
assert(directive, 'expected directive')
|
||||||
/** @type {boolean | undefined} */
|
/** @type {boolean | undefined} */
|
||||||
let found
|
let found
|
||||||
/** @type {boolean|void} */
|
/** @type {boolean | undefined} */
|
||||||
let result
|
let result
|
||||||
|
|
||||||
assert(directive.name, 'expected `name`')
|
assert(directive.name, 'expected `name`')
|
||||||
|
|
14
package.json
14
package.json
|
@ -90,11 +90,21 @@
|
||||||
"strict": true
|
"strict": true
|
||||||
},
|
},
|
||||||
"xo": {
|
"xo": {
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": [
|
||||||
|
"**/*.ts"
|
||||||
|
],
|
||||||
|
"rules": {
|
||||||
|
"@typescript-eslint/consistent-type-definitions": "off"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"prettier": true,
|
"prettier": true,
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"max-params": "off",
|
||||||
"n/file-extension-in-import": "off",
|
"n/file-extension-in-import": "off",
|
||||||
"unicorn/no-this-assignment": "off",
|
"unicorn/no-this-assignment": "off"
|
||||||
"unicorn/prefer-node-protocol": "off"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
2139
test/index.js
2139
test/index.js
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue