Socket
Socket
Sign inDemoInstall

prettier-plugin-embed

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prettier-plugin-embed - npm Package Compare versions

Comparing version 0.3.2 to 0.4.0

dist/embedded/css/language.d.ts

7

dist/embedded/css/embedder.d.ts
import type { Options } from "prettier";
import type { Embedder } from "../../types.js";
import { embeddedLanguage } from "./embedded-language.js";
import { language } from "./language.js";
export declare const embedder: Embedder<Options>;
/**
* Register the embedder to the EmbeddedEmbedders
*/
declare module "../types.js" {
interface EmbeddedEmbedders {
[embeddedLanguage]: typeof embedder;
[language]: typeof embedder;
}
}

@@ -1,3 +0,3 @@

export * from "./embedded-language.js";
export * from "./embedder.js";
export * from "./language.js";
export * from "./options.js";
import { type AutocompleteStringList, type StringListToInterfaceKey } from "../utils.js";
/** References:
/**
* References:
*
* - https://github.com/microsoft/vscode/blob/de0121cf0e05d1673903551b6dbb2871556bfae9/extensions/css/package.json#L22

@@ -13,10 +15,10 @@ * - https://github.com/github-linguist/linguist/blob/7ca3799b8b5f1acde1dd7a8dfb7ae849d3dfb4cd/lib/linguist/languages.yml#L887

export declare const options: {
embeddedCssIdentifiers: {
category: "Global";
type: "string";
array: true;
default: {
value: "css"[];
}[];
description: string;
readonly embeddedCssIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: ["css"];
}];
readonly description: "Specify embedded CSS language identifiers.";
};

@@ -23,0 +25,0 @@ };

import type { Options } from "prettier";
import type { Embedder } from "../../types.js";
import { embeddedLanguage } from "./embedded-language.js";
import { language } from "./language.js";
export declare const embedder: Embedder<Options>;
/**
* Register the embedder to the EmbeddedEmbedders
*/
declare module "../types.js" {
interface EmbeddedEmbedders {
[embeddedLanguage]: typeof embedder;
[language]: typeof embedder;
}
}

@@ -1,3 +0,3 @@

export * from "./embedded-language.js";
export * from "./embedder.js";
export * from "./language.js";
export * from "./options.js";
import { type AutocompleteStringList, type StringListToInterfaceKey } from "../utils.js";
/** References:
/**
* References:
*
* - https://github.com/microsoft/vscode/blob/de0121cf0e05d1673903551b6dbb2871556bfae9/extensions/javascript/package.json#L37

@@ -9,4 +11,4 @@ * - https://github.com/github-linguist/linguist/blob/7ca3799b8b5f1acde1dd7a8dfb7ae849d3dfb4cd/lib/linguist/languages.yml#L3314

type DefaultIdentifiersHolder = StringListToInterfaceKey<typeof DEFAULT_IDENTIFIERS>;
declare const DEFAULT_ES_PARSERS: readonly ["babel", "babel-flow", "acorn", "espree", "flow", "meriyah"];
type EsParser = (typeof DEFAULT_ES_PARSERS)[number];
declare const ES_PARSERS: readonly ["babel", "babel-flow", "acorn", "espree", "flow", "meriyah"];
type EsParser = (typeof ES_PARSERS)[number];
declare const EMBEDDED_LANGUAGE_IDENTIFIERS: "embeddedEsIdentifiers";

@@ -17,17 +19,20 @@ declare const EMBEDDED_LANGUAGE_PARSER: "embeddedEsParser";

export declare const options: {
embeddedEsIdentifiers: {
category: "Global";
type: "string";
array: true;
default: {
value: ("js" | "jsx" | "es" | "es6" | "mjs" | "cjs" | "pac" | "javascript")[];
}[];
description: string;
readonly embeddedEsIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: ["js", "jsx", "es", "es6", "mjs", "cjs", "pac", "javascript"];
}];
readonly description: "Specify embedded ES language identifiers.";
};
embeddedEsParser: {
category: "Global";
type: "string";
array: false;
default: string;
readonly embeddedEsParser: {
category: string;
type: "choice";
default: "babel";
description: string;
choices: {
value: "babel" | "babel-flow" | "acorn" | "espree" | "flow" | "meriyah";
description: string;
}[];
};

@@ -34,0 +39,0 @@ };

import type { Options } from "prettier";
import type { Embedder } from "../../types.js";
import { embeddedLanguage } from "./embedded-language.js";
import { language } from "./language.js";
export declare const embedder: Embedder<Options>;
/**
* Register the embedder to the EmbeddedEmbedders
*/
declare module "../types.js" {
interface EmbeddedEmbedders {
[embeddedLanguage]: typeof embedder;
[language]: typeof embedder;
}
}

@@ -1,3 +0,3 @@

export * from "./embedded-language.js";
export * from "./embedder.js";
export * from "./language.js";
export * from "./options.js";
import { type AutocompleteStringList, type StringListToInterfaceKey } from "../utils.js";
/** References:
/**
* References:
*
* - https://github.com/NaridaL/glsl-language-toolkit/blob/a7bd08d3f31355b335ae002b6a44c2999998b952/packages/prettier-plugin-glsl/src/prettier-plugin.ts#L88
* - https://github.com/github-linguist/linguist/blob/7ca3799b8b5f1acde1dd7a8dfb7ae849d3dfb4cd/lib/linguist/languages.yml#L2180
*/
declare const DEFAULT_IDENTIFIERS: readonly ["glsl", "fp", "frag", "frg", "fs", "fsh", "fshader", "geo", "geom", "glslf", "glslv", "gs", "gshader", "rchit", "rmiss", "shader", "tesc", "tese", "vert", "vrx", "vsh", "vshader"];
declare const DEFAULT_IDENTIFIERS: readonly ["glsl", "shader"];
type Identifiers = AutocompleteStringList<typeof DEFAULT_IDENTIFIERS>;
type DefaultIdentifiersHolder = StringListToInterfaceKey<typeof DEFAULT_IDENTIFIERS>;
declare const embeddedLanguageIdentifiers: "embeddedGlslIdentifiers";
declare const EMBEDDED_LANGUAGE_IDENTIFIERS: "embeddedGlslIdentifiers";
export interface PrettierPluginDepsOptions {
}
export declare const options: {
embeddedGlslIdentifiers: {
category: "Global";
type: "string";
array: true;
default: {
value: ("glsl" | "fp" | "frag" | "frg" | "fs" | "fsh" | "fshader" | "geo" | "geom" | "glslf" | "glslv" | "gs" | "gshader" | "rchit" | "rmiss" | "shader" | "tesc" | "tese" | "vert" | "vrx" | "vsh" | "vshader")[];
}[];
description: string;
readonly embeddedGlslIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: ["glsl", "shader"];
}];
readonly description: "Specify embedded GLSL language identifiers. This requires \"prettier-plugin-glsl\".";
};

@@ -30,3 +32,3 @@ };

interface PrettierPluginEmbedOptions {
[embeddedLanguageIdentifiers]?: Identifiers;
[EMBEDDED_LANGUAGE_IDENTIFIERS]?: Identifiers;
}

@@ -33,0 +35,0 @@ }

import type { Options } from "prettier";
import type { Embedder } from "../../types.js";
import { embeddedLanguage } from "./embedded-language.js";
import { language } from "./language.js";
export declare const embedder: Embedder<Options>;
/**
* Register the embedder to the EmbeddedEmbedders
*/
declare module "../types.js" {
interface EmbeddedEmbedders {
[embeddedLanguage]: typeof embedder;
[language]: typeof embedder;
}
}

@@ -1,3 +0,3 @@

export * from "./embedded-language.js";
export * from "./embedder.js";
export * from "./language.js";
export * from "./options.js";
import { type AutocompleteStringList, type StringListToInterfaceKey } from "../utils.js";
/** References
/**
* References
*
* - https://github.com/microsoft/vscode/blob/de0121cf0e05d1673903551b6dbb2871556bfae9/extensions/html/package.json#L18
* - https://github.com/github-linguist/linguist/blob/7ca3799b8b5f1acde1dd7a8dfb7ae849d3dfb4cd/lib/linguist/languages.yml#L2684
*/
declare const DEFAULT_IDENTIFIERS: readonly ["html", "htm", "shtml", "xhtml", "xht", "mdoc", "jsp", "asp", "aspx", "jshtm", "volt", "rhtml"];
declare const DEFAULT_IDENTIFIERS: readonly ["html", "xhtml"];
type Identifiers = AutocompleteStringList<typeof DEFAULT_IDENTIFIERS>;
type DefaultIdentifiersHolder = StringListToInterfaceKey<typeof DEFAULT_IDENTIFIERS>;
declare const embeddedLanguageIdentifiers: "embeddedHtmlIdentifiers";
declare const EMBEDDED_LANGUAGE_IDENTIFIERS: "embeddedHtmlIdentifiers";
export interface PrettierPluginDepsOptions {
}
export declare const options: {
embeddedHtmlIdentifiers: {
category: "Global";
type: "string";
array: true;
default: {
value: ("html" | "htm" | "shtml" | "xhtml" | "xht" | "mdoc" | "jsp" | "asp" | "aspx" | "jshtm" | "volt" | "rhtml")[];
}[];
description: string;
readonly embeddedHtmlIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: ["html", "xhtml"];
}];
readonly description: "Specify embedded HTML language identifiers.";
};

@@ -30,3 +32,3 @@ };

interface PrettierPluginEmbedOptions {
[embeddedLanguageIdentifiers]?: Identifiers;
[EMBEDDED_LANGUAGE_IDENTIFIERS]?: Identifiers;
}

@@ -33,0 +35,0 @@ }

import { type Options } from "prettier";
import type { Embedder } from "../../types.js";
import { embeddedLanguage } from "./embedded-language.js";
import { language } from "./language.js";
export declare const embedder: Embedder<Options>;
/**
* Register the embedder to the EmbeddedEmbedders
*/
declare module "../types.js" {
interface EmbeddedEmbedders {
[embeddedLanguage]: typeof embedder;
[language]: typeof embedder;
}
}

@@ -1,3 +0,3 @@

export * from "./embedded-language.js";
export * from "./embedder.js";
export * from "./language.js";
export * from "./options.js";
import { type AutocompleteStringList, type StringListToInterfaceKey } from "../utils.js";
/** References:
/**
* References:
*
* - https://github.com/microsoft/vscode/blob/de0121cf0e05d1673903551b6dbb2871556bfae9/extensions/markdown-basics/package.json#L19
* - https://github.com/github-linguist/linguist/blob/7ca3799b8b5f1acde1dd7a8dfb7ae849d3dfb4cd/lib/linguist/languages.yml#L4060
*/
declare const DEFAULT_IDENTIFIERS: readonly ["md", "livemd", "markdown", "mdown", "mdwn", "mkd", "mkdn", "mkdown", "ronn", "scd", "workbook"];
declare const DEFAULT_IDENTIFIERS: readonly ["md", "markdown"];
type Identifiers = AutocompleteStringList<typeof DEFAULT_IDENTIFIERS>;

@@ -14,10 +16,10 @@ type DefaultIdentifiersHolder = StringListToInterfaceKey<typeof DEFAULT_IDENTIFIERS>;

export declare const options: {
embeddedMarkdownIdentifiers: {
category: "Global";
type: "string";
array: true;
default: {
value: ("md" | "livemd" | "markdown" | "mdown" | "mdwn" | "mkd" | "mkdn" | "mkdown" | "ronn" | "scd" | "workbook")[];
}[];
description: string;
readonly embeddedMarkdownIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: ["md", "markdown"];
}];
readonly description: "Specify embedded Markdown language identifiers.";
};

@@ -24,0 +26,0 @@ };

@@ -1,2 +0,2 @@

export * from "./embedded-language.js";
export * from "./language.js";
export * from "./options.js";
import type { EmbeddedDefaultIdentifier } from "../types.js";
import { type AutocompleteStringList } from "../utils.js";
type EmbeddedIdentifiers = AutocompleteStringList<EmbeddedDefaultIdentifier[]>;
declare const embeddedLanguageIdentifiers: "embeddedNoopIdentifiers";
declare const EMBEDDED_LANGUAGE_IDENTIFIERS: "embeddedNoopIdentifiers";
export declare const options: {
embeddedNoopIdentifiers: {
category: "Global";
type: "string";
array: true;
default: {
value: never[];
}[];
description: string;
readonly embeddedNoopIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: [];
}];
readonly description: "Specify embedded language identifiers that will not be formatted.";
};

@@ -21,5 +21,5 @@ };

interface PrettierPluginEmbedOptions {
[embeddedLanguageIdentifiers]?: EmbeddedIdentifiers;
[EMBEDDED_LANGUAGE_IDENTIFIERS]?: EmbeddedIdentifiers;
}
}
export {};
import type { Options } from "prettier";
import type { Embedder } from "../../types.js";
import { embeddedLanguage } from "./embedded-language.js";
import { language } from "./language.js";
export declare const embedder: Embedder<Options>;
/**
* Register the embedder to the EmbeddedEmbedders
*/
declare module "../types.js" {
interface EmbeddedEmbedders {
[embeddedLanguage]: typeof embedder;
[language]: typeof embedder;
}
}

@@ -1,3 +0,3 @@

export * from "./embedded-language.js";
export * from "./embedder.js";
export * from "./language.js";
export * from "./options.js";
import { type AutocompleteStringList, type StringListToInterfaceKey } from "../utils.js";
/** References
/**
* References
*
* - https://github.com/microsoft/vscode/blob/de0121cf0e05d1673903551b6dbb2871556bfae9/extensions/php/package.json#L15
* - https://github.com/github-linguist/linguist/blob/7ca3799b8b5f1acde1dd7a8dfb7ae849d3dfb4cd/lib/linguist/languages.yml#L4971
*/
declare const DEFAULT_IDENTIFIERS: readonly ["php", "php5", "phtml", "ctp"];
declare const DEFAULT_IDENTIFIERS: readonly ["php", "php5"];
type Identifiers = AutocompleteStringList<typeof DEFAULT_IDENTIFIERS>;
type DefaultIdentifiersHolder = StringListToInterfaceKey<typeof DEFAULT_IDENTIFIERS>;
declare const embeddedLanguageIdentifiers: "embeddedPhpIdentifiers";
declare const EMBEDDED_LANGUAGE_IDENTIFIERS: "embeddedPhpIdentifiers";
export interface PrettierPluginDepsOptions {

@@ -16,10 +18,10 @@ phpVersion?: "5.0" | "5.1" | "5.2" | "5.3" | "5.4" | "5.5" | "5.6" | "7.0" | "7.1" | "7.2" | "7.3" | "7.4" | "8.0" | "8.1" | "8.2";

export declare const options: {
embeddedPhpIdentifiers: {
category: "Global";
type: "string";
array: true;
default: {
value: ("php" | "php5" | "phtml" | "ctp")[];
}[];
description: string;
readonly embeddedPhpIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: ["php", "php5"];
}];
readonly description: "Specify embedded PHP language identifiers. This requires \"@prettier/plugin-php\".";
};

@@ -34,3 +36,3 @@ };

interface PrettierPluginEmbedOptions {
[embeddedLanguageIdentifiers]?: Identifiers;
[EMBEDDED_LANGUAGE_IDENTIFIERS]?: Identifiers;
}

@@ -37,0 +39,0 @@ }

