UNPKG

prettier-plugin-sql

Version:

An opinionated sql formatter plugin for Prettier

20 lines (19 loc) 805 B
import type { AST, Option } from 'node-sql-parser'; import type { Options, ParserOptions, Plugin } from 'prettier'; import { type FormatOptions, type FormatOptionsWithLanguage } from 'sql-formatter'; declare const SQL_FORMATTER = "sql-formatter"; declare const NODE_SQL_PARSER = "node-sql-parser"; declare const SQL_CST = "sql-cst"; export type SqlBaseOptions = Option & Partial<(FormatOptions & { dialect: string; }) | (FormatOptionsWithLanguage & { dialect?: never; })> & { formatter?: typeof NODE_SQL_PARSER | typeof SQL_CST | typeof SQL_FORMATTER; params?: string; paramTypes?: string; }; export type SqlOptions = ParserOptions<AST> & SqlBaseOptions; export type SqlFormatOptions = Options & SqlBaseOptions; declare const SqlPlugin: Plugin<AST | string>; export default SqlPlugin;