UNPKG

@lint-todo/utils

Version:

![CI Build](https://github.com/lint-todo/utils/workflows/CI%20Build/badge.svg) [![npm version](https://badge.fury.io/js/%40lint-todo%2Futils.svg)](https://badge.fury.io/js/%40lint-todo%2Futils) [![License](https://img.shields.io/npm/l/@checkup/cli.svg)](h

19 lines 1.49 kB
import { Engine, FilePath, GenericLintData, Operation, OperationType, TodoConfig, TodoData } from './types'; import TodoMatcher from './todo-matcher'; export declare function buildFromTodoOperations(todoOperations: Operation[], engine: Engine): Map<FilePath, TodoMatcher>; export declare function buildTodoOperations(add: Set<TodoData>, remove: Set<TodoData>): Operation[]; export declare function toTodoDatum(todoOperation: Operation): [OperationType, TodoData]; export declare function toOperation(operation: OperationType, todoDatum: TodoData): string; /** * Adapts a {@link https://github.com/lint-todo/utils/blob/master/src/types/lint.ts#L31|LintResult} to a {@link https://github.com/lint-todo/utils/blob/master/src/types/todo.ts#L61|TodoData}. FilePaths are absolute * when received from a lint result, so they're converted to relative paths for stability in * serializing the contents to disc. * * @param lintResult - The lint result object. * @param lintMessage - A lint message object representing a specific violation for a file. * @param todoConfig - An object containing the warn or error days, in integers. * @returns - A {@link https://github.com/lint-todo/utils/blob/master/src/types/todo.ts#L61|TodoData} object. */ export declare function buildTodoDatum(baseDir: string, genericLintData: GenericLintData, todoConfig?: TodoConfig): TodoData; export declare function generateHash(input: string, algorithm?: string): string; //# sourceMappingURL=builders.d.ts.map