prettier-plugin-sh
Version:
An opinionated `shellscript` formatter plugin for Prettier, also support simple format of `Dockerfile`, `properties`, `gitignore`, `dotenv`, `hosts`, `jvmoptions`...
35 lines (34 loc) • 1.08 kB
TypeScript
import type { Parser, ParserOptions, Plugin, Printer } from 'prettier';
import { type Node, type ParseError, type ShOptions, type ShPrintOptions } from 'sh-syntax';
export { languages } from './languages.js';
export interface DockerfilePrintOptions extends ParserOptions<string> {
indent?: number;
spaceRedirects?: boolean;
}
export interface ShParserOptions extends Partial<ParserOptions<Node>>, ShOptions {
filepath: string;
}
export type { ShPrintOptions };
export interface ShPrinterOptions extends ShPrintOptions {
filepath: string;
tabWidth: number;
}
export declare class ShSyntaxParseError<E extends Error = ParseError | SyntaxError> extends SyntaxError {
cause: E;
loc: {
start: {
column: number;
line: number;
};
} | undefined;
constructor(err: E);
}
export declare const parsers: {
dockerfile: Parser<string>;
sh: Parser<Node>;
};
export declare const printers: {
dockerfile: Printer<string>;
sh: Printer<string | Node>;
};
export declare const options: Plugin['options'];