Options
All
  • Public
  • Public/Protected
  • All
Menu

markuplint

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

ARIAAttribute

ARIAAttribute: { defaultValue?: undefined | string; deprecated?: undefined | true; name: string; type: "property" | "state"; value: ARIAAttributeValue }

Type declaration

  • Optional defaultValue?: undefined | string
  • Optional deprecated?: undefined | true
  • name: string
  • type: "property" | "state"
  • value: ARIAAttributeValue

ARIAAttributeValue

ARIAAttributeValue: "true/false" | "tristate" | "true/false/undefined" | "ID reference" | "ID reference list" | "integer" | "number" | "string" | "token" | "token list" | "URI"

ARIRRoleAttribute

ARIRRoleAttribute: { description: string; generalization: string[]; isAbstract?: undefined | true; name: string; ownedAttribute: string[] }

Type declaration

  • description: string
  • generalization: string[]
  • Optional isAbstract?: undefined | true
  • name: string
  • ownedAttribute: string[]

AnonymousNode

AnonymousNode<T, O>: MLDOMDoctype<T, O> | MLDOMElement<T, O> | MLDOMElementCloseTag<T, O> | MLDOMOmittedElement<T, O> | MLDOMComment<T, O> | MLDOMPreprocessorSpecificBlock<T, O> | MLDOMText<T, O>

Type parameters

  • T: RuleConfigValue

  • O

Attribute

Attribute: { condition?: AttributeCondition; deprecated?: undefined | true; description: string; enum?: string[]; experimental?: undefined | true; name: string; noUse?: undefined | false | true; nonStandard?: undefined | true; obsolete?: undefined | true; required?: true | AttributeCondition; requiredEither?: string[]; type: AttributeType }

Type declaration

  • Optional condition?: AttributeCondition
  • Optional deprecated?: undefined | true
  • description: string
  • Optional enum?: string[]
  • Optional experimental?: undefined | true
  • name: string
  • Optional noUse?: undefined | false | true
  • Optional nonStandard?: undefined | true
  • Optional obsolete?: undefined | true
  • Optional required?: true | AttributeCondition
  • Optional requiredEither?: string[]
  • type: AttributeType

AttributeCondition

AttributeCondition: { ancestor?: undefined | string; self?: string | string[] }

Type declaration

  • Optional ancestor?: undefined | string
  • Optional self?: string | string[]

AttributeType

AttributeType: "String" | "Boolean" | "Function" | "Date" | "Int" | "Uint" | "Float" | "NonZeroUint" | "AcceptList" | "AutoComplete" | "BCP47" | "Color" | "ColSpan" | "Coords" | "DateTime" | "Destination" | "DOMID" | "DOMIDList" | "ItemType" | "LinkSizes" | "LinkType" | "LinkTypeList" | "MediaQuery" | "MediaQueryList" | "MIMEType" | "ReferrerPolicy" | "RowSpan" | "SourceSizeList" | "SrcSet" | "TabIndex" | "Target" | "URL" | "URLHash" | "URLList"

Cites

Cites: string[]

Reference URLs

ContentModel

ContentModel: "#phrasing" | "#flow" | "#interactive" | "#heading" | "#sectioning" | "#metadata" | "#transparent" | "#embedded" | "#palpable" | "#script-supporting"

CosmiConfig

CosmiConfig: ReturnType<LoaderSync>

ElementCondition

ElementCondition: { __WIP__: "WORK_IN_PROGRESS" }

Type declaration

  • __WIP__: "WORK_IN_PROGRESS"

ElementSpec

ElementSpec: { attributes: (string | { condition?: AttributeCondition; deprecated?: undefined | true; description: string; enum?: string[]; experimental?: undefined | true; name: string; noUse?: undefined | false | true; nonStandard?: undefined | true; obsolete?: undefined | true; required?: true | AttributeCondition; requiredEither?: string[]; type: AttributeType })[]; categories: ContentModel[]; cite: string; deprecated?: undefined | true; description?: undefined | string; experimental?: undefined | true; name: string; nonStandard?: undefined | true; obsolete?: true | { alt: string }; omittion: ElementSpecOmittion; permittedRoles: { roles: PermittedRolesSpec; summary: string }; permittedStructures: PermittedStructuresSchema }

