Skip to content

⬅️ Back to Table of Contents

📄 Processor

📊 Analysis Summary

Metric Count
📦 Imports 1
📐 Interfaces 3
📑 Type Aliases 2

📚 Table of Contents

🛠️ File Location:

📂 packages/utils/src/ts-eslint/Processor.ts

📦 Imports

Name Source
Linter ./Linter

Interfaces

ProcessorMeta

Interface Code
export interface ProcessorMeta {
    /**
     * The unique name of the processor.
     */
    name: string;
    /**
     * The a string identifying the version of the processor.
     */
    version?: string;
  }

Properties

Name Type Optional Description
name string not shown
version string not shown

ProcessorModule

Interface Code
export interface ProcessorModule {
    /**
     * Information about the processor to uniquely identify it when serializing.
     */
    meta?: ProcessorMeta;

    /**
     * The function to merge messages.
     */
    postprocess?: PostProcess;

    /**
     * The function to extract code blocks.
     */
    preprocess?: PreProcess;

    /**
     * If `true` then it means the processor supports autofix.
     */
    supportsAutofix?: boolean;
  }

Properties

Name Type Optional Description
meta ProcessorMeta not shown
postprocess PostProcess not shown
preprocess PreProcess not shown
supportsAutofix boolean not shown

LooseProcessorModule

Interface Code
export interface LooseProcessorModule {
    /**
     * Information about the processor to uniquely identify it when serializing.
     */
    meta?: { [K in keyof ProcessorMeta]?: ProcessorMeta[K] | undefined };

    /**
     * The function to merge messages.
     */
    /*
    eslint-disable-next-line @typescript-eslint/no-explicit-any --
    intentionally using `any` to allow bi-directional assignment (unknown and
    never only allow unidirectional)
    */
    postprocess?: (messagesList: any, filename: string) => any;

    /**
     * The function to extract code blocks.
     */
    /*
    eslint-disable-next-line @typescript-eslint/no-explicit-any --
    intentionally using `any` to allow bi-directional assignment (unknown and
    never only allow unidirectional)
    */
    preprocess?: (text: string, filename: string) => any;

    /**
     * If `true` then it means the processor supports autofix.
     */
    supportsAutofix?: boolean | undefined;
  }

Properties

Name Type Optional Description
meta { [K in keyof ProcessorMeta]?: ProcessorMeta[K] \| undefined } not shown
postprocess (messagesList: any, filename: string) => any not shown
preprocess (text: string, filename: string) => any not shown
supportsAutofix boolean \| undefined not shown

Type Aliases

PreProcess

type PreProcess = (
    text: string,
    filename: string,
  ) => (string | { filename: string; text: string })[];

PostProcess

type PostProcess = (
    messagesList: Linter.LintMessage[][],
    filename: string,
  ) => Linter.LintMessage[];

Generated by Syntax Scribe