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'
|
||||
|
||||
declare module 'micromark-util-types' {
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
||||
interface TokenTypeMap {
|
||||
directiveContainer: 'directiveContainer'
|
||||
directiveContainerAttributes: 'directiveContainerAttributes'
|
||||
|
@ -74,7 +73,6 @@ declare module 'micromark-util-types' {
|
|||
directiveTextName: 'directiveTextName'
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
||||
interface CompileData {
|
||||
directiveAttributes?: Attribute[]
|
||||
directiveStack?: Directive[]
|
||||
|
|
|
@ -33,9 +33,8 @@ import {types} from 'micromark-util-symbol/types.js'
|
|||
* @param {TokenType} attributeValueType
|
||||
* @param {TokenType} attributeValueMarker
|
||||
* @param {TokenType} attributeValueData
|
||||
* @param {boolean} [disallowEol=false]
|
||||
* @param {boolean | undefined} [disallowEol=false]
|
||||
*/
|
||||
/* eslint-disable-next-line max-params */
|
||||
export function factoryAttributes(
|
||||
effects,
|
||||
ok,
|
||||
|
|
|
@ -23,9 +23,8 @@ import {types} from 'micromark-util-symbol/types.js'
|
|||
* @param {TokenType} type
|
||||
* @param {TokenType} markerType
|
||||
* @param {TokenType} stringType
|
||||
* @param {boolean} [disallowEol=false]
|
||||
* @param {boolean | undefined} [disallowEol=false]
|
||||
*/
|
||||
// eslint-disable-next-line max-params
|
||||
export function factoryLabel(
|
||||
effects,
|
||||
ok,
|
||||
|
|
|
@ -22,8 +22,9 @@
|
|||
* Current context.
|
||||
* @param {Directive} directive
|
||||
* Directive.
|
||||
* @returns {boolean | void}
|
||||
* @returns {boolean | undefined}
|
||||
* Signal whether the directive was handled.
|
||||
*
|
||||
* Yield `false` to let the fallback (a special handle for `'*'`) handle it.
|
||||
*
|
||||
* @typedef Directive
|
||||
|
@ -54,8 +55,8 @@ const own = {}.hasOwnProperty
|
|||
* Create an extension for `micromark` to support directives when serializing
|
||||
* to HTML.
|
||||
*
|
||||
* @param {HtmlOptions | null | undefined} [options]
|
||||
* Configuration.
|
||||
* @param {HtmlOptions | null | undefined} [options={}]
|
||||
* Configuration (default: `{}`).
|
||||
* @returns {HtmlExtension}
|
||||
* Extension for `micromark` that can be passed in `htmlExtensions`, to
|
||||
* support directives when serializing to HTML.
|
||||
|
@ -285,7 +286,7 @@ export function directiveHtml(options) {
|
|||
assert(directive, 'expected directive')
|
||||
/** @type {boolean | undefined} */
|
||||
let found
|
||||
/** @type {boolean|void} */
|
||||
/** @type {boolean | undefined} */
|
||||
let result
|
||||
|
||||
assert(directive.name, 'expected `name`')
|
||||
|
|
14
package.json
14
package.json
|
@ -90,11 +90,21 @@
|
|||
"strict": true
|
||||
},
|
||||
"xo": {
|
||||
"overrides": [
|
||||
{
|
||||
"files": [
|
||||
"**/*.ts"
|
||||
],
|
||||
"rules": {
|
||||
"@typescript-eslint/consistent-type-definitions": "off"
|
||||
}
|
||||
}
|
||||
],
|
||||
"prettier": true,
|
||||
"rules": {
|
||||
"max-params": "off",
|
||||
"n/file-extension-in-import": "off",
|
||||
"unicorn/no-this-assignment": "off",
|
||||
"unicorn/prefer-node-protocol": "off"
|
||||
"unicorn/no-this-assignment": "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