Element spec

Type declaration

  • attributes: (string | { condition?: AttributeCondition; deprecated?: undefined | true; description: string; enum?: string[]; experimental?: undefined | true; name: string; noUse?: undefined | false | true; nonStandard?: undefined | true; obsolete?: undefined | true; required?: true | AttributeCondition; requiredEither?: string[]; type: AttributeType })[]

    Attributes

  • categories: ContentModel[]

    Element cateogries

  • cite: string

    Reference URL

  • Optional deprecated?: undefined | true

    Deprecated

  • Optional description?: undefined | string

    Description

  • Optional experimental?: undefined | true

    Experimental technology

  • name: string

    Tag name

  • Optional nonStandard?: undefined | true

    Non-standard

  • Optional obsolete?: true | { alt: string }

    Obsolete or alternative elements

  • omittion: ElementSpecOmittion

    Tag omittion

  • permittedRoles: { roles: PermittedRolesSpec; summary: string }

    Permitted ARIA roles

  • permittedStructures: PermittedStructuresSchema

    Permitted contents and permitted parents

ElementSpecOmittion

ElementSpecOmittion: false | ElementSpecOmittionTags

ElementSpecOmittionTags

ElementSpecOmittionTags: { endTag: boolean | ElementCondition; startTag: boolean | ElementCondition }

Type declaration

ExtendedSpec

ExtendedSpec: { cites?: Cites; def?: Partial<SpecDefs>; specs?: ElementSpec[] }

Type declaration

Invalid

Invalid: { invalidType: "non-existent" | "invalid-value"; message: string }

Type declaration

  • invalidType: "non-existent" | "invalid-value"
  • message: string

MLASTAttr

MLASTNode

MLASTParentNode

MLASTTag

MappedNode

MappedNode<N, T, O>: N extends MLASTElement ? MLDOMElement<T, O> : N extends MLASTElementCloseTag ? MLDOMElementCloseTag<T, O> : N extends MLASTOmittedElement ? MLDOMOmittedElement<T, O> : N extends MLASTParentNode ? MLDOMElement<T, O> | MLDOMOmittedElement<T, O> : N extends MLASTComment ? MLDOMComment<T, O> : N extends MLASTText ? MLDOMText<T, O> : N extends MLASTDoctype ? MLDOMDoctype<T, O> : N extends MLASTNode ? MLDOMNode<T, O, MLASTNode> : N extends MLASTPreprocessorSpecificBlock ? MLDOMPreprocessorSpecificBlock<T, O> : N extends MLASTAbstructNode ? MLDOMNode<T, O, MLASTAbstructNode> : N extends MLASTAttr ? MLDOMAttribute : N extends MLToken ? MLDOMToken<MLToken> : never

Type parameters

  • N

  • T: RuleConfigValue

  • O

Node

Node: string | "#text" | ContentModel

NodeType

NodeType: "Doctype" | "Element" | "ElementCloseTag" | "OmittedElement" | "Comment" | "Text" | "Node" | "PSBlock"

Optional

Optional<C>: {}

Type parameters

  • C

Type declaration

Parse

Parse: (rawCode: string, offsetOffset?: undefined | number, offsetLine?: undefined | number, offsetColumn?: undefined | number) => MLASTDocument

Type declaration

    • (rawCode: string, offsetOffset?: undefined | number, offsetLine?: undefined | number, offsetColumn?: undefined | number): MLASTDocument
    • Parameters

      • rawCode: string
      • Optional offsetOffset: undefined | number
      • Optional offsetLine: undefined | number
      • Optional offsetColumn: undefined | number

      Returns MLASTDocument

PermittedContent

This file was automatically generated by json-schema-to-typescript. DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, and run json-schema-to-typescript to regenerate this file.

PermittedContentSpec