@@ -7,11 +7,19 @@ import type { EmbeddedEmbedders, EmbeddedLanguage, EmbeddedOptions, EmbeddedParsers } from "./types.js";

import * as __glob__0_0 from "./css/index.js";
import * as __glob__0_1 from "./html/index.js";
import * as __glob__0_1 from "./es/index.js";
import * as __glob__0_2 from "./glsl/index.js";
import * as __glob__0_3 from "./es/index.js";
import * as __glob__0_4 from "./markdown/index.js";
import * as __glob__0_5 from "./noop/index.js";
import * as __glob__0_6 from "./php/index.js";
import * as __glob__0_7 from "./ruby/index.js";
import * as __glob__0_8 from "./sql/index.js";
import * as __glob__0_9 from "./ts/index.js";
import * as __glob__0_10 from "./xml/index.js";
import * as __glob__0_3 from "./graphql/index.js";
import * as __glob__0_4 from "./html/index.js";
import * as __glob__0_5 from "./ini/index.js";
import * as __glob__0_6 from "./json/index.js";
import * as __glob__0_7 from "./latex/index.js";
import * as __glob__0_8 from "./markdown/index.js";
import * as __glob__0_9 from "./noop/index.js";
import * as __glob__0_10 from "./php/index.js";
import * as __glob__0_11 from "./properties/index.js";
import * as __glob__0_12 from "./ruby/index.js";
import * as __glob__0_13 from "./sh/index.js";
import * as __glob__0_14 from "./sql/index.js";
import * as __glob__0_15 from "./toml/index.js";
import * as __glob__0_16 from "./ts/index.js";
import * as __glob__0_17 from "./xml/index.js";
import * as __glob__0_18 from "./yaml/index.js";
import type { Options } from "prettier";
import type { Embedder } from "../../types.js";
import { embeddedLanguage } from "./embedded-language.js";
import { language } from "./language.js";
export declare const embedder: Embedder<Options>;
/**
* Register the embedder to the EmbeddedEmbedders
*/
declare module "../types.js" {
interface EmbeddedEmbedders {
[embeddedLanguage]: typeof embedder;
[language]: typeof embedder;
}
}

@@ -1,3 +0,3 @@

export * from "./embedded-language.js";
export * from "./embedder.js";
export * from "./language.js";
export * from "./options.js";
import { type AutocompleteStringList, type StringListToInterfaceKey } from "../utils.js";
declare const RUBY_PARSERS: readonly ["ruby", "rbs", "haml"];
export type RubyParser = (typeof RUBY_PARSERS)[number];
/** References
/**
* References
*
* - https://github.com/prettier/plugin-ruby/blob/0a2100ca3b8b53d9491270ece64806d95da181a6/src/plugin.js#L194
*/
export declare const RUBY_PARSER_IDENTIFIERS: readonly ["ruby", "arb", "axlsx", "builder", "eye", "fcgi", "gemfile", "gemspec", "god", "jb", "jbuilder", "mspec", "opal", "pluginspec", "podspec", "rabl", "rake", "rb", "rbi", "rbuild", "rbw", "rbx", "ru", "thor", "watchr"];
export type RubyParserIdentifier = (typeof RUBY_PARSER_IDENTIFIERS)[number];
export declare const RBS_PARSER_IDENTIFIERS: readonly ["rbs"];
export type RbsParserIdentifier = (typeof RBS_PARSER_IDENTIFIERS)[number];
export declare const HAML_PARSER_IDENTIFIERS: readonly ["haml"];
export type HamlParserIdentifier = (typeof HAML_PARSER_IDENTIFIERS)[number];
declare const DEFAULT_IDENTIFIERS: readonly ["ruby", "arb", "axlsx", "builder", "eye", "fcgi", "gemfile", "gemspec", "god", "jb", "jbuilder", "mspec", "opal", "pluginspec", "podspec", "rabl", "rake", "rb", "rbi", "rbuild", "rbw", "rbx", "ru", "thor", "watchr", "rbs", "haml"];
declare const DEFAULT_IDENTIFIERS: readonly ["ruby"];
type Identifiers = AutocompleteStringList<typeof DEFAULT_IDENTIFIERS>;
type DefaultIdentifiersHolder = StringListToInterfaceKey<typeof DEFAULT_IDENTIFIERS>;
declare const RUBY_PARSERS: readonly ["ruby", "rbs", "haml"];
export type RubyParser = (typeof RUBY_PARSERS)[number];
declare const EMBEDDED_LANGUAGE_PARSER = "embeddedRubyParser";
declare const embeddedLanguageIdentifiers: "embeddedRubyIdentifiers";
declare const EMBEDDED_LANGUAGE_IDENTIFIERS: "embeddedRubyIdentifiers";
export interface PrettierPluginDepsOptions {

@@ -28,17 +24,20 @@ rubyPlugins?: AutocompleteStringList<[

export declare const options: {
embeddedRubyIdentifiers: {
category: "Global";
type: "string";
array: true;
default: {
value: ("ruby" | "rbs" | "haml" | "arb" | "axlsx" | "builder" | "eye" | "fcgi" | "gemfile" | "gemspec" | "god" | "jb" | "jbuilder" | "mspec" | "opal" | "pluginspec" | "podspec" | "rabl" | "rake" | "rb" | "rbi" | "rbuild" | "rbw" | "rbx" | "ru" | "thor" | "watchr")[];
}[];
description: string;
readonly embeddedRubyIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: ["ruby"];
}];
readonly description: "Specify embedded Ruby language identifiers. This requires \"@prettier/plugin-ruby\".";
};
embeddedRubyParser: {
category: "Global";
type: "string";
array: false;
default: undefined;
readonly embeddedRubyParser: {
category: string;
type: "choice";
default: "ruby";
description: string;
choices: {
value: "ruby" | "rbs" | "haml";
description: string;
}[];
};

@@ -53,3 +52,3 @@ };

interface PrettierPluginEmbedOptions {
[embeddedLanguageIdentifiers]?: Identifiers;
[EMBEDDED_LANGUAGE_IDENTIFIERS]?: Identifiers;
[EMBEDDED_LANGUAGE_PARSER]?: RubyParser;

@@ -56,0 +55,0 @@ }

import type { Options } from "prettier";
import type { Embedder } from "../../types.js";
import { embeddedLanguage } from "./embedded-language.js";
import { language } from "./language.js";
export declare const embedder: Embedder<Options>;
/**
* Register the embedder to the EmbeddedEmbedders
*/
declare module "../types.js" {
interface EmbeddedEmbedders {
[embeddedLanguage]: typeof embedder;
[language]: typeof embedder;
}
}

@@ -1,3 +0,3 @@

export * from "./embedded-language.js";
export * from "./embedder.js";
export * from "./language.js";
export * from "./options.js";

@@ -1,6 +0,9 @@

import type { SqlBaseOptions as PrettierPluginDepsOptions } from "prettier-plugin-sql";
import { type AutocompleteStringList, type StringListToInterfaceKey } from "../utils.js";
/** References
* - https://github.com/un-ts/prettier/blob/master/packages/sql/src/index.ts
* "sql" is the default dialect, so we only have "sql" as the default identifier to avoid confusion.
import type { SqlBaseOptions as PrettierPluginSqlOptions } from "prettier-plugin-sql";
import type { SqlPluginOptions as PrettierPluginSqlCstRequiredOptions } from "prettier-plugin-sql-cst";
import { type AutocompleteStringList, type StringListToInterfaceKey, type UnionToIntersection } from "../utils.js";
/**
* References
*
* - https://github.com/un-ts/prettier/blob/master/packages/sql/src/index.ts "sql" is the default
* dialect, so we only have "sql" as the default identifier to avoid confusion.
*/

@@ -10,14 +13,48 @@ declare const DEFAULT_IDENTIFIERS: readonly ["sql"];

type DefaultIdentifiersHolder = StringListToInterfaceKey<typeof DEFAULT_IDENTIFIERS>;
declare const embeddedLanguageIdentifiers: "embeddedSqlIdentifiers";
export { PrettierPluginDepsOptions };
declare const SQL_PLUGINS: readonly ["prettier-plugin-sql", "prettier-plugin-sql-cst"];
type SqlPlugin = (typeof SQL_PLUGINS)[number];
declare const SQL_CST_PARSERS: readonly ["sqlite", "bigquery"];
type SqlCstParser = (typeof SQL_CST_PARSERS)[number];
declare const EMBEDDED_LANGUAGE_IDENTIFIERS: "embeddedSqlIdentifiers";
declare const EMBEDDED_LANGUAGE_PLUGIN: "embeddedSqlPlugin";
declare const EMBEDDED_LANGUAGE_PARSER: "embeddedSqlParser";
type PrettierPluginSqlCstOptions = Partial<PrettierPluginSqlCstRequiredOptions>;
export interface PrettierPluginDepsOptions extends UnionToIntersection<PrettierPluginSqlOptions>, PrettierPluginSqlCstOptions {
}
export declare const options: {
embeddedSqlIdentifiers: {
category: "Global";
type: "string";
array: true;
default: {
value: "sql"[];
}[];
readonly embeddedSqlIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: ["sql"];
}];
readonly description: "Specify embedded SQL language identifiers. This requires \"prettier-plugin-sql\" or \"prettier-plugin-sql-cst\".";
};
readonly embeddedSqlPlugin: {
category: string;
type: "choice";
default: "prettier-plugin-sql";
description: string;
choices: ({
value: "prettier-plugin-sql";
description: string;
} | {
value: "prettier-plugin-sql-cst";
description: string;
})[];
};
readonly embeddedSqlParser: {
category: string;
type: "choice";
default: "sqlite";
description: string;
choices: ({
value: "sqlite";
description: string;
} | {
value: "bigquery";
description: string;
})[];
};
};

@@ -31,3 +68,5 @@ type Options = typeof options;

interface PrettierPluginEmbedOptions {
[embeddedLanguageIdentifiers]?: Identifiers;
[EMBEDDED_LANGUAGE_IDENTIFIERS]?: Identifiers;
[EMBEDDED_LANGUAGE_PLUGIN]?: SqlPlugin;
[EMBEDDED_LANGUAGE_PARSER]?: SqlCstParser;
}

@@ -39,1 +78,2 @@ }

}
export {};
import type { Options } from "prettier";
import type { Embedder } from "../../types.js";
import { embeddedLanguage } from "./embedded-language.js";
import { language } from "./language.js";
export declare const embedder: Embedder<Options>;
/**
* Register the embedder to the EmbeddedEmbedders
*/
declare module "../types.js" {
interface EmbeddedEmbedders {
[embeddedLanguage]: typeof embedder;
[language]: typeof embedder;
}
}

@@ -1,3 +0,3 @@

export * from "./embedded-language.js";
export * from "./embedder.js";
export * from "./language.js";
export * from "./options.js";
import { type AutocompleteStringList, type StringListToInterfaceKey } from "../utils.js";
/** References:
/**
* References:
*
* - https://github.com/microsoft/vscode/blob/de0121cf0e05d1673903551b6dbb2871556bfae9/extensions/typescript-basics/package.json#L24

@@ -9,4 +11,4 @@ * - https://github.com/github-linguist/linguist/blob/7ca3799b8b5f1acde1dd7a8dfb7ae849d3dfb4cd/lib/linguist/languages.yml#L7158

type DefaultIdentifiersHolder = StringListToInterfaceKey<typeof DEFAULT_IDENTIFIERS>;
declare const DEFAULT_TS_PARSERS: readonly ["typescript", "babel-ts"];
type TsParser = (typeof DEFAULT_TS_PARSERS)[number];
declare const TS_PARSERS: readonly ["typescript", "babel-ts"];
type TsParser = (typeof TS_PARSERS)[number];
declare const EMBEDDED_LANGUAGE_PARSER: "embeddedTsParser";

@@ -17,17 +19,20 @@ declare const EMBEDDED_LANGUAGE_IDENTIFIERS: "embeddedTsIdentifiers";

export declare const options: {
embeddedTsIdentifiers: {
category: "Global";
type: "string";
array: true;
default: {
value: ("ts" | "tsx" | "cts" | "mts" | "typescript")[];
}[];
description: string;
readonly embeddedTsIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: ["ts", "tsx", "cts", "mts", "typescript"];
}];
readonly description: "Specify embedded TS language parsers.";
};
embeddedTsParser: {
category: "Global";
type: "string";
array: false;
default: string;
readonly embeddedTsParser: {
category: string;
type: "choice";
default: "typescript";
description: string;
choices: {
value: "typescript" | "babel-ts";
description: string;
}[];
};

@@ -34,0 +39,0 @@ };

@@ -11,3 +11,3 @@ import type { Comment, Expression, TemplateLiteral } from "estree";

export declare function throwIfPluginIsNotFound(pluginName: string, options: Options, identifier: string): void;
export declare function insertEmbeddedLanguage(embeddedLanguages: string[], embeddedLanguage: string, firstEmbeddedLanguage: string): void;
export declare function insertLanguage(languages: string[], language: string, firstLanguage: string): void;
export declare const randomUUID: () => string;

@@ -20,2 +20,3 @@ export declare function preparePlaceholder(leading?: string, trailing?: string): {

export declare function makeIdentifiersOptionName<T extends string>(language: T): `${T}Identifiers`;
export declare function makePluginOptionName<T extends string>(language: T): `${T}Plugin`;
export declare function makeParserOptionName<T extends string>(language: T): `${T}Parser`;

@@ -27,1 +28,2 @@ export type AutocompleteStringList<T extends readonly string[]> = (T[number][] & string[]) | string[];

export type Satisfies<U, T extends U> = T;
export type UnionToIntersection<U> = (U extends unknown ? (x: U) => void : never) extends (x: infer I) => void ? I : never;
import type { Options } from "prettier";
import type { Embedder } from "../../types.js";
import { embeddedLanguage } from "./embedded-language.js";
import { language } from "./language.js";
export declare const embedder: Embedder<Options>;
/**
* Register the embedder to the EmbeddedEmbedders
*/
declare module "../types.js" {
interface EmbeddedEmbedders {
[embeddedLanguage]: typeof embedder;
[language]: typeof embedder;
}
}

@@ -1,4 +0,4 @@

