Home > harper.js

harper.js package

Classes

Class

Description

Lint

LocalLinter

A Linter that runs in the current JavaScript context (meaning it is allowed to block the event loop). See the interface definition for more details.

Span

Suggestion

WorkerLinter

A Linter that spins up a dedicated web worker to do processing on a separate thread. Main benefit: this Linter will not block the event loop for large documents.

NOTE: This class will not work properly in Node. In that case, just use LocalLinter.

Enumerations

Enumeration

Description

Dialect

Specifies an English Dialect, often used for linting.

SuggestionKind

Tags the variant of suggestion.

Functions

Function

Description

createBinaryModuleFromUrl(url)

packWeirpackFiles(files)

Convert a Weirpack file system into a real Weirpack binary by compressing and serializing them into a byte array.

For clarity on what a Weirpack is, read [the Weir documentation.](https://writewithharper.com/docs/weir\#Weirpacks)

unpackWeirpackBytes(bytes)

Decompress and deserialize a Weirpack from a byte array.

Interfaces

Interface

Description

BinaryModule

Linter

An interface for an object that can perform linting actions.

LinterInit

The properties and information needed to construct a Linter.

LintOptions

Options available to configure Harper's parser for an individual linting operation.

StructuredLintBoolSetting

StructuredLintConfig

StructuredLintGroupSetting

StructuredLintOneOfManySetting

Summary

Represents the summary of linting results and history. Useful to show linting statistics or insights to the user.

WeirpackTestFailure

Type Aliases

Type Alias

Description

LintConfig

A linting rule configuration dependent on upstream Harper's available rules. This is a record, since you shouldn't hard-code the existence of any particular rules and should generalize based on this struct.

LintKind

StructuredLintSetting

WeirpackArchive

WeirpackTestFailures