PermittedContentSpec: PermittedContent[]

PermittedRolesSpec

PermittedRolesSpec: {}

Type declaration

ReportingData

ReportingData: MLResultInfo & { color: boolean; format: string; noStdOut: boolean; problemOnly: boolean; verbose: boolean }

SpecDefs

SpecDefs: { #ariaAttrs: ARIAAttribute[]; #contentModels: {}; #globalAttrs: Attribute[]; #roles: ARIRRoleAttribute[] }

Type declaration

SyncWalker

SyncWalker<T, O, N>: (node: N) => void

Type parameters

  • T: RuleConfigValue

  • O

  • N

Type declaration

    • (node: N): void
    • Parameters

      • node: N

      Returns void

Target

Target: Node | Node[]

Walker

Walker<T, O, N>: (node: N) => Promise<void>

Type parameters

  • T: RuleConfigValue

  • O

  • N

Type declaration

    • (node: N): Promise<void>
    • Parameters

      • node: N

      Returns Promise<void>

Variables

Const ALL

ALL: "<[^>]+>" = "<[^>]+>"

Const CUSTOM_ELEMENT

CUSTOM_ELEMENT: string = `(?:<[a-z](?:${rePCENChar})*\\-(?:${rePCENChar})*>)`

Const ___InTRANSPARENT

___InTRANSPARENT: "___InTRANSPARENT" = "___InTRANSPARENT"

Const ___TRANSPARENT___

___TRANSPARENT___: "___TRANSPARENT___" = "___TRANSPARENT___"

Let cachedLocale

cachedLocale: string | null = null

Const cli

cli: Result<{ color: object; configFile: object; fix: object; format: object; problemOnly: object; verbose: object }> = meow(help, {flags: {configFile: {type: 'string',alias: 'c',},fix: {type: 'boolean',},format: {type: 'string',alias: 'f',},color: {type: 'boolean',default: true,},problemOnly: {type: 'boolean',alias: 'p',},verbose: {type: 'boolean',},},})

Const eaw

eaw: { characterLength: (char: string) => number } = eastasianwidth

Type declaration

  • characterLength: (char: string) => number
      • (char: string): number
      • Parameters

        • char: string

        Returns number

Const explorer

explorer: { clearCaches: () => void; clearLoadCache: () => void; clearSearchCache: () => void; load: (filepath: string) => Promise<CosmiconfigResult>; search: (searchFrom?: undefined | string) => Promise<CosmiconfigResult> } = cosmiconfig('markuplint')

Type declaration

  • Readonly clearCaches: () => void
      • (): void
      • Returns void

  • Readonly clearLoadCache: () => void
      • (): void
      • Returns void

  • Readonly clearSearchCache: () => void
      • (): void
      • Returns void

  • Readonly load: (filepath: string) => Promise<CosmiconfigResult>
      • (filepath: string): Promise<CosmiconfigResult>
      • Parameters

        • filepath: string

        Returns Promise<CosmiconfigResult>

  • Readonly search: (searchFrom?: undefined | string) => Promise<CosmiconfigResult>
      • (searchFrom?: undefined | string): Promise<CosmiconfigResult>
      • Parameters

        • Optional searchFrom: undefined | string

        Returns Promise<CosmiconfigResult>

Const fileCaches

fileCaches: WeakMap<MLFile, string> = new WeakMap<MLFile, string>()

Const help

help: "Usage$ markuplint <HTML file pathes (glob format)>$ <stdout> | markuplintOptions--config-file, -c FILE_PATH Ruleset file path.--fix, Fix HTML.--format, -f FORMAT Output format. Support "JSON", "Simple" and "Standard". Default: "Standard".--no-color, Output no color.--problem-only, -p Output only problems, without passeds.--verbose Output with detailed information.--help, -h Show help.--version, -v Show version.Examples$ markuplint verifyee.html --ruleset path/to/.markuplintrc$ cat verifyee.html | markuplint" = `Usage$ markuplint <HTML file pathes (glob format)>$ <stdout> | markuplintOptions--config-file, -c FILE_PATH Ruleset file path.--fix, Fix HTML.--format, -f FORMAT Output format. Support "JSON", "Simple" and "Standard". Default: "Standard".--no-color, Output no color.--problem-only, -p Output only problems, without passeds.--verbose Output with detailed information.--help, -h Show help.--version, -v Show version.Examples$ markuplint verifyee.html --ruleset path/to/.markuplintrc$ cat verifyee.html | markuplint`

Const loggerError

loggerError: Format = c.red

Const loggerWarning

loggerWarning: Format = c.xterm(208)

Const markuplint

markuplint: string = `markup${c.xterm(39)('lint')}`

Const rawTextElements

rawTextElements: string[] = ['script', 'style']

Const reCostomElement

reCostomElement: RegExp = new RegExp(`^(?:[a-z](?:${rePCENChar})*\\-(?:${rePCENChar})*)$`, 'i')

Const rePCENChar

rePCENChar: string = ['\\-','\\.','[0-9]','_','[a-z]','\u00B7','[\u00C0-\u00D6]','[\u00D8-\u00F6]','[\u00F8-\u037D]','[\u037F-\u1FFF]','[\u200C-\u200D]','[\u203F-\u2040]','[\u2070-\u218F]','[\u2C00-\u2FEF]','[\u3001-\uD7FF]','[\uF900-\uFDCF]','[\uFDF0-\uFFFD]','[\uD800-\uDBFF][\uDC00-\uDFFF]',].join('|')

PotentialCustomElementName

see

https://html.spec.whatwg.org/multipage/custom-elements.html#prod-potentialcustomelementname

PotentialCustomElementName ::= [a-z] (PCENChar)* '-' (PCENChar)* PCENChar ::= "-" | "." | [0-9] | "_" | [a-z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF] This uses the EBNF notation from the XML specification. [XML]

ASCII-case-insensitively. Originally, it is not possible to define a name including ASCII upper alphas in the custom element, but it is not treated as illegal by the HTML parser.

Const readFile

readFile: __promisify__ = util.promisify(fs.readFile)

Const stat

stat: __promisify__ = util.promisify(fs.stat)

Functions

attrMatches

  • attrMatches<T, R>(node: Element<T, R>, condition: Attribute["condition"]): boolean
  • Type parameters

    • T: RuleConfigValue

    • R

    Parameters

    • node: Element<T, R>
    • condition: Attribute["condition"]

    Returns boolean

attrSpecs

  • attrSpecs(tag: string, __namedParameters: { def: { #ariaAttrs: ARIAAttribute[]; #contentModels: {}; #globalAttrs: Attribute[]; #roles: ARIRRoleAttribute[] }; specs: { attributes: (string | { condition?: AttributeCondition; deprecated?: undefined | true; description: string; enum?: string[]; experimental?: undefined | true; name: string; noUse?: undefined | false | true; nonStandard?: undefined | true; obsolete?: undefined | true; required?: true | AttributeCondition; requiredEither?: string[]; type: AttributeType })[]; categories: ContentModel[]; cite: string; deprecated?: undefined | true; description?: undefined | string; experimental?: undefined | true; name: string; nonStandard?: undefined | true; obsolete?: true | { alt: string }; omittion: ElementSpecOmittion; permittedRoles: { roles: PermittedRolesSpec; summary: string }; permittedStructures: PermittedStructuresSchema }[] }): null | { condition?: AttributeCondition; deprecated?: undefined | true; description: string; enum?: string[]; experimental?: undefined | true; name: string; noUse?: undefined | false | true; nonStandard?: undefined | true; obsolete?: undefined | true; required?: true | AttributeCondition; requiredEither?: string[]; type: AttributeType }[]
  • Parameters

    • tag: string
    • __namedParameters: { def: { #ariaAttrs: ARIAAttribute[]; #contentModels: {}; #globalAttrs: Attribute[]; #roles: ARIRRoleAttribute[] }; specs: { attributes: (string | { condition?: AttributeCondition; deprecated?: undefined | true; description: string; enum?: string[]; experimental?: undefined | true; name: string; noUse?: undefined | false | true; nonStandard?: undefined | true; obsolete?: undefined | true; required?: true | AttributeCondition; requiredEither?: string[]; type: AttributeType })[]; categories: ContentModel[]; cite: string; deprecated?: undefined | true; description?: undefined | string; experimental?: undefined | true; name: string; nonStandard?: undefined | true; obsolete?: true | { alt: string }; omittion: ElementSpecOmittion; permittedRoles: { roles: PermittedRolesSpec; summary: string }; permittedStructures: PermittedStructuresSchema }[] }

    Returns null | { condition?: AttributeCondition; deprecated?: undefined | true; description: string; enum?: string[]; experimental?: undefined | true; name: string; noUse?: undefined | false | true; nonStandard?: undefined | true; obsolete?: undefined | true; required?: true | AttributeCondition; requiredEither?: string[]; type: AttributeType }[]

attributesToDebugMaps

  • attributesToDebugMaps(attributes: MLASTAttr[]): string[][]
  • Parameters

    Returns string[][]

combination

  • combination<T>(array: T[]): T[][]
  • Type parameters

    • T

    Parameters

    • array: T[]

    Returns T[][]

command

  • command(options: { codes?: undefined | string; color?: undefined | false | true; configFile?: undefined | string; files?: string[]; fix?: undefined | false | true; format?: undefined | string; problemOnly?: undefined | false | true; verbose?: undefined | false | true; workspace?: undefined | string }, exitCode?: number): Promise<void>
  • Parameters

    • options: { codes?: undefined | string; color?: undefined | false | true; configFile?: undefined | string; files?: string[]; fix?: undefined | false | true; format?: undefined | string; problemOnly?: undefined | false | true; verbose?: undefined | false | true; workspace?: undefined | string }
      • Optional codes?: undefined | string
      • Optional color?: undefined | false | true
      • Optional configFile?: undefined | string
      • Optional files?: string[]
      • Optional fix?: undefined | false | true
      • Optional format?: undefined | string
      • Optional problemOnly?: undefined | false | true
      • Optional verbose?: undefined | false | true
      • Optional workspace?: undefined | string
    • Default value exitCode: number = 0

    Returns Promise<void>

convertRuleset

  • convertRuleset(config: Config): Ruleset
  • Parameters

    • config: Config

    Returns Ruleset

createNode

  • createNode<N, T, O>(astNode: N, document: Document<T, O>, pearNode?: MLDOMElement<T, O>): MappedNode<N, T, O>
  • Type parameters

    Parameters

    • astNode: N
    • document: Document<T, O>
    • Optional pearNode: MLDOMElement<T, O>

    Returns MappedNode<N, T, O>

createRange

  • createRange(min: number, max: number): string
  • Parameters

    • min: number
    • max: number

    Returns string

createRule

  • Type parameters

    • T: RuleConfigValue

    • O

    Parameters

    Returns MLRule<T, O>

createSelector

  • createSelector(selector: string): Selector
  • Parameters

    • selector: string

    Returns Selector

floatCheck

  • floatCheck(value: string): boolean

getAnonymousFile

  • getAnonymousFile(context: string, workspace?: undefined | string, name?: undefined | string): MLFile
  • Parameters

    • context: string
    • Optional workspace: undefined | string
    • Optional name: undefined | string

    Returns MLFile

getCol

  • getCol(html: string, startOffset: number): number
  • Parameters

    • html: string
    • startOffset: number

    Returns number

getEndCol

  • getEndCol(html: string, col: number): number
  • Parameters

    • html: string
    • col: number

    Returns number

getEndLine

  • getEndLine(html: string, line: number): number
  • Parameters

    • html: string
    • line: number

    Returns number

getFile

  • getFile(filePath: string): MLFile
  • Parameters

    • filePath: string

    Returns MLFile

getFiles

  • getFiles(filePathOrGlob: string): Promise<MLFile[]>
  • Get files

    Supported glob patterns

    Parameters

    • filePathOrGlob: string

    Returns Promise<MLFile[]>

getLine

  • getLine(html: string, startOffset: number): number
  • Parameters

    • html: string
    • startOffset: number

    Returns number

getLocale

  • getLocale(): Promise<string>
  • Returns Promise<string>

getLocationFromChars

  • getLocationFromChars(searches: string[], text: string, currentLine: number, currentCol: number): Location[]
  • Parameters

    • searches: string[]
    • text: string
    • currentLine: number
    • currentCol: number

    Returns Location[]

getSpec

  • Merging HTML-spec schema and extended spec schemas

    Ex: @markuplint/html-spec + { specs: ["@markuplint/vue-spec"] } in cofigure files.

    Parameters

    Returns {}

htmlSpec

  • Parameters

    • tag: string

    Returns null | PermittedStructuresSchema

i18n

  • i18n(locale?: undefined | string): Promise<I18n>
  • Parameters

    • Optional locale: undefined | string

    Returns Promise<I18n>

intCheck

  • intCheck(value: string): boolean

invisibleSpace

  • invisibleSpace(str: string): string
  • Parameters

    • str: string

    Returns string

isChoiceContents

  • isChoiceContents(contents: PermittedContent): contents is PermittedContentChoice
  • Parameters

    Returns contents is PermittedContentChoice

isCustomElement

  • isCustomElement(nodeName: string): boolean
  • Parameters

    • nodeName: string

    Returns boolean

isInterleaveContents

  • isInterleaveContents(contents: PermittedContent): contents is PermittedContentInterleave
  • Parameters

    Returns contents is PermittedContentInterleave

isOneOrMoreContents

  • isOneOrMoreContents(contents: PermittedContent): contents is PermittedContentOneOrMore
  • Parameters

    Returns contents is PermittedContentOneOrMore

isOptionalContents

  • isOptionalContents(contents: PermittedContent): contents is PermittedContentOptional
  • Parameters

    Returns contents is PermittedContentOptional

isRequiredContents

  • isRequiredContents(contents: PermittedContent): contents is PermittedContentRequire
  • Parameters

    Returns contents is PermittedContentRequire

isTarget

  • Parameters

    Returns contentRule is Target

isZeroOrMoreContents

  • isZeroOrMoreContents(contents: PermittedContent): contents is PermittedContentZeroOrMore
  • Parameters

    Returns contents is PermittedContentZeroOrMore

join

  • join(pattern: string[], range?: string): string
  • Parameters

    • pattern: string[]
    • Default value range: string = ""

    Returns string

lint

  • lint(options: { config?: string | Config; defaultConfig?: Config; files?: string | string[]; fix?: undefined | false | true; locale?: undefined | string; names?: string | string[]; rules?: MLRule<RuleConfigValue, unknown>[]; rulesAutoResolve?: undefined | false | true; sourceCodes?: string | string[]; workspace?: undefined | string }): Promise<MLResultInfo[]>
  • Parameters

    • options: { config?: string | Config; defaultConfig?: Config; files?: string | string[]; fix?: undefined | false | true; locale?: undefined | string; names?: string | string[]; rules?: MLRule<RuleConfigValue, unknown>[]; rulesAutoResolve?: undefined | false | true; sourceCodes?: string | string[]; workspace?: undefined | string }
      • Optional config?: string | Config

        Configure file or object

      • Optional defaultConfig?: Config

        The config applied when not resolved from files or set it explicitly.

      • Optional files?: string | string[]

        Glob pattern

      • Optional fix?: undefined | false | true

        Auto fix

      • Optional locale?: undefined | string

        Locale

      • Optional names?: string | string[]

        File names when sourceCodes

      • Optional rules?: MLRule<RuleConfigValue, unknown>[]

        Rules (default: @markuplint/rules)

      • Optional rulesAutoResolve?: undefined | false | true

        Auto resolve rules

        Auto importing form node_modules when set @markuplint/rule-{RULE_NAME} or markuplint-rule-{RULE_NAME} in config rules

      • Optional sourceCodes?: string | string[]

        Target source code of evaluation

      • Optional workspace?: undefined | string

        Workspace path when sourceCodes

    Returns Promise<MLResultInfo[]>

lintFile

  • lintFile(file: MLFile, configs: Map<MLFile, ConfigSet>, rulesAutoResolve: boolean, rules: MLRule<RuleConfigValue, unknown>[], locale?: undefined | string, fix?: undefined | false | true): Promise<MLResultInfo>
  • Parameters

    • file: MLFile
    • configs: Map<MLFile, ConfigSet>
    • rulesAutoResolve: boolean
    • rules: MLRule<RuleConfigValue, unknown>[]
    • Optional locale: undefined | string
    • Optional fix: undefined | false | true

    Returns Promise<MLResultInfo>

load

  • load<T>(filePath: string, cacheClear: boolean): Promise<null | { config: T; filePath: string }>
  • Type parameters

    • T

    Parameters

    • filePath: string
    • cacheClear: boolean

    Returns Promise<null | { config: T; filePath: string }>

loadConfigFile

  • loadConfigFile(filePath: string, recursiveExtends?: boolean, cacheClear?: boolean): Promise<ConfigSet | void>
  • Asynchronously get configuration file.

    Parameters

    • filePath: string

      A path of configuration file. (ex. "path/to/markuplintrc.json")

    • Default value recursiveExtends: boolean = true

      Recursive load by extends options.

    • Default value cacheClear: boolean = false

      Clear cache when loading.

    Returns Promise<ConfigSet | void>

margeConfig

  • margeConfig(a: Config, b: Config): Config
  • Parameters

    • a: Config
    • b: Config

    Returns Config

match

  • match(element: ElementLikeObject, ruleset: CSSSelector, rawSelector: string): boolean
  • Parameters

    Returns boolean

moduleAutoLoader

  • moduleAutoLoader<T, O>(ruleset: Ruleset): Promise<{ errors: unknown[]; rules: MLRule<T, O>[] }>
  • Type parameters

    • T: RuleConfigValue

    • O

    Parameters

    • ruleset: Ruleset

    Returns Promise<{ errors: unknown[]; rules: MLRule<T, O>[] }>

nodeListToDebugMaps

  • nodeListToDebugMaps(nodeList: MLASTNode[]): string[]
  • Parameters

    Returns string[]

nonZeroUintCheck

  • nonZeroUintCheck(value: string): boolean
  • Non-negative integer greater than zero

    Parameters

    • value: string

    Returns boolean

output

  • Parameters

    Returns Promise<void>

p

  • p(s: number | string, pad: number, start?: boolean): string
  • Parameters

    • s: number | string
    • pad: number
    • Default value start: boolean = false

    Returns string

recursiveLoad

  • recursiveLoad(config: Config, filePath: string, files: Set<string>, cacheClear: boolean): Promise<ConfigSet>
  • Parameters

    • config: Config
    • filePath: string
    • files: Set<string>
    • cacheClear: boolean

    Returns Promise<ConfigSet>

resolveConfigs

  • resolveConfigs(files: MLFile[], options: { config?: string | Config; defaultConfig?: Config; workspace?: undefined | string }): Promise<Map<MLFile, ConfigSet>>
  • Parameters

    • files: MLFile[]
    • options: { config?: string | Config; defaultConfig?: Config; workspace?: undefined | string }
      • Optional config?: string | Config
      • Optional defaultConfig?: Config
      • Optional workspace?: undefined | string

    Returns Promise<Map<MLFile, ConfigSet>>

resolveLintTargetFiles

  • resolveLintTargetFiles(options: { files?: string | string[]; names?: string | string[]; sourceCodes?: string | string[]; workspace?: undefined | string }): Promise<MLFile[]>
  • Parameters

    • options: { files?: string | string[]; names?: string | string[]; sourceCodes?: string | string[]; workspace?: undefined | string }
      • Optional files?: string | string[]

        Glob pattern

      • Optional names?: string | string[]

        File names when sourceCodes

      • Optional sourceCodes?: string | string[]

        Target source code of evaluation

      • Optional workspace?: undefined | string

        Workspace path when sourceCodes

    Returns Promise<MLFile[]>

resolveRules

  • resolveRules(options: { rules?: MLRule<RuleConfigValue, unknown>[] }): Promise<MLRule<null | string | number | false | true | any[], unknown>[]>
  • Parameters

    • options: { rules?: MLRule<RuleConfigValue, unknown>[] }
      • Optional rules?: MLRule<RuleConfigValue, unknown>[]

    Returns Promise<MLRule<null | string | number | false | true | any[], unknown>[]>

search

  • search<T>(dir: string, cacheClear: boolean): Promise<null | { config: T; filePath: string }>
  • Type parameters

    • T

    Parameters

    • dir: string
    • cacheClear: boolean

    Returns Promise<null | { config: T; filePath: string }>

searchConfigFile

  • searchConfigFile(baseDirOrTargetFilePath: string, recursiveExtends?: boolean, cacheClear?: boolean): Promise<ConfigSet | void>
  • Asynchronously search configuration file from linting target file.

    Parameters

    • baseDirOrTargetFilePath: string

      A path of linting target file. To be base directory for searching. (ex. "path/to/target.html")

    • Default value recursiveExtends: boolean = true

      Recursive load by extends options.

    • Default value cacheClear: boolean = false

      Clear cache when loading.

    Returns Promise<ConfigSet | void>

simpleReporter

  • Parameters

    Returns Promise<string[]>

sliceFragment

  • sliceFragment(rawHtml: string, start: number, end: number): { endCol: number; endLine: number; endOffset: number; raw: string; startCol: number; startLine: number; startOffset: number }
  • Parameters

    • rawHtml: string
    • start: number
    • end: number

    Returns { endCol: number; endLine: number; endOffset: number; raw: string; startCol: number; startLine: number; startOffset: number }

    • endCol: number
    • endLine: number
    • endOffset: number
    • raw: string
    • startCol: number
    • startLine: number
    • startOffset: number

space

  • space(str: string): string
  • Parameters

    • str: string

    Returns string

standardReporter

  • Parameters

    Returns Promise<string[]>

stringSplice

  • stringSplice(str: string, start: number, count: number, add?: string): string
  • Parameters

    • str: string
    • start: number
    • count: number
    • Default value add: string = ""

    Returns string

syncWalk

  • Type parameters

    • T: RuleConfigValue

    • O

    Parameters

    Returns void

toRegxp

  • toRegxp(pattern: string): string | RegExp
  • Parameters

    • pattern: string

    Returns string | RegExp

tokenDebug

  • tokenDebug<N>(n: N, type?: string): string
  • Type parameters

    • N: { endCol: number; endLine: number; endOffset: number; nodeName?: undefined | string; potentialName?: undefined | string; raw: string; startCol: number; startLine: number; startOffset: number; type?: undefined | string }

    Parameters

    • n: N
    • Default value type: string = ""

    Returns string

tokenizer

  • tokenizer(raw: string | null, startLine: number, startCol: number, startOffset: number): MLToken
  • Parameters

    • raw: string | null
    • startLine: number
    • startCol: number
    • startOffset: number

    Returns MLToken

typeCheck

  • typeCheck(name: string, value: string, spec?: AttrSpec): Invalid | false
  • Parameters

    • name: string
    • value: string
    • Optional spec: AttrSpec

    Returns Invalid | false

uintCheck

  • uintCheck(value: string): boolean

unfoldContentModelsToTags

  • unfoldContentModelsToTags(contentModel: ContentModel): string[]
  • Parameters

    Returns string[]

uuid

  • uuid(): string
  • Returns string

visibleWhiteSpace

  • visibleWhiteSpace(chars: string): string
  • Parameters

    • chars: string

    Returns string

w

  • w(s: string): number
  • Parameters

    • s: string

    Returns number

walk

  • Parameters

    Returns void

Generated using TypeDoc