UNPKG

prettier-eslint

Version:

Formats your JavaScript using prettier followed by eslint --fix

31 lines (30 loc) • 1.17 kB
import type { Linter } from 'eslint'; import type { FormatOptions } from './types.ts'; /** * Formats the text with Prettier and then ESLint while obeying the user's * configuration. * * @returns The formatted string */ export declare function format(options: FormatOptions): Promise<string>; export declare const DEFAULT_ESLINT_EXTENSIONS: string[]; export declare const DEFAULT_ESLINT_FILES: string[]; /** * Analyzes and formats text with prettier and eslint, based on the identical * options as for the `format` function. It differs from `format` only in that * the return value is a simple object with properties `output` giving the * formatted code and `messages` giving any error messages generated in the * analysis. * * @param options To options parameter of `format` * @returns The return value is an object `r` such that `r.output` is the * formatted string and `r.messages` is an array of message specifications * from eslint. */ export declare function analyze(options: FormatOptions): Promise<{ output: string; messages: Linter.LintMessage[]; }>; export type * from './types.js'; export * from './utils.ts'; export default format;