export * from "./embedded-language.js";
export * from "./embedder.js";
export * from "./language.js";
export * from "./options.js";
export * from "./parser.js";
import { type AutocompleteStringList, type StringListToInterfaceKey } from "../utils.js";
/** References:
/**
* References:
*
* - https://github.com/microsoft/vscode/blob/de0121cf0e05d1673903551b6dbb2871556bfae9/extensions/xml/package.json#L15
* - https://github.com/github-linguist/linguist/blob/7ca3799b8b5f1acde1dd7a8dfb7ae849d3dfb4cd/lib/linguist/languages.yml#L7712
*/
declare const DEFAULT_IDENTIFIERS: readonly ["xml", "xsd", "ascx", "atom", "axml", "axaml", "bpmn", "cpt", "csl", "csproj", "dita", "ditamap", "dtd", "ent", "mod", "dtml", "fsproj", "fxml", "iml", "isml", "jmx", "launch", "menu", "nuspec", "opml", "owl", "proj", "props", "pt", "publishsettings", "pubxml", "rbxlx", "rbxmx", "rdf", "rng", "rss", "shproj", "storyboard", "svg", "targets", "tld", "tmx", "vbproj", "vcxproj", "wsdl", "wxi", "wxl", "wxs", "xaml", "xbl", "xib", "xlf", "xliff", "xpdl", "xul", "xoml"];
declare const DEFAULT_IDENTIFIERS: readonly ["xml", "opml", "rss", "svg"];
type Identifiers = AutocompleteStringList<typeof DEFAULT_IDENTIFIERS>;
type DefaultIdentifiersHolder = StringListToInterfaceKey<typeof DEFAULT_IDENTIFIERS>;
declare const embeddedLanguageIdentifiers: "embeddedXmlIdentifiers";
declare const EMBEDDED_LANGUAGE_IDENTIFIERS: "embeddedXmlIdentifiers";
export interface PrettierPluginDepsOptions {

@@ -17,20 +19,22 @@ xmlSelfClosingSpace?: boolean;

export declare const options: {
embeddedXmlIdentifiers: {
category: "Global";
type: "string";
array: true;
default: {
value: ("xml" | "xsd" | "ascx" | "atom" | "axml" | "axaml" | "bpmn" | "cpt" | "csl" | "csproj" | "dita" | "ditamap" | "dtd" | "ent" | "mod" | "dtml" | "fsproj" | "fxml" | "iml" | "isml" | "jmx" | "launch" | "menu" | "nuspec" | "opml" | "owl" | "proj" | "props" | "pt" | "publishsettings" | "pubxml" | "rbxlx" | "rbxmx" | "rdf" | "rng" | "rss" | "shproj" | "storyboard" | "svg" | "targets" | "tld" | "tmx" | "vbproj" | "vcxproj" | "wsdl" | "wxi" | "wxl" | "wxs" | "xaml" | "xbl" | "xib" | "xlf" | "xliff" | "xpdl" | "xul" | "xoml")[];
}[];
description: string;
readonly embeddedXmlIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: ["xml", "opml", "rss", "svg"];
}];
readonly description: "Specify embedded XML language identifiers. This requires \"@prettier/plugin-xml\".";
};
/** @internal */
__embeddedXmlFragmentRecoverIndex: {
category: "Global";
type: "int";
array: true;
default: {
value: never[];
}[];
description: string;
/**
* @internal
*/
readonly __embeddedXmlFragmentRecoverIndex: {
readonly category: "Embed";
readonly type: "int";
readonly array: true;
readonly default: [{
readonly value: [];
}];
readonly description: "This option is read only and used as a workaround to support xml fragments";
};

@@ -45,3 +49,3 @@ };

interface PrettierPluginEmbedOptions {
[embeddedLanguageIdentifiers]?: Identifiers;
[EMBEDDED_LANGUAGE_IDENTIFIERS]?: Identifiers;
}

@@ -48,0 +52,0 @@ }

import type { CstNode } from "chevrotain";
import type { Parser } from "prettier";
import { embeddedLanguage } from "./embedded-language.js";
import { language } from "./language.js";
export declare const parser: Parser<CstNode>;
declare module "../types.js" {
interface EmbeddedParsers {
[embeddedLanguage]: Parser;
[language]: Parser;
}
}

@@ -1,21 +0,21 @@

