Skip to content

Expose report-related APIs in another package #39

@ikatyang

Description

@ikatyang

Currently, all the APIs are not exposed, so that it can't be reused by other linter-plugin, e.g. tslint-plugin-prettier (currently just copy-paste implementations from this repo).

It'd be better to expose report-related APIs in another package (since this repo has peerDeps for eslint), so that it can be reused in different linter plugin to have consistent behavior.

Suggested API

export declare function showInvisibles(str: string): string;
export declare function reportDifferences(source: string, formatted: string, reporters: Reporters);

export interface Reporters {
  reportInsert: (offset: number, text: string, message: string) => void;
  reportDelete: (offset: number, text: string, message: string) => void;
  reportReplace: (offset: number, deleteText: string, insertText: string, message: string) => void;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions