prettier-plugin-sql
Advanced tools
Comparing version 0.16.0 to 0.17.0
/// <reference path="../shim.d.ts" /> | ||
import type { AST, Option } from 'node-sql-parser'; | ||
import type { Options, ParserOptions, Plugin } from 'prettier'; | ||
import { type FormatOptions } from 'sql-formatter'; | ||
import { 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> & { | ||
language?: string; | ||
export type SqlBaseOptions = Option & Partial<FormatOptionsWithLanguage> & { | ||
formatter?: typeof NODE_SQL_PARSER | typeof SQL_CST | typeof SQL_FORMATTER; | ||
@@ -11,0 +10,0 @@ params?: string; |
@@ -170,2 +170,22 @@ import { JSOX } from 'jsox'; | ||
}, | ||
identifierCase: { | ||
category: 'Output', | ||
type: 'choice', | ||
default: 'preserve', | ||
description: 'Converts identifiers to upper- or lowercase for `sql-formatter`. Only unquoted identifiers are converted. (experimental)', | ||
choices: [ | ||
{ | ||
value: 'preserve', | ||
description: 'preserves the original case', | ||
}, | ||
{ | ||
value: 'upper', | ||
description: 'converts to uppercase', | ||
}, | ||
{ | ||
value: 'lower', | ||
description: 'converts to lowercase', | ||
}, | ||
], | ||
}, | ||
uppercase: { | ||
@@ -217,28 +237,2 @@ category: 'Output', | ||
}, | ||
tabulateAlias: { | ||
category: 'Format', | ||
type: 'boolean', | ||
default: false, | ||
description: 'Aligns column aliases into a single column for `sql-formatter`. Does not effect table name aliases.', | ||
}, | ||
commaPosition: { | ||
category: 'Format', | ||
type: 'choice', | ||
default: 'after', | ||
description: 'Defines where to place commas in lists of columns for `sql-formatter`', | ||
choices: [ | ||
{ | ||
value: 'after', | ||
description: 'places comma at the end of line', | ||
}, | ||
{ | ||
value: 'before', | ||
description: 'places comma at the start of line', | ||
}, | ||
{ | ||
value: 'tabular', | ||
description: 'aligns commas in a column at the end of line', | ||
}, | ||
], | ||
}, | ||
expressionWidth: { | ||
@@ -245,0 +239,0 @@ category: 'Format', |
{ | ||
"name": "prettier-plugin-sql", | ||
"version": "0.16.0", | ||
"version": "0.17.0", | ||
"type": "module", | ||
@@ -50,3 +50,3 @@ "description": "An opinionated sql formatter plugin for Prettier", | ||
"node-sql-parser": "^4.11.0", | ||
"sql-formatter": "^13.1.0", | ||
"sql-formatter": "^14.0.0", | ||
"tslib": "^2.6.2" | ||
@@ -53,0 +53,0 @@ }, |
@@ -78,6 +78,5 @@ # prettier-plugin-sql ![npm bundle size](https://img.shields.io/bundlephobia/min/prettier-plugin-sql) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/prettier-plugin-sql) | ||
keywordCase: 'preserve' | 'upper' | 'lower' // default `preserve` | ||
identifierCase: 'preserve' | 'upper' | 'lower' // default `preserve`, experimental | ||
indentStyle: 'standard' | 'tabularLeft' | 'tabularRight' // default `standard` | ||
logicalOperatorNewline: 'before' | 'after' // default `before` | ||
tabulateAlias: boolean // default `false` | ||
commaPosition: 'after' | 'before' | 'tabular' // default `after` | ||
expressionWidth: number // default `50` | ||
@@ -84,0 +83,0 @@ linesBetweenQueries: number // default `1` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
62894
999
134
+ Addedsql-formatter@14.0.0(transitive)
- Removedsql-formatter@13.1.0(transitive)
Updatedsql-formatter@^14.0.0