import { utils as q, builders as I } from "prettier/doc";
import Qe from "prettier/parser-babel";
import Ze from "prettier/parser-espree";
import et from "prettier/parser-flow";
import tt from "prettier/parser-meriyah";
import nt from "prettier/parser-typescript";
import { printers as rt } from "prettier/plugins/estree.mjs";
import { readFile as ot } from "node:fs/promises";
import { isAbsolute as st, dirname as it, resolve as at, extname as ct } from "node:path";
import { Worker as dt } from "node:worker_threads";
import { resolveConfigFile as lt } from "prettier";
const Me = "embeddedCss", { group: ut, indent: mt, softline: V, lineSuffixBoundary: gt } = I, { mapDoc: pt } = q;
function ft(t, n) {
import { utils as X, builders as I } from "prettier/doc";
import Rt from "prettier/parser-babel";
import jt from "prettier/parser-espree";
import Ft from "prettier/parser-flow";
import wt from "prettier/parser-meriyah";
import Bt from "prettier/parser-typescript";
import { printers as Ut } from "prettier/plugins/estree.mjs";
import { readFile as Wt } from "node:fs/promises";
import { isAbsolute as Ct, dirname as Gt, resolve as qt, extname as zt } from "node:path";
import { Worker as Kt } from "node:worker_threads";
import { resolveConfigFile as Ht } from "prettier";
const { group: Jt, indent: Xt, softline: ie, lineSuffixBoundary: Yt } = I, { mapDoc: Qt } = X;
function Vt(t, n) {
const { node: r } = t;
let e = n();
return r?.comments?.length && (e = ut([mt([V, e]), V])), ["${", e, gt, "}"];
return r?.comments?.length && (e = Jt([Xt([ie, e]), ie])), ["${", e, Yt, "}"];
}
function D(t, n) {
function x(t, n) {
return t.map(
(r) => ft(r, n),
(r) => Vt(r, n),
"expressions"

@@ -25,14 +25,14 @@ );

function L(t, n, r) {
return pt(t, (o) => {
return Qt(t, (o) => {
if (typeof o != "string")
return o;
const s = [], a = o.split(n);
for (let i = 0; i < a.length; i++) {
let l = a[i];
if (i % 2 == 0) {
if (!l)
const s = [], l = o.split(n);
for (let d = 0; d < l.length; d++) {
let p = l[d];
if (d % 2 == 0) {
if (!p)
continue;
l = l.replaceAll(/([\\`]|\${)/g, "\\$1"), s.push(l);
p = p.replaceAll(/([\\`]|\${)/g, "\\$1"), s.push(p);
} else {
const c = Number(l);
const c = Number(p);
s.push(r[c]);

@@ -44,5 +44,5 @@ }

}
function B(t, n, r) {
function M(t, n, r) {
if (!(n.plugins?.some(
(e) => e.name?.includes(t) ?? !1
(e) => e.name?.endsWith(t) ?? !1
) ?? !1))

@@ -53,3 +53,3 @@ throw new Error(

}
function ht(t, n, r) {
function Zt(t, n, r) {
if (n === r) {

@@ -70,3 +70,3 @@ t.unshift(n);

}
const Q = (() => {
const Y = (() => {
const t = [...Array(26).keys()].map((n) => String.fromCharCode(n + 97)).concat([...Array(10).keys()].map((n) => `${n}`));

@@ -80,4 +80,4 @@ return () => {

})();
function O(t = "p", n = "") {
const r = Q(), e = Q(), o = Z(t), s = Z(n), a = (l) => `${t}${r}${l}${e}${n}`, i = new RegExp(
function T(t = "p", n = "") {
const r = Y(), e = Y(), o = ce(t), s = ce(n), l = (p) => `${t}${r}${p}${e}${n}`, d = new RegExp(
`${o}${r}(\\d+)${e}${s}`,

@@ -87,16 +87,19 @@ "g"

return {
createPlaceholder: a,
placeholderRegex: i
createPlaceholder: l,
placeholderRegex: d
};
}
function Z(t) {
function ce(t) {
return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
}
function $(t) {
function S(t) {
return `${t}Identifiers`;
}
function Re(t) {
function en(t) {
return `${t}Plugin`;
}
function V(t) {
return `${t}Parser`;
}
const { line: ee, group: T, indent: te, softline: ne } = I, bt = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
const { line: ae, group: k, indent: de, softline: le } = I, tn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
e = {

@@ -106,40 +109,40 @@ ...e,

};
const { node: a } = r, { createPlaceholder: i, placeholderRegex: l } = O("@p"), c = a.quasis.map(
(p, g, { length: b }) => g === b - 1 ? p.value.cooked : p.value.cooked + i(g)
).join(""), d = c.match(/^\s+/)?.[0] ?? "", m = c.match(/\s+$/)?.[0] ?? "", E = c.slice(
d.length,
-m.length || void 0
), y = D(r, n), f = await t(E, {
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T("@p"), c = l.quasis.map(
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
a.length,
-u.length || void 0
), b = x(r, n), E = await t(y, {
...e,
parser: "scss"
}), u = L(f, l, y);
}), i = L(E, p, b);
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
return T([
return k([
"`",
d,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [T(u)] : te([T(u)]),
m,
a,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [k(i)] : de([k(i)]),
u,
"`"
]);
const h = d.length ? ee : ne, _ = m.length ? ee : ne;
return T([
const h = a.length ? ae : le, v = u.length ? ae : le;
return k([
"`",
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, T(u)] : te([h, T(u)]),
_,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, k(i)] : de([h, k(i)]),
v,
"`"
]);
}, yt = ["css"], vt = $(Me), Et = {
[vt]: {
category: "Global",
}, gt = "embeddedCss", nn = ["css"], rn = S(gt), on = {
[rn]: {
category: "Embed",
type: "string",
array: !0,
default: [{ value: [...yt] }],
default: [{ value: [...nn] }],
description: "Specify embedded CSS language identifiers."
}
}, _t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
}, sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
embeddedLanguage: Me,
embedder: bt,
options: Et
}, Symbol.toStringTag, { value: "Module" })), H = "embeddedEs", { line: re, group: k, indent: oe, softline: se } = I, xt = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
embedder: tn,
language: gt,
options: on
}, Symbol.toStringTag, { value: "Module" })), { line: ue, group: N, indent: ge, softline: pe } = I, cn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
e = {

@@ -149,27 +152,27 @@ ...e,

};
const { node: a } = r, { createPlaceholder: i, placeholderRegex: l } = O(), c = a.quasis.map(
(p, g, { length: b }) => g === b - 1 ? p.value.cooked : p.value.cooked + i(g)
).join(""), d = c.match(/^\s+/)?.[0] ?? "", m = c.match(/\s+$/)?.[0] ?? "", E = c.slice(
d.length,
-m.length || void 0
), y = D(r, n), f = await t(E, {
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T(), c = l.quasis.map(
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
a.length,
-u.length || void 0
), b = x(r, n), E = await t(y, {
...e,
parser: e.embeddedEsParser ?? "babel"
}), u = L(f, l, y);
}), i = L(E, p, b);
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
return k([
return N([
"`",
d,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [k(u)] : oe([k(u)]),
m,
a,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [N(i)] : ge([N(i)]),
u,
"`"
]);
const h = d.length ? re : se, _ = m.length ? re : se;
return k([
const h = a.length ? ue : pe, v = u.length ? ue : pe;
return N([
"`",
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, k(u)] : oe([h, k(u)]),
_,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, N(i)] : ge([h, N(i)]),
v,
"`"
]);
}, It = [
}, te = "embeddedEs", an = [
"js",

@@ -183,88 +186,75 @@ "jsx",

"javascript"
], $t = $(H), St = Re(H), Dt = {
[$t]: {
category: "Global",
], dn = [
"babel",
"babel-flow",
"acorn",
"espree",
"flow",
"meriyah"
], ln = S(te), un = V(te), gn = {
[ln]: {
category: "Embed",
type: "string",
array: !0,
default: [{ value: [...It] }],
default: [{ value: [...an] }],
description: "Specify embedded ES language identifiers."
},
[St]: {
category: "Global",
type: "string",
array: !1,
[un]: {
category: "Embed",
type: "choice",
default: "babel",
description: "Specify the embedded ES language parser."
description: 'Specify the embedded ES language parser. Default is "babel".',
choices: dn.map((t) => ({
value: t,
description: `Use "${t}".`
}))
}
}, Ot = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
}, pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
embeddedLanguage: H,
embedder: xt,
options: Dt
}, Symbol.toStringTag, { value: "Module" })), Ne = "embeddedGlsl", { line: ie, group: w, indent: ae, softline: ce } = I, Lt = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
B("prettier-plugin-glsl", e, o), e = {
embedder: cn,
language: te,
options: gn
}, Symbol.toStringTag, { value: "Module" })), { line: me, group: A, indent: he, softline: fe } = I, mn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
M("prettier-plugin-glsl", e, o), e = {
...e,
...s
};
const { node: a } = r, { createPlaceholder: i, placeholderRegex: l } = O(), c = a.quasis.map(
(p, g, { length: b }) => g === b - 1 ? p.value.cooked : p.value.cooked + i(g)
).join(""), d = c.match(/^\s+/)?.[0] ?? "", m = c.match(/\s+$/)?.[0] ?? "", E = c.slice(
d.length,
-m.length || void 0
), y = D(r, n), f = await t(E, {
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T(), c = l.quasis.map(
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
a.length,
-u.length || void 0
), b = x(r, n), E = await t(y, {
...e,
parser: "glsl-parser"
}), u = L(f, l, y);
}), i = L(E, p, b);
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
return w([
return A([
"`",
d,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [w(u)] : ae([w(u)]),
m,
a,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [A(i)] : he([A(i)]),
u,
"`"
]);
const h = d.length ? ie : ce, _ = m.length ? ie : ce;
return w([
const h = a.length ? me : fe, v = u.length ? me : fe;
return A([
"`",
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, w(u)] : ae([h, w(u)]),
_,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, A(i)] : he([h, A(i)]),
v,
"`"
]);
}, Tt = [
"glsl",
"fp",
"frag",
"frg",
"fs",
"fsh",
"fshader",
"geo",
"geom",
"glslf",
"glslv",
"gs",
"gshader",
"rchit",
"rmiss",
"shader",
"tesc",
"tese",
"vert",
"vrx",
"vsh",
"vshader"
], kt = $(Ne), wt = {
[kt]: {
category: "Global",
}, pt = "embeddedGlsl", hn = ["glsl", "shader"], fn = S(pt), En = {
[fn]: {
category: "Embed",
type: "string",
array: !0,
default: [{ value: [...Tt] }],
default: [{ value: [...hn] }],
description: 'Specify embedded GLSL language identifiers. This requires "prettier-plugin-glsl".'
}
}, Pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
}, bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
embeddedLanguage: Ne,
embedder: Lt,
options: wt
}, Symbol.toStringTag, { value: "Module" })), Fe = "embeddedHtml", { line: de, group: P, indent: le, softline: ue } = I, { mapDoc: jt } = q, Mt = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
embedder: mn,
language: pt,
options: En
}, Symbol.toStringTag, { value: "Module" })), { line: Ee, group: P, indent: be, softline: ye } = I, yn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
e = {

@@ -274,23 +264,65 @@ ...e,

};
const { node: a } = r, { createPlaceholder: i, placeholderRegex: l } = O(), c = a.quasis.map(
(p, g, { length: b }) => g === b - 1 ? p.value.cooked : p.value.cooked + i(g)
).join(""), d = c.match(/^\s+/)?.[0] ?? "", m = c.match(/\s+$/)?.[0] ?? "", E = c.slice(
d.length,
-m.length || void 0
), y = D(r, n), f = await t(E, {
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T(), c = l.quasis.map(
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
a.length,
-u.length || void 0
), b = x(r, n), E = await t(y, {
...e,
parser: "graphql"
}), i = L(E, p, b);
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
return P([
"`",
a,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [P(i)] : be([P(i)]),
u,
"`"
]);
const h = a.length ? Ee : ye, v = u.length ? Ee : ye;
return P([
"`",
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, P(i)] : be([h, P(i)]),
v,
"`"
]);
}, mt = "embeddedGraphql", _n = ["graphql", "gql"], vn = S(mt), $n = {
[vn]: {
category: "Embed",
type: "string",
array: !0,
default: [{ value: [..._n] }],
description: "Specify embedded GraphQL language identifiers."
}
}, Dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
embedder: yn,
language: mt,
options: $n
}, Symbol.toStringTag, { value: "Module" })), { line: _e, group: R, indent: ve, softline: $e } = I, { mapDoc: In } = X, Sn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
e = {
...e,
...s
};
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T(), c = l.quasis.map(
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
a.length,
-u.length || void 0
), b = x(r, n), E = await t(y, {
...e,
parser: "html"
}), u = jt(f, (p) => {
if (typeof p != "string")
return p;
const g = [], b = p.split(l);
for (let x = 0; x < b.length; x++) {
let v = b[x];
if (x % 2 == 0) {
if (!v)
}), i = In(E, (m) => {
if (typeof m != "string")
return m;
const g = [], f = m.split(p);
for (let $ = 0; $ < f.length; $++) {
let _ = f[$];
if ($ % 2 == 0) {
if (!_)
continue;
v = v.replaceAll(/([\\`]|\${)/g, "\\$1"), e.__embeddedInHtml && (v = v.replaceAll(/<\/(?=script\b)/gi, "<\\/")), g.push(v);
_ = _.replaceAll(/([\\`]|\${)/g, "\\$1"), e.__embeddedInHtml && (_ = _.replaceAll(/<\/(?=script\b)/gi, "<\\/")), g.push(_);
} else {
const S = Number(v);
g.push(y[S]);
const D = Number(_);
g.push(b[D]);
}

@@ -302,43 +334,72 @@ }

e.htmlWhitespaceSensitivity === "css" || e.preserveEmbeddedExteriorWhitespaces?.includes(o))
return P([
return R([
"`",
d,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [P(u)] : le([P(u)]),
m,
a,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [R(i)] : ve([R(i)]),
u,
"`"
]);
const h = d.length ? de : ue, _ = m.length ? de : ue;
return P([
const h = a.length ? _e : $e, v = u.length ? _e : $e;
return R([
"`",
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, P(u)] : le([h, P(u)]),
_,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, R(i)] : ve([h, R(i)]),
v,
"`"
]);
}, Rt = [
"html",
"htm",
"shtml",
"xhtml",
"xht",
"mdoc",
"jsp",
"asp",
"aspx",
"jshtm",
"volt",
"rhtml"
], Nt = $(Fe), Ft = {
[Nt]: {
category: "Global",
}, ht = "embeddedHtml", xn = ["html", "xhtml"], Tn = S(ht), Ln = {
[Tn]: {
category: "Embed",
type: "string",
array: !0,
default: [{ value: [...Rt] }],
default: [{ value: [...xn] }],
description: "Specify embedded HTML language identifiers."
}
}, At = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
}, On = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
embeddedLanguage: Fe,
embedder: Mt,
options: Ft
}, Symbol.toStringTag, { value: "Module" })), Ae = "embeddedMarkdown", { line: me, group: j, indent: ge, softline: pe } = I, Ct = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
embedder: Sn,
language: ht,
options: Ln
}, Symbol.toStringTag, { value: "Module" })), { line: De, group: j, indent: Ie, softline: Se } = I, Mn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
M("prettier-plugin-ini", e, o), e = {
...e,
...s
};
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T(), c = l.quasis.map(
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
a.length,
-u.length || void 0
), b = x(r, n), E = await t(y, {
...e,
parser: "ini"
}), i = L(E, p, b);
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
return j([
"`",
a,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [j(i)] : Ie([j(i)]),
u,
"`"
]);
const h = a.length ? De : Se, v = u.length ? De : Se;
return j([
"`",
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, j(i)] : Ie([h, j(i)]),
v,
"`"
]);
}, ft = "embeddedIni", kn = ["ini", "cfg", "pro"], Nn = S(ft), An = {
[Nn]: {
category: "Embed",
type: "string",
array: !0,
default: [{ value: [...kn] }],
description: 'Specify embedded INI language identifiers. This requires "prettier-plugin-ini".'
}
}, Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
embedder: Mn,
language: ft,
options: An
}, Symbol.toStringTag, { value: "Module" })), { line: xe, group: F, indent: Te, softline: Le } = I, Rn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
e = {

@@ -348,55 +409,154 @@ ...e,

};
const { node: a } = r, { createPlaceholder: i, placeholderRegex: l } = O(), c = a.quasis.map(
(p, g, { length: b }) => g === b - 1 ? p.value.cooked : p.value.cooked + i(g)
).join(""), d = c.match(/^\s+/)?.[0] ?? "", m = c.match(/\s+$/)?.[0] ?? "", E = c.slice(
d.length,
-m.length || void 0
), y = D(r, n), f = await t(E, {
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = jn(), c = l.quasis.map(
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
a.length,
-u.length || void 0
), b = x(r, n), E = await t(y, {
...e,
parser: e.embeddedJsonParser ?? "json"
}), i = L(E, p, b);
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
return F([
"`",
a,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [F(i)] : Te([F(i)]),
u,
"`"
]);
const h = a.length ? xe : Le, v = u.length ? xe : Le;
return F([
"`",
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, F(i)] : Te([h, F(i)]),
v,
"`"
]);
};
function jn() {
const t = Y(), n = Y(), r = (o) => `'0${t}${o}${n}'`, e = new RegExp(`["']?0${t}(\\d+)${n}['"]?`, "g");
return {
createPlaceholder: r,
placeholderRegex: e
};
}
const ne = "embeddedJson", Fn = ["json", "jsonl"], wn = ["json", "json-stringify", "json5"], Bn = V(ne), Un = S(ne), Wn = {
[Un]: {
category: "Embed",
type: "string",
array: !0,
default: [{ value: [...Fn] }],
description: "Specify embedded JSON language identifiers."
},
[Bn]: {
category: "Embed",
type: "choice",
default: "json",
description: 'Specify the embedded JSON language parser. Default is "json".',
choices: wn.map((t) => ({
value: t,
description: `Use "${t}".`
}))
}
}, Cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
embedder: Rn,
language: ne,
options: Wn
}, Symbol.toStringTag, { value: "Module" })), { line: Oe, group: w, indent: Me, softline: ke } = I, Gn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
M("prettier-plugin-latex", e, o), e = {
...e,
...s
};
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T(), c = l.quasis.map(
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
a.length,
-u.length || void 0
), b = x(r, n), E = await t(y, {
...e,
parser: "latex-parser"
}), i = L(E, p, b);
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
return w([
"`",
a,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [w(i)] : Me([w(i)]),
u,
"`"
]);
const h = a.length ? Oe : ke, v = u.length ? Oe : ke;
return w([
"`",
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, w(i)] : Me([h, w(i)]),
v,
"`"
]);
}, Et = "embeddedLatex", qn = [
"latex",
"tex",
"aux",
"cls",
"bbl",
"bib",
"toc",
"sty"
], zn = S(Et), Kn = {
[zn]: {
category: "Embed",
type: "string",
array: !0,
default: [{ value: [...qn] }],
description: 'Specify embedded LaTeX language identifiers. This requires "prettier-plugin-latex".'
}
}, Hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
embedder: Gn,
language: Et,
options: Kn
}, Symbol.toStringTag, { value: "Module" })), { line: Ne, group: B, indent: Ae, softline: Pe } = I, Jn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
e = {
...e,
...s
};
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T(), c = l.quasis.map(
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
a.length,
-u.length || void 0
), b = x(r, n), E = await t(y, {
...e,
parser: "markdown",
__inJsTemplate: !0
}), u = L(f, l, y);
}), i = L(E, p, b);
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
return j([
return B([
"`",
d,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [j(u)] : ge([j(u)]),
m,
a,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [B(i)] : Ae([B(i)]),
u,
"`"
]);
const h = d.length ? me : pe, _ = m.length ? me : pe;
return j([
const h = a.length ? Ne : Pe, v = u.length ? Ne : Pe;
return B([
"`",
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, j(u)] : ge([h, j(u)]),
_,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, B(i)] : Ae([h, B(i)]),
v,
"`"
]);
}, Bt = [
"md",
"livemd",
"markdown",
"mdown",
"mdwn",
"mkd",
"mkdn",
"mkdown",
"ronn",
"scd",
"workbook"
], Wt = $(Ae), Ut = {
[Wt]: {
category: "Global",
}, bt = "embeddedMarkdown", Xn = ["md", "markdown"], Yn = S(bt), Qn = {
[Yn]: {
category: "Embed",
type: "string",
array: !0,
default: [{ value: [...Bt] }],
default: [{ value: [...Xn] }],
description: "Specify embedded Markdown language identifiers."
}
}, Kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
}, Vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
embeddedLanguage: Ae,
embedder: Ct,
options: Ut
}, Symbol.toStringTag, { value: "Module" })), X = "embeddedNoop", Gt = $(X), zt = {
[Gt]: {
category: "Global",
embedder: Jn,
language: bt,
options: Qn
}, Symbol.toStringTag, { value: "Module" })), re = "embeddedNoop", Zn = S(re), er = {
[Zn]: {
category: "Embed",
type: "string",

@@ -407,156 +567,203 @@ array: !0,

}
}, qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
}, tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
embeddedLanguage: X,
options: zt
}, Symbol.toStringTag, { value: "Module" })), Ce = "embeddedPhp", { line: fe, group: M, indent: he, softline: be } = I, Ht = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
B("@prettier/plugin-php", e, o), e = {
language: re,
options: er
}, Symbol.toStringTag, { value: "Module" })), { line: Re, group: U, indent: je, softline: Fe } = I, nr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
M("@prettier/plugin-php", e, o), e = {
...e,
...s
};
const { node: a } = r, { createPlaceholder: i, placeholderRegex: l } = O("$p"), c = a.quasis.map(
(p, g, { length: b }) => g === b - 1 ? p.value.cooked : p.value.cooked + i(g)
).join(""), d = c.match(/^\s+/)?.[0] ?? "", m = c.match(/\s+$/)?.[0] ?? "", E = c.slice(
d.length,
-m.length || void 0
), y = D(r, n), f = await t(E, {
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T("$p"), c = l.quasis.map(
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
a.length,
-u.length || void 0
), b = x(r, n), E = await t(y, {
...e,
parser: "php"
}), u = L(f, l, y);
}), i = L(E, p, b);
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
return M([
return U([
"`",
d,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [M(u)] : he([M(u)]),
m,
a,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [U(i)] : je([U(i)]),
u,
"`"
]);
const h = d.length ? fe : be, _ = m.length ? fe : be;
return M([
const h = a.length ? Re : Fe, v = u.length ? Re : Fe;
return U([
"`",
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, M(u)] : he([h, M(u)]),
_,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, U(i)] : je([h, U(i)]),
v,
"`"
]);
}, Xt = ["php", "php5", "phtml", "ctp"], Jt = $(Ce), Yt = {
[Jt]: {
category: "Global",
}, yt = "embeddedPhp", rr = ["php", "php5"], or = S(yt), sr = {
[or]: {
category: "Embed",
type: "string",
array: !0,
default: [{ value: [...Xt] }],
default: [{ value: [...rr] }],
description: 'Specify embedded PHP language identifiers. This requires "@prettier/plugin-php".'
}
}, Vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
}, ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
embeddedLanguage: Ce,
embedder: Ht,
options: Yt
}, Symbol.toStringTag, { value: "Module" })), Be = "embeddedRuby", U = [
"ruby",
"arb",
"axlsx",
"builder",
"eye",
"fcgi",
"gemfile",
"gemspec",
"god",
"jb",
"jbuilder",
"mspec",
"opal",
"pluginspec",
"podspec",
"rabl",
"rake",
"rb",
"rbi",
"rbuild",
"rbw",
"rbx",
"ru",
"thor",
"watchr"
], K = ["rbs"], G = ["haml"], Qt = [
...U,
...K,
...G
], Zt = "embeddedRubyParser", en = $(Be), tn = {
[en]: {
category: "Global",
embedder: nr,
language: yt,
options: sr
}, Symbol.toStringTag, { value: "Module" })), { line: we, group: W, indent: Be, softline: Ue } = I, cr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
M("prettier-plugin-properties", e, o), e = {
...e,
...s
};
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T(), c = l.quasis.map(
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
a.length,
-u.length || void 0
), b = x(r, n), E = await t(y, {
...e,
parser: "dot-properties"
}), i = L(E, p, b);
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
return W([
"`",
a,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [W(i)] : Be([W(i)]),
u,
"`"
]);
const h = a.length ? we : Ue, v = u.length ? we : Ue;
return W([
"`",
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, W(i)] : Be([h, W(i)]),
v,
"`"
]);
}, _t = "embeddedProperties", ar = ["properties"], dr = S(_t), lr = {
[dr]: {
category: "Embed",
type: "string",
array: !0,
default: [{ value: [...Qt] }],
default: [{ value: [...ar] }],
description: 'Specify embedded Java Properties language identifiers. This requires "prettier-plugin-properties".'
}
}, ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
embedder: cr,
language: _t,
options: lr
}, Symbol.toStringTag, { value: "Module" })), { line: We, group: C, indent: Ce, softline: Ge } = I, gr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
M("@prettier/plugin-ruby", e, o), e = {
...e,
...s
};
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T(), c = l.quasis.map(
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
a.length,
-u.length || void 0
), b = x(r, n), E = await t(y, {
...e,
parser: e.embeddedRubyParser ?? "ruby"
}), i = L(E, p, b);
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
return C([
"`",
a,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [C(i)] : Ce([C(i)]),
u,
"`"
]);
const h = a.length ? We : Ge, v = u.length ? We : Ge;
return C([
"`",
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, C(i)] : Ce([h, C(i)]),
v,
"`"
]);
}, vt = "embeddedRuby", pr = ["ruby"], mr = ["ruby", "rbs", "haml"], hr = "embeddedRubyParser", fr = S(vt), Er = {
[fr]: {
category: "Embed",
type: "string",
array: !0,
default: [{ value: [...pr] }],
description: 'Specify embedded Ruby language identifiers. This requires "@prettier/plugin-ruby".'
},
[Zt]: {
category: "Global",
type: "string",
array: !1,
default: void 0,
description: "Specify the embedded Ruby language parser."
[hr]: {
category: "Embed",
type: "choice",
default: "ruby",
description: 'Specify the embedded Ruby language parser. Default is "ruby".',
choices: mr.map((t) => ({
value: t,
description: `Use "${t}".`
}))
}
}, { line: ye, group: R, indent: ve, softline: Ee } = I, nn = async (t, n, r, e, { identifier: o, identifiers: s, embeddedOverrideOptions: a }) => {
B("@prettier/plugin-ruby", e, o), e = {
}, br = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
embedder: gr,
language: vt,
options: Er
}, Symbol.toStringTag, { value: "Module" })), { hardline: yr, group: G, line: qe, softline: ze, indent: Ke } = I, { mapDoc: _r } = X, vr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
e = {
...e,
...a
...s
};
const { node: i } = r, { createPlaceholder: l, placeholderRegex: c } = O(), d = i.quasis.map(
(b, x, { length: v }) => x === v - 1 ? b.value.cooked : b.value.cooked + l(x)
).join(""), m = d.match(/^\s+/)?.[0] ?? "", E = d.match(/\s+$/)?.[0] ?? "", y = d.slice(
m.length,
-E.length || void 0
), f = D(r, n), u = rn(e, o, s), h = await t(y, {
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T(), c = l.quasis.map(
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
a.length,
-u.length || void 0
), b = x(r, n), E = await t(y, {
...e,
parser: u
}), _ = L(h, c, f);
parser: "sh"
}), i = _r(E, (m) => {
if (typeof m != "string")
return m;
const g = [], f = m.split(p);
for (let $ = 0; $ < f.length; $++) {
let _ = f[$];
if ($ % 2 == 0) {
if (!_)
continue;
_ = _.replaceAll(/([\\`]|\${)/g, "\\$1"), _.split(/(\n)/).forEach((D) => D === `
` ? g.push(yr) : g.push(D));
} else {
const D = Number(_);
g.push(b[D]);
}
}
return g;
});
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
return R([
return G([
"`",
m,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [R(_)] : ve([R(_)]),
E,
a,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [G(i)] : Ke([G(i)]),
u,
"`"
]);
const p = m.length ? ye : Ee, g = E.length ? ye : Ee;
return R([
const h = a.length ? qe : ze, v = u.length ? qe : ze;
return G([
"`",
e.noEmbeddedMultiLineIndentation?.includes(o) ? [p, R(_)] : ve([p, R(_)]),
g,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, G(i)] : Ke([h, G(i)]),
v,
"`"
]);
};
function rn(t, n, r) {
if (typeof t.embeddedRubyParser == "string")
return t.embeddedRubyParser;
const e = r.indexOf(n);
for (let o = e; o >= 0; --o) {
if (on(n))
return U[0];
if (sn(n))
return K[0];
if (an(n))
return G[0];
}, $t = "embeddedSh", $r = ["sh"], Dr = S($t), Ir = {
[Dr]: {
category: "Embed",
type: "string",
array: !0,
default: [{ value: [...$r] }],
description: "Specify embedded Shell language identifiers."
}
throw new SyntaxError(`Unrecognized ruby identifier: ${n}`);
}
function on(t) {
return U.includes(t);
}
function sn(t) {
return K.includes(t);
}
function an(t) {
return G.includes(t);
}
const cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
}, Sr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
HAML_PARSER_IDENTIFIERS: G,
RBS_PARSER_IDENTIFIERS: K,
RUBY_PARSER_IDENTIFIERS: U,
embeddedLanguage: Be,
embedder: nn,
options: tn
}, Symbol.toStringTag, { value: "Module" })), We = "embeddedSql";
function _e(t, n) {
embedder: vr,
language: $t,
options: Ir
}, Symbol.toStringTag, { value: "Module" }));
function He(t, n) {
var r = Object.keys(t);

@@ -571,8 +778,8 @@ if (Object.getOwnPropertySymbols) {

}
function xe(t) {
function Je(t) {
for (var n = 1; n < arguments.length; n++) {
var r = arguments[n] != null ? arguments[n] : {};
n % 2 ? _e(Object(r), !0).forEach(function(e) {
dn(t, e, r[e]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : _e(Object(r)).forEach(function(e) {
n % 2 ? He(Object(r), !0).forEach(function(e) {
xr(t, e, r[e]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : He(Object(r)).forEach(function(e) {
Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e));

@@ -583,10 +790,10 @@ });

}
function dn(t, n, r) {
return n = ln(n), n in t ? Object.defineProperty(t, n, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[n] = r, t;
function xr(t, n, r) {
return n = Tr(n), n in t ? Object.defineProperty(t, n, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[n] = r, t;
}
function ln(t) {
var n = un(t, "string");
function Tr(t) {
var n = Lr(t, "string");
return typeof n == "symbol" ? n : String(n);
}
function un(t, n) {
function Lr(t, n) {
if (typeof t != "object" || t === null)

@@ -603,5 +810,5 @@ return t;

}
const mn = Ue({});
function Ue(t) {
return n.withOptions = (r) => Ue(xe(xe({}, t), r)), n;
const Or = Dt({});
function Dt(t) {
return n.withOptions = (r) => Dt(Je(Je({}, t), r)), n;
function n(r, ...e) {

@@ -611,53 +818,159 @@ const o = typeof r == "string" ? [r] : r.raw, {

} = t;
let a = "";
let l = "";
for (let c = 0; c < o.length; c++) {
let d = o[c];
s && (d = d.replace(/\\\n[ \t]*/g, "").replace(/\\`/g, "`").replace(/\\\$/g, "$").replace(/\\{/g, "{")), a += d, c < e.length && (a += e[c]);
let a = o[c];
s && (a = a.replace(/\\\n[ \t]*/g, "").replace(/\\`/g, "`").replace(/\\\$/g, "$").replace(/\\{/g, "{")), l += a, c < e.length && (l += e[c]);
}
const i = a.split(`
const d = l.split(`
`);
let l = null;
for (const c of i) {
const d = c.match(/^(\s+)\S+/);
if (d) {
const m = d[1].length;
l ? l = Math.min(l, m) : l = m;
let p = null;
for (const c of d) {
const a = c.match(/^(\s+)\S+/);
if (a) {
const u = a[1].length;
p ? p = Math.min(p, u) : p = u;
}
}
if (l !== null) {
const c = l;
a = i.map((d) => d[0] === " " || d[0] === " " ? d.slice(c) : d).join(`
if (p !== null) {
const c = p;
l = d.map((a) => a[0] === " " || a[0] === " " ? a.slice(c) : a).join(`
`);
}
return a.trim().replace(/\\n/g, `
return l.trim().replace(/\\n/g, `
`);
}
}
const { hardline: gn, group: N, line: Ie, softline: $e, indent: Se } = I, { mapDoc: pn } = q, fn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
B("prettier-plugin-sql", e, o), e = {
const { hardline: Mr, group: q, line: Xe, softline: Ye, indent: Qe } = I, { mapDoc: kr } = X, Nr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
e = {
...e,
...s
};
const { node: a } = r, { createPlaceholder: i, placeholderRegex: l } = O(), c = a.quasis.map(
(p, g, { length: b }) => g === b - 1 ? p.value.cooked : p.value.cooked + i(g)
).join(""), d = c.match(/^\s+/)?.[0] ?? "", m = c.match(/\s+$/)?.[0] ?? "", E = c.slice(
d.length,
-m.length || void 0
), y = D(r, n), f = await t(mn(E), {
const l = e.embeddedSqlPlugin ?? "prettier-plugin-sql";
M(l, e, o);
const { node: d } = r, { createPlaceholder: p, placeholderRegex: c } = T(), a = d.quasis.map(
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + p(g)
).join(""), u = a.match(/^\s+/)?.[0] ?? "", y = a.match(/\s+$/)?.[0] ?? "", b = a.slice(
u.length,
-y.length || void 0
), E = x(r, n);
let i;
if (l === "prettier-plugin-sql-cst") {
const m = await t(b, {
...e,
parser: e.embeddedSqlParser ?? "sqlite"
});
i = L(m, c, E);
} else {
const m = await t(Or(b), {
...e,
parser: "sql"
});
i = kr(m, (g) => {
if (typeof g != "string")
return g;
const f = [], $ = g.split(c);
for (let _ = 0; _ < $.length; _++) {
let D = $[_];
if (_ % 2 == 0) {
if (!D)
continue;
D = D.replaceAll(/([\\`]|\${)/g, "\\$1"), D.split(/(\n)/).forEach(
(O) => O === `
` ? f.push(Mr) : f.push(O)
);
} else {
const O = Number(D);
f.push(E[O]);
}
}
return f;
});
}
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
return q([
"`",
u,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [q(i)] : Qe([q(i)]),
y,
"`"
]);
const h = u.length ? Xe : Ye, v = y.length ? Xe : Ye;
return q([
"`",
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, q(i)] : Qe([h, q(i)]),
v,
"`"
]);
}, Z = "embeddedSql", Ar = ["sql"], Pr = S(Z), Rr = en(Z), jr = V(Z), Fr = {
[Pr]: {
category: "Embed",
type: "string",
array: !0,
default: [{ value: [...Ar] }],
description: 'Specify embedded SQL language identifiers. This requires "prettier-plugin-sql" or "prettier-plugin-sql-cst".'
},
[Rr]: {
category: "Embed",
type: "choice",
default: "prettier-plugin-sql",
description: 'Specify the Prettier plugin for parsing and formatting SQL. Default is "prettier-plugin-sql"',
choices: [
{
value: "prettier-plugin-sql",
description: 'Use "prettier-plugin-sql".'
},
{
value: "prettier-plugin-sql-cst",
description: 'Use "prettier-plugin-sql-cst".'
}
]
},
[jr]: {
category: "Embed",
type: "choice",
default: "sqlite",
description: 'Specify the embedded SQL language parser. Default is "sqlite". This option is only for "prettier-plugin-sql-cst".',
choices: [
{
value: "sqlite",
description: "SQLite parser."
},
{
value: "bigquery",
description: "BigQuery parser."
}
]
}
}, wr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
embedder: Nr,
language: Z,
options: Fr
}, Symbol.toStringTag, { value: "Module" })), { line: Ve, group: z, indent: Ze, softline: et, hardline: Br } = I, { mapDoc: Ur } = X, Wr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
M("prettier-plugin-toml", e, o), e = {
...e,
parser: "sql"
}), u = pn(f, (p) => {
if (typeof p != "string")
return p;
const g = [], b = p.split(l);
for (let x = 0; x < b.length; x++) {
let v = b[x];
if (x % 2 == 0) {
if (!v)
...s
};
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T(), c = l.quasis.map(
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
a.length,
-u.length || void 0
), b = x(r, n), E = await t(y, {
...e,
parser: "toml"
}), i = Ur(E, (m) => {
if (typeof m != "string")
return m;
const g = [], f = m.split(p);
for (let $ = 0; $ < f.length; $++) {
let _ = f[$];
if ($ % 2 == 0) {
if (!_)
continue;
v = v.replaceAll(/([\\`]|\${)/g, "\\$1"), v.split(/(\n)/).forEach((S) => S === `
` ? g.push(gn) : g.push(S));
_ = _.replaceAll(/([\\`]|\${)/g, "\\$1"), _.split(/(\n)/).forEach((D) => D === `
` ? g.push(Br) : g.push(D));
} else {
const S = Number(v);
g.push(y[S]);
const D = Number(_);
g.push(b[D]);
}

@@ -668,30 +981,30 @@ }

if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
return N([
return z([
"`",
d,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [N(u)] : Se([N(u)]),
m,
a,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [z(i)] : Ze([z(i)]),
u,
"`"
]);
const h = d.length ? Ie : $e, _ = m.length ? Ie : $e;
return N([
const h = a.length ? Ve : et, v = u.length ? Ve : et;
return z([
"`",
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, N(u)] : Se([h, N(u)]),
_,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, z(i)] : Ze([h, z(i)]),
v,
"`"
]);
}, hn = ["sql"], bn = $(We), yn = {
[bn]: {
category: "Global",
}, It = "embeddedToml", Cr = ["toml"], Gr = S(It), qr = {
[Gr]: {
category: "Embed",
type: "string",
array: !0,
default: [{ value: [...hn] }],
description: 'Specify embedded SQL language identifiers. This requires "prettier-plugin-sql".'
default: [{ value: [...Cr] }],
description: 'Specify embedded TOML language identifiers. This requires "prettier-plugin-toml".'
}
}, vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
}, zr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
embeddedLanguage: We,
embedder: fn,
options: yn
}, Symbol.toStringTag, { value: "Module" })), J = "embeddedTs", { line: De, group: F, indent: Oe, softline: Le } = I, En = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
embedder: Wr,
language: It,
options: qr
}, Symbol.toStringTag, { value: "Module" })), { line: tt, group: K, indent: nt, softline: rt } = I, Kr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
e = {

@@ -701,8 +1014,8 @@ ...e,

};
const { node: a } = r, { createPlaceholder: i, placeholderRegex: l } = O(), c = a.quasis.map(
(p, g, { length: b }) => g === b - 1 ? p.value.cooked : p.value.cooked + i(g)
).join(""), d = c.match(/^\s+/)?.[0] ?? "", m = c.match(/\s+$/)?.[0] ?? "", E = c.slice(
d.length,
-m.length || void 0
), y = D(r, n), f = await t(E, {
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T(), c = l.quasis.map(
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
a.length,
-u.length || void 0
), b = x(r, n), E = await t(y, {
...e,

@@ -713,149 +1026,97 @@ parser: e.embeddedTsParser ?? "typescript",

filepath: void 0
}), u = L(f, l, y);
}), i = L(E, p, b);
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
return F([
return K([
"`",
d,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [F(u)] : Oe([F(u)]),
m,
a,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [K(i)] : nt([K(i)]),
u,
"`"
]);
const h = d.length ? De : Le, _ = m.length ? De : Le;
return F([
const h = a.length ? tt : rt, v = u.length ? tt : rt;
return K([
"`",
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, F(u)] : Oe([h, F(u)]),
_,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, K(i)] : nt([h, K(i)]),
v,
"`"
]);
}, _n = ["ts", "tsx", "cts", "mts", "typescript"], xn = Re(J), In = $(J), $n = {
[In]: {
category: "Global",
}, oe = "embeddedTs", Hr = ["ts", "tsx", "cts", "mts", "typescript"], Jr = ["typescript", "babel-ts"], Xr = V(oe), Yr = S(oe), Qr = {
[Yr]: {
category: "Embed",
type: "string",
array: !0,
default: [{ value: [..._n] }],
default: [{ value: [...Hr] }],
description: "Specify embedded TS language parsers."
},
[xn]: {
category: "Global",
type: "string",
array: !1,
[Xr]: {
category: "Embed",
type: "choice",
default: "typescript",
description: "Specify the embedded TS language parser."
description: 'Specify the embedded TS language parser. Default is "typescript".',
choices: Jr.map((t) => ({
value: t,
description: `Use "${t}".`
}))
}
}, Sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
}, Vr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
embeddedLanguage: J,
embedder: En,
options: $n
}, Symbol.toStringTag, { value: "Module" })), Y = "embeddedXml", { line: Te, group: A, indent: ke, softline: z } = I, Dn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
B("@prettier/plugin-xml", e, o), e = {
embedder: Kr,
language: oe,
options: Qr
}, Symbol.toStringTag, { value: "Module" })), se = "embeddedXml", { line: ot, group: H, indent: st, softline: ee } = I, Zr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
M("@prettier/plugin-xml", e, o), e = {
...e,
...s
};
const { node: a } = r, { createPlaceholder: i, placeholderRegex: l } = O(), c = a.quasis.map(
(g, b, { length: x }) => b === x - 1 ? g.value.cooked : g.value.cooked + i(b)
).join(""), d = c.match(/^\s+/)?.[0] ?? "", m = c.match(/\s+$/)?.[0] ?? "", E = c.slice(
d.length,
-m.length || void 0
), y = D(r, n), f = [];
let u = 0;
for (; u !== void 0; ) {
const g = E.slice(u);
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T(), c = l.quasis.map(
(g, f, { length: $ }) => f === $ - 1 ? g.value.cooked : g.value.cooked + d(f)
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
a.length,
-u.length || void 0
), b = x(r, n), E = [];
let i = 0;
for (; i !== void 0; ) {
const g = y.slice(i);
if (g.length === 0)
break;
u > 0 && e.xmlWhitespaceSensitivity !== "strict" && f.push(z), e.__embeddedXmlFragmentRecoverIndex?.splice(
i > 0 && e.xmlWhitespaceSensitivity !== "strict" && E.push(ee), e.__embeddedXmlFragmentRecoverIndex?.splice(
0,
e.__embeddedXmlFragmentRecoverIndex.length
);
let b = await t(g, {
let f = await t(g, {
...e,
parser: Y
parser: se
});
const [x, v] = e.__embeddedXmlFragmentRecoverIndex ?? [];
x === void 0 ? u = void 0 : v === void 0 ? u += x : (b = g.slice(x, v + 1), u += v + 1), f.push(b);
const [$, _] = e.__embeddedXmlFragmentRecoverIndex ?? [];
$ === void 0 ? i = void 0 : _ === void 0 ? i += $ : (f = g.slice($, _ + 1), i += _ + 1), E.push(f);
}
const h = L(f, l, y);
const h = L(E, p, b);
if (e.xmlWhitespaceSensitivity === "strict" || e.preserveEmbeddedExteriorWhitespaces?.includes(o))
return A([
return H([
"`",
d,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [A(h)] : ke([A(h)]),
m,
a,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [H(h)] : st([H(h)]),
u,
"`"
]);
const _ = d.length ? Te : z, p = m.length ? Te : z;
return A([
const v = a.length ? ot : ee, m = u.length ? ot : ee;
return H([
"`",
e.noEmbeddedMultiLineIndentation?.includes(o) ? [_, A(h)] : ke([_, A(h)]),
p,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [v, H(h)] : st([v, H(h)]),
m,
"`"
]);
}, On = [
"xml",
"xsd",
"ascx",
"atom",
"axml",
"axaml",
"bpmn",
"cpt",
"csl",
"csproj",
"dita",
"ditamap",
"dtd",
"ent",
"mod",
"dtml",
"fsproj",
"fxml",
"iml",
"isml",
"jmx",
"launch",
"menu",
"nuspec",
"opml",
"owl",
"proj",
"props",
"pt",
"publishsettings",
"pubxml",
"rbxlx",
"rbxmx",
"rdf",
"rng",
"rss",
"shproj",
"storyboard",
"svg",
"targets",
"tld",
"tmx",
"vbproj",
"vcxproj",
"wsdl",
"wxi",
"wxl",
"wxs",
"xaml",
"xbl",
"xib",
"xlf",
"xliff",
"xpdl",
"xul",
"xoml"
], Ln = $(Y), Tn = {
[Ln]: {
category: "Global",
}, eo = ["xml", "opml", "rss", "svg"], to = S(se), no = {
[to]: {
category: "Embed",
type: "string",
array: !0,
default: [{ value: [...On] }],
default: [{ value: [...eo] }],
description: 'Specify embedded XML language identifiers. This requires "@prettier/plugin-xml".'
},
/** @internal */
/**
* @internal
*/
__embeddedXmlFragmentRecoverIndex: {
category: "Global",
category: "Embed",
type: "int",

@@ -867,3 +1128,3 @@ array: !0,

};
function kn(t) {
function ro(t) {
const n = {

@@ -888,3 +1149,3 @@ loc: {

}
function we(t) {
function it(t) {
const n = {

@@ -909,27 +1170,27 @@ loc: {

}
const wn = {
const oo = {
async parse(t, n) {
const { parse: r } = await import("@xml-tools/parser"), { lexErrors: e, parseErrors: o, cst: s } = r(t);
if (e.length > 0) {
const a = e[0];
throw kn(a);
const l = e[0];
throw ro(l);
}
if (o.length > 0) {
let a = !1;
for (const i of o) {
let l = !1;
for (const d of o) {
if (!["MismatchedTokenException", "NotAllInputParsedException"].includes(
i.name
d.name
))
throw we(i);
if (i.message === "Expecting token of type --> OPEN <-- but found --> '' <--") {
a = !0;
throw it(d);
if (d.message === "Expecting token of type --> OPEN <-- but found --> '' <--") {
l = !0;
continue;
}
if (/Expecting token of type --> EOF <-- but found --> '[\s\S]+' <--/.test(
i.message
) || /Redundant input, expecting EOF but found: /.test(i.message)) {
d.message
) || /Redundant input, expecting EOF but found: /.test(d.message)) {
n.__embeddedXmlFragmentRecoverIndex?.splice(
0,
n.__embeddedXmlFragmentRecoverIndex.length,
i.token.startOffset
d.token.startOffset
);

@@ -939,5 +1200,5 @@ break;

if (/Expecting token of type --> OPEN <-- but found --> '[\s\S]+' <--/.test(
i.message
d.message
)) {
if (i.token.endOffset === void 0 || Number.isNaN(i.token.endOffset))
if (d.token.endOffset === void 0 || Number.isNaN(d.token.endOffset))
break;

@@ -947,10 +1208,10 @@ n.__embeddedXmlFragmentRecoverIndex?.splice(

n.__embeddedXmlFragmentRecoverIndex.length,
i.token.startOffset,
i.token.endOffset
), a = !0;
d.token.startOffset,
d.token.endOffset
), l = !0;
break;
}
throw we(i);
throw it(d);
}
a && Ke(s);
l && St(s);
}

@@ -967,3 +1228,3 @@ return s;

};
function Ke(t) {
function St(t) {
const n = t.children;

@@ -974,3 +1235,3 @@ for (const r in n) {

const s = e[o];
if (Pn(s)) {
if (so(s)) {
if (Object.keys(s.children).length === 0) {

@@ -980,3 +1241,3 @@ e.splice(o, 1), e.length === 0 && delete n[r];

}
Ke(s);
St(s);
}

@@ -986,33 +1247,81 @@ }

}
function Pn(t) {
function so(t) {
return "name" in t && "children" in t && "location" in t;
}
const jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
const io = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
embeddedLanguage: Y,
embedder: Dn,
options: Tn,
parser: wn
}, Symbol.toStringTag, { value: "Module" })), Ge = [], ze = {}, qe = {}, He = {}, Mn = /* @__PURE__ */ Object.assign({
"./css/index.ts": _t,
"./es/index.ts": Ot,
"./glsl/index.ts": Pt,
"./html/index.ts": At,
"./markdown/index.ts": Kt,
"./noop/index.ts": qt,
"./php/index.ts": Vt,
"./ruby/index.ts": cn,
"./sql/index.ts": vn,
"./ts/index.ts": Sn,
"./xml/index.ts": jn
embedder: Zr,
language: se,
options: no,
parser: oo
}, Symbol.toStringTag, { value: "Module" })), { line: ct, group: J, indent: at, softline: dt } = I, co = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
e = {
...e,
...s
};
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T(), c = l.quasis.map(
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
a.length,
-u.length || void 0
), b = x(r, n), E = await t(y, {
...e,
parser: "yaml"
}), i = L(E, p, b);
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
return J([
"`",
a,
e.noEmbeddedMultiLineIndentation?.includes(o) ? [J(i)] : at([J(i)]),
u,
"`"
]);
const h = a.length ? ct : dt, v = u.length ? ct : dt;
return J([
"`",
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, J(i)] : at([h, J(i)]),
v,
"`"
]);
}, xt = "embeddedYaml", ao = ["yaml", "yml"], lo = S(xt), uo = {
[lo]: {
category: "Embed",
type: "string",
array: !0,
default: [{ value: [...ao] }],
description: "Specify embedded YAML language identifiers."
}
}, go = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
embedder: co,
language: xt,
options: uo
}, Symbol.toStringTag, { value: "Module" })), Tt = [], Lt = {}, Ot = {}, Mt = {}, po = /* @__PURE__ */ Object.assign({
"./css/index.ts": sn,
"./es/index.ts": pn,
"./glsl/index.ts": bn,
"./graphql/index.ts": Dn,
"./html/index.ts": On,
"./ini/index.ts": Pn,
"./json/index.ts": Cn,
"./latex/index.ts": Hn,
"./markdown/index.ts": Vn,
"./noop/index.ts": tr,
"./php/index.ts": ir,
"./properties/index.ts": ur,
"./ruby/index.ts": br,
"./sh/index.ts": Sr,
"./sql/index.ts": wr,
"./toml/index.ts": zr,
"./ts/index.ts": Vr,
"./xml/index.ts": io,
"./yaml/index.ts": go
});
Object.values(Mn).forEach(
({ embeddedLanguage: t, parser: n, embedder: r, options: e }) => {
ht(Ge, t, X), n && (ze[t] = n), r && (qe[t] = r), Object.assign(He, e);
}
);
const Rn = "noEmbeddedIdentificationByComment", Nn = "noEmbeddedIdentificationByTag", Fn = "preserveEmbeddedExteriorWhitespaces", An = "noEmbeddedMultiLineIndentation", Cn = "embeddedOverrides", mr = {
...He,
[Rn]: {
category: "Global",
Object.values(po).forEach(({ language: t, parser: n, embedder: r, options: e }) => {
Zt(Tt, t, re), n && (Lt[t] = n), r && (Ot[t] = r), Object.assign(Mt, e);
});
const mo = "noEmbeddedIdentificationByComment", ho = "noEmbeddedIdentificationByTag", fo = "preserveEmbeddedExteriorWhitespaces", Eo = "noEmbeddedMultiLineIndentation", bo = "embeddedOverrides", zo = {
...Mt,
[mo]: {
category: "Embed",
type: "string",

@@ -1023,4 +1332,4 @@ array: !0,

},
[Nn]: {
category: "Global",
[ho]: {
category: "Embed",
type: "string",

@@ -1031,3 +1340,3 @@ array: !0,

},
[Fn]: {
[fo]: {
category: "Config",

@@ -1039,4 +1348,4 @@ type: "string",

},
[An]: {
category: "Global",
[Eo]: {
category: "Embed",
type: "string",

@@ -1047,4 +1356,4 @@ array: !0,

},
[Cn]: {
category: "Global",
[bo]: {
category: "Embed",
type: "string",

@@ -1055,13 +1364,13 @@ array: !1,

}
}, gr = {
}, Ko = {
// parsers from internal
...Qe.parsers,
...Ze.parsers,
...et.parsers,
...nt.parsers,
...tt.parsers,
...Rt.parsers,
...jt.parsers,
...Ft.parsers,
...Bt.parsers,
...wt.parsers,
// parsers from this plugin
...ze
...Lt
};
var Bn = {
var yo = {
isEqual: !0,

@@ -1075,20 +1384,20 @@ isMatchingKey: !0,

transformKey: !0
}, Wn = Array.prototype.slice;
function W(t) {
}, _o = Array.prototype.slice;
function Q(t) {
var n = t.length;
return n ? n === 1 ? [t[0]] : n === 2 ? [t[0], t[1]] : n === 3 ? [t[0], t[1], t[2]] : Wn.call(t, 0) : [];
return n ? n === 1 ? [t[0]] : n === 2 ? [t[0], t[1]] : n === 3 ? [t[0], t[1], t[2]] : _o.call(t, 0) : [];
}
function Un(t) {
function vo(t) {
var n = {};
for (var r in t)
Bn[r] || (n[r] = t[r]);
yo[r] || (n[r] = t[r]);
return n;
}
function Kn(t) {
function $o(t) {
return typeof t == "function" && t.isMemoized;
}
function Gn(t, n) {
function Do(t, n) {
return t === n || t !== t && n !== n;
}
function Pe(t, n) {
function lt(t, n) {
var r = {};

@@ -1101,3 +1410,3 @@ for (var e in t)

}
var zn = (
var Io = (
/** @class */

@@ -1127,5 +1436,5 @@ function() {

return {
keys: W(this.keys),
keys: Q(this.keys),
size: this.size,
values: W(this.values)
values: Q(this.values)
};

@@ -1136,4 +1445,4 @@ },

}), t.prototype._getKeyIndexFromMatchingKey = function(n) {
var r = this.options, e = r.isMatchingKey, o = r.maxSize, s = this.keys, a = s.length;
if (!a)
var r = this.options, e = r.isMatchingKey, o = r.maxSize, s = this.keys, l = s.length;
if (!l)
return -1;

@@ -1143,5 +1452,5 @@ if (e(s[0], n))

if (o > 1) {
for (var i = 1; i < a; i++)
if (e(s[i], n))
return i;
for (var d = 1; d < l; d++)
if (e(s[d], n))
return d;
}

@@ -1155,15 +1464,15 @@ return -1;

return this._getKeyIndexForSingle(n);
var s = n.length, a, i;
var s = n.length, l, d;
if (s > 1) {
for (var l = 0; l < o; l++)
if (a = e[l], a.length === s) {
for (i = 0; i < s && r(a[i], n[i]); i++)
for (var p = 0; p < o; p++)
if (l = e[p], l.length === s) {
for (d = 0; d < s && r(l[d], n[d]); d++)
;
if (i === s)
return l;
if (d === s)
return p;
}
} else
for (var l = 0; l < o; l++)
if (a = e[l], a.length === s && r(a[0], n[0]))
return l;
for (var p = 0; p < o; p++)
if (l = e[p], l.length === s && r(l[0], n[0]))
return p;
return -1;

@@ -1179,4 +1488,4 @@ }, t.prototype._getKeyIndexForSingle = function(n) {

if (o > 1) {
for (var a = 0; a < o; a++)
if (!s(e[a], n[a]))
for (var l = 0; l < o; l++)
if (!s(e[l], n[l]))
return -1;

@@ -1187,14 +1496,14 @@ return 0;

}, t.prototype.orderByLru = function(n, r, e) {
for (var o = this.keys, s = this.values, a = o.length, i = e; i--; )
o[i + 1] = o[i], s[i + 1] = s[i];
for (var o = this.keys, s = this.values, l = o.length, d = e; d--; )
o[d + 1] = o[d], s[d + 1] = s[d];
o[0] = n, s[0] = r;
var l = this.options.maxSize;
a === l && e === a ? (o.pop(), s.pop()) : e >= l && (o.length = s.length = l);
var p = this.options.maxSize;
l === p && e === l ? (o.pop(), s.pop()) : e >= p && (o.length = s.length = p);
}, t.prototype.updateAsyncCache = function(n) {
var r = this, e = this.options, o = e.onCacheChange, s = e.onCacheHit, a = this.keys[0], i = this.values[0];
this.values[0] = i.then(function(l) {
return r.shouldUpdateOnHit && s(r, r.options, n), r.shouldUpdateOnChange && o(r, r.options, n), l;
}, function(l) {
var c = r.getKeyIndex(a);
throw c !== -1 && (r.keys.splice(c, 1), r.values.splice(c, 1)), l;
var r = this, e = this.options, o = e.onCacheChange, s = e.onCacheHit, l = this.keys[0], d = this.values[0];
this.values[0] = d.then(function(p) {
return r.shouldUpdateOnHit && s(r, r.options, n), r.shouldUpdateOnChange && o(r, r.options, n), p;
}, function(p) {
var c = r.getKeyIndex(l);
throw c !== -1 && (r.keys.splice(c, 1), r.values.splice(c, 1)), p;
});

@@ -1204,33 +1513,33 @@ }, t;

);
function Xe(t, n) {
if (n === void 0 && (n = {}), Kn(t))
return Xe(t.fn, Pe(t.options, n));
function kt(t, n) {
if (n === void 0 && (n = {}), $o(t))
return kt(t.fn, lt(t.options, n));
if (typeof t != "function")
throw new TypeError("You must pass a function to `memoize`.");
var r = n.isEqual, e = r === void 0 ? Gn : r, o = n.isMatchingKey, s = n.isPromise, a = s === void 0 ? !1 : s, i = n.maxSize, l = i === void 0 ? 1 : i, c = n.onCacheAdd, d = n.onCacheChange, m = n.onCacheHit, E = n.transformKey, y = Pe({
var r = n.isEqual, e = r === void 0 ? Do : r, o = n.isMatchingKey, s = n.isPromise, l = s === void 0 ? !1 : s, d = n.maxSize, p = d === void 0 ? 1 : d, c = n.onCacheAdd, a = n.onCacheChange, u = n.onCacheHit, y = n.transformKey, b = lt({
isEqual: e,
isMatchingKey: o,
isPromise: a,
maxSize: l,
isPromise: l,
maxSize: p,
onCacheAdd: c,
onCacheChange: d,
onCacheHit: m,
transformKey: E
}, Un(n)), f = new zn(y), u = f.keys, h = f.values, _ = f.canTransformKey, p = f.shouldCloneArguments, g = f.shouldUpdateOnAdd, b = f.shouldUpdateOnChange, x = f.shouldUpdateOnHit, v = function() {
var S = p ? W(arguments) : arguments;
_ && (S = E(S));
var C = u.length ? f.getKeyIndex(S) : -1;
if (C !== -1)
x && m(f, y, v), C && (f.orderByLru(u[C], h[C], C), b && d(f, y, v));
onCacheChange: a,
onCacheHit: u,
transformKey: y
}, vo(n)), E = new Io(b), i = E.keys, h = E.values, v = E.canTransformKey, m = E.shouldCloneArguments, g = E.shouldUpdateOnAdd, f = E.shouldUpdateOnChange, $ = E.shouldUpdateOnHit, _ = function() {
var D = m ? Q(arguments) : arguments;
v && (D = y(D));
var O = i.length ? E.getKeyIndex(D) : -1;
if (O !== -1)
$ && u(E, b, _), O && (E.orderByLru(i[O], h[O], O), f && a(E, b, _));
else {
var Ye = t.apply(this, arguments), Ve = p ? S : W(arguments);
f.orderByLru(Ve, Ye, u.length), a && f.updateAsyncCache(v), g && c(f, y, v), b && d(f, y, v);
var At = t.apply(this, arguments), Pt = m ? D : Q(arguments);
E.orderByLru(Pt, At, i.length), l && E.updateAsyncCache(_), g && c(E, b, _), f && a(E, b, _);
}
return h[0];
};
return v.cache = f, v.fn = t, v.isMemoized = !0, v.options = y, v;
return _.cache = E, _.fn = t, _.isMemoized = !0, _.options = b, _;
}
async function je(t) {
async function ut(t) {
try {
const n = await ot(t, { encoding: "utf-8" });
const n = await Wt(t, { encoding: "utf-8" });
return JSON.parse(n);

@@ -1240,8 +1549,8 @@ } catch {

}
const qn = /* @__PURE__ */ new URL(
const So = /* @__PURE__ */ new URL(
"data:text/javascript," + encodeURIComponent('import{pathToFileURL as r}from"node:url";import{parentPort as t,workerData as a}from"node:worker_threads";const s=async({absolutePath:o})=>{try{const e=await import(r(o).href);t?.postMessage(e.embeddedOverrides??e.default??void 0)}catch{t?.postMessage(void 0)}};s(a);')
);
async function Hn(t) {
async function xo(t) {
return new Promise((n) => {
const r = new dt(qn, {
const r = new Kt(So, {
workerData: {

@@ -1258,3 +1567,3 @@ absolutePath: t

}
async function Xn(t) {
async function To(t) {
console.error(

@@ -1264,17 +1573,17 @@ "Ts module type embeddedOverrides has not been implemented yet."

}
const Jn = Xe(
const Lo = kt(
async (t, n) => {
if (st(t))
if (Ct(t))
return t;
const r = await lt(n);
const r = await Ht(n);
let e;
return typeof r != "string" ? e = process.env.PWD ?? process.cwd() : e = it(r), at(e, t);
return typeof r != "string" ? e = process.env.PWD ?? process.cwd() : e = Gt(r), qt(e, t);
}
), Yn = async (t, n) => {
const r = Jn(
), Oo = async (t, n) => {
const r = Lo(
t,
n
), e = ct(t);
), e = zt(t);
if (e === ".json") {
const o = await r, s = await je(o);
const o = await r, s = await ut(o);
if (s !== void 0)

@@ -1285,3 +1594,3 @@ return s;

} else if (e === ".mjs" || e === ".cjs" || e === ".js") {
const o = await r, s = await Hn(o);
const o = await r, s = await xo(o);
if (s !== void 0)

@@ -1292,3 +1601,3 @@ return s;

} else if (e === ".mts" || e === ".cts" || e === ".ts") {
const o = await r, s = await Xn();
const o = await r, s = await To();
if (s !== void 0)

@@ -1299,3 +1608,3 @@ return s;

} else if (e === "") {
const o = await r, s = await je(o);
const o = await r, s = await ut(o);
if (s !== void 0)

@@ -1309,6 +1618,6 @@ return s;

}
}, Vn = async (t, n, r) => {
}, Mo = async (t, n, r) => {
if (t === void 0)
return;
const e = await Yn(
const e = await Oo(
t,

@@ -1326,3 +1635,3 @@ r

};
function Qn({ node: t, parent: n }, r, e) {
function ko({ node: t, parent: n }, r, e) {
if (r.length === 0 || t.type !== "TemplateLiteral")

@@ -1342,8 +1651,8 @@ return;

].includes(s.type) || !s.leading)) {
for (const a of r)
if (` ${a} ` === s.value && !e.includes(a))
return a;
for (const l of r)
if (` ${l} ` === s.value && !e.includes(l))
return l;
}
}
function Zn({ node: t, parent: n }, r, e) {
function No({ node: t, parent: n }, r, e) {
if (r.length !== 0 && !(t.type !== "TemplateLiteral" || n?.type !== "TaggedTemplateExpression" || n.tag.type !== "Identifier")) {

@@ -1355,15 +1664,15 @@ for (const o of r)

}
const { estree: Je } = rt, er = function(t, n) {
const { estree: Nt } = Ut, Ao = function(t, n) {
const { node: r } = t;
if (r.type !== "TemplateLiteral" || r.quasis.some(({ value: { cooked: e } }) => e === null))
return null;
for (const e of Ge) {
const o = n[$(e)];
for (const e of Tt) {
const o = n[S(e)];
if (!o)
continue;
const s = Qn(
const s = ko(
t,
o,
n.noEmbeddedIdentificationByComment ?? []
) ?? Zn(
) ?? No(
t,

@@ -1375,43 +1684,43 @@ o,

continue;
const a = qe[e];
if (!a)
const l = Ot[e];
if (!l)
return null;
const i = t.node;
return i.quasis.length === 1 && i.quasis[0].value.raw.trim() === "" ? "``" : async (l, c, d, m) => {
const E = await Vn(
m.embeddedOverrides,
const d = t.node;
return d.quasis.length === 1 && d.quasis[0].value.raw.trim() === "" ? "``" : async (p, c, a, u) => {
const y = await Mo(
u.embeddedOverrides,
s,
m.filepath
u.filepath
);
try {
const y = await a(l, c, d, m, {
const b = await l(p, c, a, u, {
identifier: s,
identifiers: o,
embeddedOverrideOptions: E
embeddedOverrideOptions: y
});
return I.label(
{ embed: !0, ...y.label },
y
{ embed: !0, ...b.label },
b
);
} catch (y) {
throw console.error(y), y;
} catch (b) {
throw console.error(b), b;
}
};
}
return Je.embed?.(t, n) ?? null;
}, pr = {
return Nt.embed?.(t, n) ?? null;
}, Ho = {
estree: {
...Je,
embed: er
...Nt,
embed: Ao
}
};
export {
qe as embeddedEmbedders,
Ge as embeddedLanguages,
He as embeddedOptions,
ze as embeddedParsers,
$ as makeIdentifiersOptionName,
mr as options,
gr as parsers,
pr as printers
Ot as embeddedEmbedders,
Tt as embeddedLanguages,
Mt as embeddedOptions,
Lt as embeddedParsers,
S as makeIdentifiersOptionName,
zo as options,
Ko as parsers,
Ho as printers
};

@@ -9,174 +9,291 @@ import { type AutocompleteStringList, type EmbeddedDefaultIdentifier, type PrettierPluginEmbedOptions } from "./embedded/index.js";

export declare const options: {
noEmbeddedIdentificationByComment: {
category: "Global";
type: "string";
array: true;
default: {
value: never[];
}[];
description: string;
readonly noEmbeddedIdentificationByComment: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: [];
}];
readonly description: "This option turns off \"/* identifier */ `...`\" comment-based language identification for the specified identifiers.";
};
noEmbeddedIdentificationByTag: {
category: "Global";
type: "string";
array: true;
default: {
value: never[];
}[];
description: string;
readonly noEmbeddedIdentificationByTag: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: [];
}];
readonly description: "This option turns off \"identifier`...`\" tag-based language identification for the specified identifiers.";
};
preserveEmbeddedExteriorWhitespaces: {
category: "Config";
type: "string";
array: true;
default: {
value: never[];
}[];
description: string;
readonly preserveEmbeddedExteriorWhitespaces: {
readonly category: "Config";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: [];
}];
readonly description: "This option preserves leading and trailing whitespaces in the formatting results for the specified identifiers.";
};
noEmbeddedMultiLineIndentation: {
category: "Global";
type: "string";
array: true;
default: {
value: never[];
}[];
description: string;
readonly noEmbeddedMultiLineIndentation: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: [];
}];
readonly description: "This option turns off auto indentation in the formatting results for the specified identifiers when they are formatted to span multi lines.";
};
embeddedOverrides: {
category: "Global";
type: "string";
array: false;
default: undefined;
description: string;
readonly embeddedOverrides: {
readonly category: "Embed";
readonly type: "string";
readonly array: false;
readonly default: undefined;
readonly description: "This option accepts option overrides for the specified identifiers. It should either be a stringified JSON or an absolute filepath to the option overrides file.";
};
embeddedNoopIdentifiers: {
category: "Global";
type: "string";
array: true;
default: {
value: never[];
}[];
description: string;
readonly embeddedNoopIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: [];
}];
readonly description: "Specify embedded language identifiers that will not be formatted.";
};
embeddedCssIdentifiers: {
category: "Global";
type: "string";
array: true;
default: {
value: "css"[];
}[];
description: string;
readonly embeddedCssIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: ["css"];
}];
readonly description: "Specify embedded CSS language identifiers.";
};
embeddedEsIdentifiers: {
category: "Global";
type: "string";
array: true;
default: {
value: ("js" | "jsx" | "es" | "es6" | "mjs" | "cjs" | "pac" | "javascript")[];
}[];
description: string;
readonly embeddedEsIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: ["js", "jsx", "es", "es6", "mjs", "cjs", "pac", "javascript"];
}];
readonly description: "Specify embedded ES language identifiers.";
};
embeddedEsParser: {
category: "Global";
type: "string";
array: false;
default: string;
readonly embeddedEsParser: {
category: string;
type: "choice";
default: "babel";
description: string;
};
embeddedGlslIdentifiers: {
category: "Global";
type: "string";
array: true;
default: {
value: ("glsl" | "fp" | "frag" | "frg" | "fs" | "fsh" | "fshader" | "geo" | "geom" | "glslf" | "glslv" | "gs" | "gshader" | "rchit" | "rmiss" | "shader" | "tesc" | "tese" | "vert" | "vrx" | "vsh" | "vshader")[];
choices: {
value: "babel" | "babel-flow" | "acorn" | "espree" | "flow" | "meriyah";
description: string;
}[];
description: string;
};
embeddedHtmlIdentifiers: {
category: "Global";
type: "string";
array: true;
default: {
value: ("html" | "htm" | "shtml" | "xhtml" | "xht" | "mdoc" | "jsp" | "asp" | "aspx" | "jshtm" | "volt" | "rhtml")[];
}[];
description: string;
readonly embeddedGlslIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: ["glsl", "shader"];
}];
readonly description: "Specify embedded GLSL language identifiers. This requires \"prettier-plugin-glsl\".";
};
embeddedMarkdownIdentifiers: {
category: "Global";
type: "string";
array: true;
default: {
value: ("md" | "livemd" | "markdown" | "mdown" | "mdwn" | "mkd" | "mkdn" | "mkdown" | "ronn" | "scd" | "workbook")[];
}[];
description: string;
readonly embeddedGraphqlIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: ["graphql", "gql"];
}];
readonly description: "Specify embedded GraphQL language identifiers.";
};
embeddedPhpIdentifiers: {
category: "Global";
type: "string";
array: true;
default: {
value: ("php" | "php5" | "phtml" | "ctp")[];
}[];
readonly embeddedHtmlIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: ["html", "xhtml"];
}];
readonly description: "Specify embedded HTML language identifiers.";
};
readonly embeddedIniIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: ["ini", "cfg", "pro"];
}];
readonly description: "Specify embedded INI language identifiers. This requires \"prettier-plugin-ini\".";
};
readonly embeddedJsonIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: ["json", "jsonl"];
}];
readonly description: "Specify embedded JSON language identifiers.";
};
readonly embeddedJsonParser: {
category: string;
type: "choice";
default: "json";
description: string;
};
embeddedRubyIdentifiers: {
category: "Global";
type: "string";
array: true;
default: {
value: ("ruby" | "rbs" | "haml" | "arb" | "axlsx" | "builder" | "eye" | "fcgi" | "gemfile" | "gemspec" | "god" | "jb" | "jbuilder" | "mspec" | "opal" | "pluginspec" | "podspec" | "rabl" | "rake" | "rb" | "rbi" | "rbuild" | "rbw" | "rbx" | "ru" | "thor" | "watchr")[];
choices: {
value: "json" | "json-stringify" | "json5";
description: string;
}[];
description: string;
};
embeddedRubyParser: {
category: "Global";
type: "string";
array: false;
default: undefined;
readonly embeddedLatexIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: ["latex", "tex", "aux", "cls", "bbl", "bib", "toc", "sty"];
}];
readonly description: "Specify embedded LaTeX language identifiers. This requires \"prettier-plugin-latex\".";
};
readonly embeddedMarkdownIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: ["md", "markdown"];
}];
readonly description: "Specify embedded Markdown language identifiers.";
};
readonly embeddedPhpIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: ["php", "php5"];
}];
readonly description: "Specify embedded PHP language identifiers. This requires \"@prettier/plugin-php\".";
};
readonly embeddedPropertiesIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: ["properties"];
}];
readonly description: "Specify embedded Java Properties language identifiers. This requires \"prettier-plugin-properties\".";
};
readonly embeddedRubyIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: ["ruby"];
}];
readonly description: "Specify embedded Ruby language identifiers. This requires \"@prettier/plugin-ruby\".";
};
readonly embeddedRubyParser: {
category: string;
type: "choice";
default: "ruby";
description: string;
};
embeddedSqlIdentifiers: {
category: "Global";
type: "string";
array: true;
default: {
value: "sql"[];
choices: {
value: "ruby" | "rbs" | "haml";
description: string;
}[];
description: string;
};
embeddedTsIdentifiers: {
category: "Global";
type: "string";
array: true;
default: {
value: ("ts" | "tsx" | "cts" | "mts" | "typescript")[];
}[];
readonly embeddedShIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: ["sh"];
}];
readonly description: "Specify embedded Shell language identifiers.";
};
readonly embeddedSqlIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: ["sql"];
}];
readonly description: "Specify embedded SQL language identifiers. This requires \"prettier-plugin-sql\" or \"prettier-plugin-sql-cst\".";
};
readonly embeddedSqlPlugin: {
category: string;
type: "choice";
default: "prettier-plugin-sql";
description: string;
choices: ({
value: "prettier-plugin-sql";
description: string;
} | {
value: "prettier-plugin-sql-cst";
description: string;
})[];
};
embeddedTsParser: {
category: "Global";
type: "string";
array: false;
default: string;
readonly embeddedSqlParser: {
category: string;
type: "choice";
default: "sqlite";
description: string;
choices: ({
value: "sqlite";
description: string;
} | {
value: "bigquery";
description: string;
})[];
};
embeddedXmlIdentifiers: {
category: "Global";
type: "string";
array: true;
default: {
value: ("xml" | "xsd" | "ascx" | "atom" | "axml" | "axaml" | "bpmn" | "cpt" | "csl" | "csproj" | "dita" | "ditamap" | "dtd" | "ent" | "mod" | "dtml" | "fsproj" | "fxml" | "iml" | "isml" | "jmx" | "launch" | "menu" | "nuspec" | "opml" | "owl" | "proj" | "props" | "pt" | "publishsettings" | "pubxml" | "rbxlx" | "rbxmx" | "rdf" | "rng" | "rss" | "shproj" | "storyboard" | "svg" | "targets" | "tld" | "tmx" | "vbproj" | "vcxproj" | "wsdl" | "wxi" | "wxl" | "wxs" | "xaml" | "xbl" | "xib" | "xlf" | "xliff" | "xpdl" | "xul" | "xoml")[];
}[];
readonly embeddedTomlIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: ["toml"];
}];
readonly description: "Specify embedded TOML language identifiers. This requires \"prettier-plugin-toml\".";
};
readonly embeddedTsIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: ["ts", "tsx", "cts", "mts", "typescript"];
}];
readonly description: "Specify embedded TS language parsers.";
};
readonly embeddedTsParser: {
category: string;
type: "choice";
default: "typescript";
description: string;
};
__embeddedXmlFragmentRecoverIndex: {
category: "Global";
type: "int";
array: true;
default: {
value: never[];
choices: {
value: "typescript" | "babel-ts";
description: string;
}[];
description: string;
};
readonly embeddedXmlIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: ["xml", "opml", "rss", "svg"];
}];
readonly description: "Specify embedded XML language identifiers. This requires \"@prettier/plugin-xml\".";
};
readonly __embeddedXmlFragmentRecoverIndex: {
readonly category: "Embed";
readonly type: "int";
readonly array: true;
readonly default: [{
readonly value: [];
}];
readonly description: "This option is read only and used as a workaround to support xml fragments";
};
readonly embeddedYamlIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: ["yaml", "yml"];
}];
readonly description: "Specify embedded YAML language identifiers.";
};
};

@@ -183,0 +300,0 @@ export interface PrettierPluginGlobalOptions {

import { type AstPath } from "prettier";
import type { PrettierNode } from "./types.js";
export declare const resolveEmbeddedOverrideOptions: (embeddedOverridesString: string | undefined, identifier: string, sourceFilePath?: string) => Promise<Omit<Omit<import("prettier").Options, keyof import("./index.js").PrettierPluginEmbedOptions> & Omit<import("./index.js").PrettierPluginEmbedOptions, "embeddedNoopIdentifiers" | "embeddedCssIdentifiers" | "embeddedEsIdentifiers" | "embeddedGlslIdentifiers" | "embeddedHtmlIdentifiers" | "embeddedMarkdownIdentifiers" | "embeddedPhpIdentifiers" | "embeddedRubyIdentifiers" | "embeddedSqlIdentifiers" | "embeddedTsIdentifiers" | "embeddedXmlIdentifiers" | keyof import("./options.js").PrettierPluginGlobalOptions>, "parser" | "filepath" | "endOfLine" | "embeddedLanguageFormatting" | "printWidth" | "tabWidth" | "useTabs" | `__${string}`> | undefined>;
export declare const resolveEmbeddedOverrideOptions: (embeddedOverridesString: string | undefined, identifier: string, sourceFilePath?: string) => Promise<Omit<Omit<import("prettier").Options, keyof import("./index.js").PrettierPluginEmbedOptions> & Omit<import("./index.js").PrettierPluginEmbedOptions, "embeddedNoopIdentifiers" | "embeddedCssIdentifiers" | "embeddedEsIdentifiers" | "embeddedGlslIdentifiers" | "embeddedGraphqlIdentifiers" | "embeddedHtmlIdentifiers" | "embeddedIniIdentifiers" | "embeddedJsonIdentifiers" | "embeddedLatexIdentifiers" | "embeddedMarkdownIdentifiers" | "embeddedPhpIdentifiers" | "embeddedPropertiesIdentifiers" | "embeddedRubyIdentifiers" | "embeddedShIdentifiers" | "embeddedSqlIdentifiers" | "embeddedTomlIdentifiers" | "embeddedTsIdentifiers" | "embeddedXmlIdentifiers" | "embeddedYamlIdentifiers" | keyof import("./options.js").PrettierPluginGlobalOptions>, "parser" | "filepath" | "endOfLine" | "embeddedLanguageFormatting" | "printWidth" | "tabWidth" | "useTabs" | `__${string}`> | undefined>;
export declare function getIdentifierFromComment({ node, parent }: AstPath<PrettierNode>, comments: string[], noIdentificationList: string[]): string | undefined;
export declare function getIdentifierFromTag({ node, parent }: AstPath<PrettierNode>, tags: string[], noIdentificationList: string[]): string | undefined;

@@ -5,3 +5,3 @@ {

"private": false,
"version": "0.3.2",
"version": "0.4.0",
"type": "module",

@@ -65,31 +65,34 @@ "files": [

"devDependencies": {
"@commitlint/cli": "^18.4.3",
"@commitlint/config-conventional": "^18.4.3",
"@prettier/plugin-php": "^0.21.0",
"@commitlint/cli": "^18.4.4",
"@commitlint/config-conventional": "^18.4.4",
"@prettier/plugin-php": "^0.22.1",
"@prettier/plugin-ruby": "^4.0.0",
"@prettier/plugin-xml": "^3.1.0",
"@semantic-release/git": "^10.0.1",
"@types/estree": "^1.0.5",
"@types/node": "^20.10.4",
"@typescript-eslint/eslint-plugin": "^6.13.2",
"@typescript-eslint/parser": "^6.13.2",
"@vitest/browser": "^1.0.4",
"@vitest/coverage-istanbul": "^1.0.4",
"@vitest/ui": "^1.0.4",
"@types/node": "^20.10.7",
"@typescript-eslint/eslint-plugin": "^6.18.0",
"@typescript-eslint/parser": "^6.18.0",
"@vitest/coverage-istanbul": "^1.1.3",
"@vitest/ui": "^1.1.3",
"@xml-tools/parser": "^1.0.11",
"chevrotain": "7.1.1",
"esbuild": "^0.19.9",
"eslint": "^8.55.0",
"esbuild": "^0.19.11",
"eslint": "^8.56.0",
"fast-glob": "^3.3.2",
"npm-check-updates": "^16.14.11",
"playwright": "^1.40.1",
"npm-check-updates": "^16.14.12",
"prettier": "^3.0.0",
"prettier-plugin-glsl": "^0.1.3",
"prettier-plugin-ini": "^1.1.0",
"prettier-plugin-jsdoc": "^1.3.0",
"prettier-plugin-latex": "^2.0.1",
"prettier-plugin-organize-imports": "^3.2.4",
"prettier-plugin-sql": "^0.17.1",
"semantic-release": "^22.0.10",
"tsx": "^4.6.2",
"prettier-plugin-properties": "^0.3.0",
"prettier-plugin-sh": "^0.13.1",
"prettier-plugin-sql": "^0.18.0",
"prettier-plugin-sql-cst": "^0.10.0",
"prettier-plugin-toml": "^2.0.1",
"tsx": "^4.7.0",
"typescript": "^5.3.3",
"vite": "^5.0.7",
"vitest": "^1.0.4"
"vite": "^5.0.11",
"vitest": "^1.1.3"
},

@@ -96,0 +99,0 @@ "dependencies": {

@@ -146,2 +146,10 @@ <div align="center">

#### GraphQL
| Option | Default | Description |
| :--------------------------: | :------------------------------------------: | ----------------------------------------------------------------------------------------------------- |
| `embeddedGraphqlIdentifiers` | [`[...]`](./src/embedded/graphql/options.ts) | Tag or comment identifiers that make their subsequent template literals be identified as GraphQL code |
Formatting embedded GraphQL code doesn't require other plugins and uses the parsers and printers provided by Prettier natively. This can override the native embedded language formatting for GraphQL code. If you want to keep the native behavior, set `embeddedGraphqlIdentifiers` to `[]` or other identifiers.
#### HTML

@@ -155,2 +163,27 @@

#### INI
| Option | Default | Description |
| :----------------------: | :--------------------------------------: | ------------------------------------------------------------------------------------------------- |
| `embeddedIniIdentifiers` | [`[...]`](./src/embedded/ini/options.ts) | Tag or comment identifiers that make their subsequent template literals be identified as INI code |
Formatting embedded INI code requires [`prettier-plugin-ini`](https://github.com/kddnewton/prettier-plugin-ini) to be loaded as well. And [options](https://github.com/kddnewton/prettier-plugin-ini#configuration) supported by `prettier-plugin-ini` can therefore be used to further control the formatting behavior.
#### JSON
| Option | Default | Description |
| :-----------------------: | :----------------------------------------: | -------------------------------------------------------------------------------------------------- |
| `embeddedJsonIdentifiers` | [`[...]`](./src/embedded/json/options.ts) | Tag or comment identifiers that make their subsequent template literals be identified as JSON code |
| `embeddedJsonParser` | [`"json"`](./src/embedded/json/options.ts) | The parser used to parse the JSON code |
Formatting embedded JSON code doesn't require other plugins and uses the parsers and printers provided by Prettier natively.
#### LaTeX
| Option | Default | Description |
| :------------------------: | :----------------------------------------: | --------------------------------------------------------------------------------------------------- |
| `embeddedLatexIdentifiers` | [`[...]`](./src/embedded/latex/options.ts) | Tag or comment identifiers that make their subsequent template literals be identified as LaTeX code |
Formatting embedded LaTeX code requires [`prettier-plugin-latex`](https://github.com/siefkenj/prettier-plugin-latex) to be loaded as well.
#### Markdown

@@ -172,2 +205,10 @@

#### Properties
| Option | Default | Description |
| :-----------------------------: | :---------------------------------------------: | ------------------------------------------------------------------------------------------------------------- |
| `embeddedPropertiesIdentifiers` | [`[...]`](./src/embedded/properties/options.ts) | Tag or comment identifiers that make their subsequent template literals be identified as Java Properties code |
Formatting embedded Java Properties code requires [`prettier-plugin-properties`](https://github.com/eemeli/prettier-plugin-properties) to be loaded as well. And [options](https://github.com/eemeli/prettier-plugin-properties#configuration) supported by `prettier-plugin-properties` can therefore be used to further control the formatting behavior.
#### Ruby

@@ -182,12 +223,32 @@

#### Shell
| Option | Default | Description |
| :---------------------: | :-------------------------------------: | --------------------------------------------------------------------------------------------------- |
| `embeddedShIdentifiers` | [`[...]`](./src/embedded/sh/options.ts) | Tag or comment identifiers that make their subsequent template literals be identified as Shell code |
Formatting embedded Shell code requires [`prettier-plugin-sh`](https://github.com/un-ts/prettier/tree/master/packages/sh#readme) to be loaded as well. And [options](https://github.com/un-ts/prettier/tree/master/packages/sh#parser-options) supported by `prettier-plugin-sh` can therefore be used to further control the formatting behavior.
Note that `prettier-plugin-sh` supports different variants of shell syntaxes and they are specified by the [`variant` option](https://github.com/un-ts/prettier/tree/master/packages/sh#parser-options). To map a subset of identifiers to another dialect, please use [`embeddedOverrides`](#embeddedoverrides).
#### SQL
| Option | Default | Description |
| :----------------------: | :--------------------------------------: | ------------------------------------------------------------------------------------------------- |
| `embeddedSqlIdentifiers` | [`[...]`](./src/embedded/sql/options.ts) | Tag or comment identifiers that make their subsequent template literals be identified as SQL code |
| Option | Default | Description |
| :----------------------: | :------------------------------------------------------: | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `embeddedSqlIdentifiers` | [`[...]`](./src/embedded/sql/options.ts) | Tag or comment identifiers that make their subsequent template literals be identified as SQL code |
| `embeddedSqlPlugin` | [`"prettier-plugin-sql"`](./src/embedded/sql/options.ts) | The plugin used to format the SQL code. Available options are `"prettier-plugin-sql"` and `"prettier-plugin-sql-cst"`. |
| `embeddedSqlParser` | [`"sqlite"`](./src/embedded/sql/options.ts) | The parser used to parse the SQL code. Available options are `"sqlite"` and `"bigquery"`. This option is only for `prettier-plugin-sql-cst` |
Formatting embedded SQL code requires [`prettier-plugin-sql`](https://github.com/un-ts/prettier/tree/master/packages/sql#readme) to be loaded as well. And [options](https://github.com/un-ts/prettier/tree/master/packages/sql#parser-options) supported by `prettier-plugin-sql` can therefore be used to further control the formatting behavior.
Formatting embedded SQL code requires [`prettier-plugin-sql`](https://github.com/un-ts/prettier/tree/master/packages/sql#readme) or [`prettier-plugin-sql-cst`](https://github.com/nene/prettier-plugin-sql-cst) to be loaded as well. And [options](https://github.com/un-ts/prettier/tree/master/packages/sql#parser-options) supported by `prettier-plugin-sql`, or [options](https://github.com/nene/prettier-plugin-sql-cst?tab=readme-ov-file#configuration) supported by `prettier-plugin-sql-cst` can therefore be used to further control the formatting behavior.
Note that `prettier-plugin-sql` supports many different SQL dialects and they are specified by the [`language` or `database` option](https://github.com/un-ts/prettier/tree/master/packages/sql#parser-options). To map a subset of identifiers to another dialect, please use [`embeddedOverrides`](#embeddedoverrides).
Note that `prettier-plugin-sql` supports many different SQL dialects and they are specified by the [`language` or `database` option](https://github.com/un-ts/prettier/tree/master/packages/sql#parser-options). And `prettier-plugin-sql-cst` also supports other parsers. To map a subset of identifiers to another dialect or parser, please use [`embeddedOverrides`](#embeddedoverrides).
#### TOML
| Option | Default | Description |
| :-----------------------: | :---------------------------------------: | -------------------------------------------------------------------------------------------------- |
| `embeddedTomlIdentifiers` | [`[...]`](./src/embedded/toml/options.ts) | Tag or comment identifiers that make their subsequent template literals be identified as TOML code |
Formatting embedded TOML code requires [`prettier-plugin-toml`](https://github.com/un-ts/prettier/tree/master/packages/toml#readme) to be loaded as well. And options supported by `prettier-plugin-toml` can therefore be used to further control the formatting behavior.
#### TS

@@ -210,2 +271,10 @@

#### YAML
| Option | Default | Description |
| :-----------------------: | :---------------------------------------: | -------------------------------------------------------------------------------------------------- |
| `embeddedYamlIdentifiers` | [`[...]`](./src/embedded/yaml/options.ts) | Tag or comment identifiers that make their subsequent template literals be identified as YAML code |
Formatting embedded YAML code doesn't require other plugins and uses the parsers and printers provided by Prettier natively.
</details>

@@ -212,0 +281,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc