prettier-plugin-embed 0.4.8 → 0.4.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +297 -109
- package/dist/embedded/css/options.d.ts +2 -8
- package/dist/embedded/es/options.d.ts +2 -8
- package/dist/embedded/glsl/options.d.ts +2 -8
- package/dist/embedded/graphql/options.d.ts +2 -8
- package/dist/embedded/html/options.d.ts +2 -8
- package/dist/embedded/index.d.ts +1 -1
- package/dist/embedded/ini/options.d.ts +2 -9
- package/dist/embedded/ini/plugin-ini-types.d.ts +3 -0
- package/dist/embedded/ini/plugin-ini.d.ts +6 -0
- package/dist/embedded/java/options.d.ts +2 -13
- package/dist/embedded/java/plugin-java-types.d.ts +7 -0
- package/dist/embedded/java/plugin-java.d.ts +6 -0
- package/dist/embedded/json/options.d.ts +2 -8
- package/dist/embedded/jsonata/options.d.ts +2 -8
- package/dist/embedded/latex/options.d.ts +2 -8
- package/dist/embedded/markdown/embedder.d.ts +1 -1
- package/dist/embedded/markdown/options.d.ts +2 -9
- package/dist/embedded/markdown/plugin-markdown-types.d.ts +3 -0
- package/dist/embedded/markdown/plugin-markdown.d.ts +6 -0
- package/dist/embedded/nginx/options.d.ts +3 -10
- package/dist/embedded/nginx/plugin-nginx-types.d.ts +4 -0
- package/dist/embedded/nginx/plugin-nginx.d.ts +6 -0
- package/dist/embedded/noop/options.d.ts +2 -2
- package/dist/embedded/pegjs/options.d.ts +2 -11
- package/dist/embedded/pegjs/plugin-pegjs-types.d.ts +5 -0
- package/dist/embedded/pegjs/plugin-pegjs.d.ts +6 -0
- package/dist/embedded/php/options.d.ts +2 -11
- package/dist/embedded/php/plugin-php-types.d.ts +5 -0
- package/dist/embedded/php/plugin-php.d.ts +6 -0
- package/dist/embedded/prisma/options.d.ts +2 -8
- package/dist/embedded/properties/options.d.ts +2 -10
- package/dist/embedded/properties/plugin-properties-types.d.ts +4 -0
- package/dist/embedded/properties/plugin-properties.d.ts +6 -0
- package/dist/embedded/pug/options.d.ts +2 -35
- package/dist/embedded/pug/plugin-pug-types.d.ts +29 -0
- package/dist/embedded/pug/plugin-pug.d.ts +6 -0
- package/dist/embedded/register.d.ts +7 -7
- package/dist/embedded/ruby/options.d.ts +3 -16
- package/dist/embedded/ruby/plugin-ruby-types.d.ts +6 -0
- package/dist/embedded/ruby/plugin-ruby.d.ts +6 -0
- package/dist/embedded/sh/options.d.ts +3 -10
- package/dist/embedded/sh/plugin-sh-types.d.ts +4 -0
- package/dist/embedded/sh/plugin-sh.d.ts +6 -0
- package/dist/embedded/sql/options.d.ts +4 -13
- package/dist/embedded/sql/plugin-sql-cst-types.d.ts +4 -0
- package/dist/embedded/sql/plugin-sql-cst.d.ts +6 -0
- package/dist/embedded/sql/plugin-sql-types.d.ts +4 -0
- package/dist/embedded/sql/plugin-sql.d.ts +6 -0
- package/dist/embedded/toml/options.d.ts +3 -10
- package/dist/embedded/toml/plugin-toml-types.d.ts +4 -0
- package/dist/embedded/toml/plugin-toml.d.ts +6 -0
- package/dist/embedded/ts/options.d.ts +2 -8
- package/dist/embedded/types.d.ts +1 -1
- package/dist/embedded/utils.d.ts +5 -2
- package/dist/embedded/xml/options.d.ts +2 -12
- package/dist/embedded/xml/parser.d.ts +1 -0
- package/dist/embedded/xml/plugin-xml-types.d.ts +6 -0
- package/dist/embedded/xml/plugin-xml.d.ts +6 -0
- package/dist/embedded/yaml/options.d.ts +2 -8
- package/dist/index.d.ts +7 -2
- package/dist/index.js +707 -677
- package/dist/options.d.ts +14 -18
- package/dist/plugin-embed.d.ts +6 -0
- package/dist/types.d.ts +5 -24
- package/dist/utils.d.ts +1 -4
- package/package.json +37 -9
|
@@ -1,37 +1,8 @@
|
|
|
1
1
|
import { type AutocompleteStringList, type StringListToInterfaceKey } from "../utils.js";
|
|
2
2
|
declare const DEFAULT_IDENTIFIERS: readonly ["pug", "jade"];
|
|
3
|
-
type Identifiers = AutocompleteStringList<typeof DEFAULT_IDENTIFIERS>;
|
|
3
|
+
type Identifiers = AutocompleteStringList<(typeof DEFAULT_IDENTIFIERS)[number]>;
|
|
4
4
|
type DefaultIdentifiersHolder = StringListToInterfaceKey<typeof DEFAULT_IDENTIFIERS>;
|
|
5
5
|
declare const EMBEDDED_LANGUAGE_IDENTIFIERS: "embeddedPugIdentifiers";
|
|
6
|
-
/**
|
|
7
|
-
* Location: node_modules/@prettier/plugin-pug/src/printer.ts
|
|
8
|
-
*/
|
|
9
|
-
export interface PrettierPluginDepsOptions {
|
|
10
|
-
pugPrintWidth?: number;
|
|
11
|
-
pugSingleQuote?: boolean;
|
|
12
|
-
pugTabWidth?: number;
|
|
13
|
-
pugUseTabs?: boolean;
|
|
14
|
-
pugBracketSpacing?: boolean;
|
|
15
|
-
pugArrowParens?: "avoid" | "always";
|
|
16
|
-
pugSemi?: boolean;
|
|
17
|
-
pugBracketSameLine?: boolean;
|
|
18
|
-
pugAttributeSeparator?: "always" | "as-needed" | "none";
|
|
19
|
-
pugCommentPreserveSpaces?: "keep-all" | "keep-leading" | "trim-all";
|
|
20
|
-
pugSortAttributes?: "asc" | "desc" | "as-is";
|
|
21
|
-
pugSortAttributesBeginning?: string[];
|
|
22
|
-
pugSortAttributesEnd?: string[];
|
|
23
|
-
pugWrapAttributesThreshold?: number;
|
|
24
|
-
pugWrapAttributesPattern?: string;
|
|
25
|
-
pugClassLocation?: "before-attributes" | "after-attributes";
|
|
26
|
-
pugClassNotation?: "literal" | "attribute" | "as-is";
|
|
27
|
-
pugIdNotation?: "literal" | "as-is";
|
|
28
|
-
pugEmptyAttributes?: "as-is" | "none" | "all";
|
|
29
|
-
pugEmptyAttributesForceQuotes?: "as-is" | "none" | "all";
|
|
30
|
-
pugSingleFileComponentIndentation?: boolean;
|
|
31
|
-
pugFramework?: "auto" | "vue" | "svelte" | "angular";
|
|
32
|
-
pugExplicitDiv?: boolean;
|
|
33
|
-
pugPreserveAttributeBrackets?: boolean;
|
|
34
|
-
}
|
|
35
6
|
export declare const options: {
|
|
36
7
|
readonly embeddedPugIdentifiers: {
|
|
37
8
|
readonly category: "Embed";
|
|
@@ -49,12 +20,8 @@ declare module "../types.js" {
|
|
|
49
20
|
}
|
|
50
21
|
interface EmbeddedDefaultIdentifiersHolder extends DefaultIdentifiersHolder {
|
|
51
22
|
}
|
|
52
|
-
interface
|
|
23
|
+
interface PluginEmbedOptions {
|
|
53
24
|
[EMBEDDED_LANGUAGE_IDENTIFIERS]?: Identifiers;
|
|
54
25
|
}
|
|
55
26
|
}
|
|
56
|
-
declare module "prettier" {
|
|
57
|
-
interface Options extends PrettierPluginDepsOptions {
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
27
|
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Location: node_modules/@prettier/plugin-pug/src/printer.ts
|
|
3
|
+
*/
|
|
4
|
+
export interface PluginPugOptions {
|
|
5
|
+
pugPrintWidth?: number;
|
|
6
|
+
pugSingleQuote?: boolean;
|
|
7
|
+
pugTabWidth?: number;
|
|
8
|
+
pugUseTabs?: boolean;
|
|
9
|
+
pugBracketSpacing?: boolean;
|
|
10
|
+
pugArrowParens?: "avoid" | "always";
|
|
11
|
+
pugSemi?: boolean;
|
|
12
|
+
pugBracketSameLine?: boolean;
|
|
13
|
+
pugAttributeSeparator?: "always" | "as-needed" | "none";
|
|
14
|
+
pugCommentPreserveSpaces?: "keep-all" | "keep-leading" | "trim-all";
|
|
15
|
+
pugSortAttributes?: "asc" | "desc" | "as-is";
|
|
16
|
+
pugSortAttributesBeginning?: string[];
|
|
17
|
+
pugSortAttributesEnd?: string[];
|
|
18
|
+
pugWrapAttributesThreshold?: number;
|
|
19
|
+
pugWrapAttributesPattern?: string;
|
|
20
|
+
pugClassLocation?: "before-attributes" | "after-attributes";
|
|
21
|
+
pugClassNotation?: "literal" | "attribute" | "as-is";
|
|
22
|
+
pugIdNotation?: "literal" | "as-is";
|
|
23
|
+
pugEmptyAttributes?: "as-is" | "none" | "all";
|
|
24
|
+
pugEmptyAttributesForceQuotes?: "as-is" | "none" | "all";
|
|
25
|
+
pugSingleFileComponentIndentation?: boolean;
|
|
26
|
+
pugFramework?: "auto" | "vue" | "svelte" | "angular";
|
|
27
|
+
pugExplicitDiv?: boolean;
|
|
28
|
+
pugPreserveAttributeBrackets?: boolean;
|
|
29
|
+
}
|
|
@@ -4,8 +4,8 @@ export declare const embeddedParsers: EmbeddedParsers;
|
|
|
4
4
|
export declare const embeddedEmbedders: EmbeddedEmbedders;
|
|
5
5
|
export declare const embeddedOptions: EmbeddedOptions;
|
|
6
6
|
import * as __glob__0_0 from "./css/index.js";
|
|
7
|
-
import * as __glob__0_1 from "./
|
|
8
|
-
import * as __glob__0_2 from "./
|
|
7
|
+
import * as __glob__0_1 from "./es/index.js";
|
|
8
|
+
import * as __glob__0_2 from "./glsl/index.js";
|
|
9
9
|
import * as __glob__0_3 from "./graphql/index.js";
|
|
10
10
|
import * as __glob__0_4 from "./html/index.js";
|
|
11
11
|
import * as __glob__0_5 from "./ini/index.js";
|
|
@@ -13,11 +13,11 @@ import * as __glob__0_6 from "./java/index.js";
|
|
|
13
13
|
import * as __glob__0_7 from "./json/index.js";
|
|
14
14
|
import * as __glob__0_8 from "./jsonata/index.js";
|
|
15
15
|
import * as __glob__0_9 from "./latex/index.js";
|
|
16
|
-
import * as __glob__0_10 from "./
|
|
17
|
-
import * as __glob__0_11 from "./
|
|
18
|
-
import * as __glob__0_12 from "./
|
|
19
|
-
import * as __glob__0_13 from "./
|
|
20
|
-
import * as __glob__0_14 from "./
|
|
16
|
+
import * as __glob__0_10 from "./markdown/index.js";
|
|
17
|
+
import * as __glob__0_11 from "./nginx/index.js";
|
|
18
|
+
import * as __glob__0_12 from "./noop/index.js";
|
|
19
|
+
import * as __glob__0_13 from "./pegjs/index.js";
|
|
20
|
+
import * as __glob__0_14 from "./php/index.js";
|
|
21
21
|
import * as __glob__0_15 from "./prisma/index.js";
|
|
22
22
|
import * as __glob__0_16 from "./properties/index.js";
|
|
23
23
|
import * as __glob__0_17 from "./pug/index.js";
|
|
@@ -5,21 +5,12 @@ import { type AutocompleteStringList, type StringListToInterfaceKey } from "../u
|
|
|
5
5
|
* - https://github.com/prettier/plugin-ruby/blob/0a2100ca3b8b53d9491270ece64806d95da181a6/src/plugin.js#L194
|
|
6
6
|
*/
|
|
7
7
|
declare const DEFAULT_IDENTIFIERS: readonly ["ruby"];
|
|
8
|
-
type Identifiers = AutocompleteStringList<typeof DEFAULT_IDENTIFIERS>;
|
|
8
|
+
type Identifiers = AutocompleteStringList<(typeof DEFAULT_IDENTIFIERS)[number]>;
|
|
9
9
|
type DefaultIdentifiersHolder = StringListToInterfaceKey<typeof DEFAULT_IDENTIFIERS>;
|
|
10
10
|
declare const RUBY_PARSERS: readonly ["ruby", "rbs", "haml"];
|
|
11
11
|
export type RubyParser = (typeof RUBY_PARSERS)[number];
|
|
12
|
-
declare const EMBEDDED_LANGUAGE_PARSER = "embeddedRubyParser";
|
|
13
12
|
declare const EMBEDDED_LANGUAGE_IDENTIFIERS: "embeddedRubyIdentifiers";
|
|
14
|
-
|
|
15
|
-
rubyPlugins?: AutocompleteStringList<[
|
|
16
|
-
"plugin/single_quotes",
|
|
17
|
-
"plugin/trailing_comma",
|
|
18
|
-
"plugin/disable_auto_ternary"
|
|
19
|
-
]>;
|
|
20
|
-
rubySingleQuote?: boolean;
|
|
21
|
-
rubyExecutablePath?: string;
|
|
22
|
-
}
|
|
13
|
+
declare const EMBEDDED_LANGUAGE_PARSER: "embeddedRubyParser";
|
|
23
14
|
export declare const options: {
|
|
24
15
|
readonly embeddedRubyIdentifiers: {
|
|
25
16
|
readonly category: "Embed";
|
|
@@ -47,13 +38,9 @@ declare module "../types.js" {
|
|
|
47
38
|
}
|
|
48
39
|
interface EmbeddedDefaultIdentifiersHolder extends DefaultIdentifiersHolder {
|
|
49
40
|
}
|
|
50
|
-
interface
|
|
41
|
+
interface PluginEmbedOptions {
|
|
51
42
|
[EMBEDDED_LANGUAGE_IDENTIFIERS]?: Identifiers;
|
|
52
43
|
[EMBEDDED_LANGUAGE_PARSER]?: RubyParser;
|
|
53
44
|
}
|
|
54
45
|
}
|
|
55
|
-
declare module "prettier" {
|
|
56
|
-
interface Options extends PrettierPluginDepsOptions {
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
46
|
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AutocompleteStringList } from "../utils.js";
|
|
2
|
+
export interface PluginRubyOptions {
|
|
3
|
+
rubyPlugins?: AutocompleteStringList<"plugin/single_quotes" | "plugin/trailing_comma" | "plugin/disable_auto_ternary">;
|
|
4
|
+
rubySingleQuote?: boolean;
|
|
5
|
+
rubyExecutablePath?: string;
|
|
6
|
+
}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { type AutocompleteStringList, type StringListToInterfaceKey, type UnionToIntersection } from "../utils.js";
|
|
1
|
+
import { type AutocompleteStringList, type StringListToInterfaceKey } from "../utils.js";
|
|
3
2
|
/**
|
|
4
3
|
* References:
|
|
5
4
|
*
|
|
6
5
|
* - https://github.com/github-linguist/linguist/blob/7ca3799b8b5f1acde1dd7a8dfb7ae849d3dfb4cd/lib/linguist/languages.yml#L6445C8-L6445C8
|
|
7
6
|
*/
|
|
8
7
|
declare const DEFAULT_IDENTIFIERS: readonly ["sh"];
|
|
9
|
-
type Identifiers = AutocompleteStringList<typeof DEFAULT_IDENTIFIERS>;
|
|
8
|
+
type Identifiers = AutocompleteStringList<(typeof DEFAULT_IDENTIFIERS)[number]>;
|
|
10
9
|
type DefaultIdentifiersHolder = StringListToInterfaceKey<typeof DEFAULT_IDENTIFIERS>;
|
|
11
10
|
declare const EMBEDDED_LANGUAGE_IDENTIFIERS: "embeddedShIdentifiers";
|
|
12
|
-
export interface PrettierPluginDepsOptions extends Partial<UnionToIntersection<ShParserOptions>> {
|
|
13
|
-
}
|
|
14
11
|
export declare const options: {
|
|
15
12
|
readonly embeddedShIdentifiers: {
|
|
16
13
|
readonly category: "Embed";
|
|
@@ -28,12 +25,8 @@ declare module "../types.js" {
|
|
|
28
25
|
}
|
|
29
26
|
interface EmbeddedDefaultIdentifiersHolder extends DefaultIdentifiersHolder {
|
|
30
27
|
}
|
|
31
|
-
interface
|
|
28
|
+
interface PluginEmbedOptions {
|
|
32
29
|
[EMBEDDED_LANGUAGE_IDENTIFIERS]?: Identifiers;
|
|
33
30
|
}
|
|
34
31
|
}
|
|
35
|
-
declare module "prettier" {
|
|
36
|
-
interface Options extends PrettierPluginDepsOptions {
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
32
|
export {};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { SqlPluginOptions as PrettierPluginSqlCstRequiredOptions } from "prettier-plugin-sql-cst";
|
|
3
|
-
import { type AutocompleteStringList, type StringListToInterfaceKey, type UnionToIntersection } from "../utils.js";
|
|
1
|
+
import { type AutocompleteStringList, type StringListToInterfaceKey } from "../utils.js";
|
|
4
2
|
/**
|
|
5
3
|
* References
|
|
6
4
|
*
|
|
@@ -8,7 +6,7 @@ import { type AutocompleteStringList, type StringListToInterfaceKey, type UnionT
|
|
|
8
6
|
* dialect, so we only have "sql" as the default identifier to avoid confusion.
|
|
9
7
|
*/
|
|
10
8
|
declare const DEFAULT_IDENTIFIERS: readonly ["sql"];
|
|
11
|
-
type Identifiers = AutocompleteStringList<typeof DEFAULT_IDENTIFIERS>;
|
|
9
|
+
type Identifiers = AutocompleteStringList<(typeof DEFAULT_IDENTIFIERS)[number]>;
|
|
12
10
|
type DefaultIdentifiersHolder = StringListToInterfaceKey<typeof DEFAULT_IDENTIFIERS>;
|
|
13
11
|
declare const SQL_PLUGINS: readonly ["prettier-plugin-sql", "prettier-plugin-sql-cst"];
|
|
14
12
|
type SqlPlugin = (typeof SQL_PLUGINS)[number];
|
|
@@ -17,9 +15,6 @@ type SqlCstParser = (typeof SQL_CST_PARSERS)[number];
|
|
|
17
15
|
declare const EMBEDDED_LANGUAGE_IDENTIFIERS: "embeddedSqlIdentifiers";
|
|
18
16
|
declare const EMBEDDED_LANGUAGE_PLUGIN: "embeddedSqlPlugin";
|
|
19
17
|
declare const EMBEDDED_LANGUAGE_PARSER: "embeddedSqlParser";
|
|
20
|
-
type PrettierPluginSqlCstOptions = Partial<PrettierPluginSqlCstRequiredOptions>;
|
|
21
|
-
export interface PrettierPluginDepsOptions extends UnionToIntersection<PrettierPluginSqlOptions>, PrettierPluginSqlCstOptions {
|
|
22
|
-
}
|
|
23
18
|
export declare const options: {
|
|
24
19
|
readonly embeddedSqlIdentifiers: {
|
|
25
20
|
readonly category: "Embed";
|
|
@@ -46,7 +41,7 @@ export declare const options: {
|
|
|
46
41
|
default: "sqlite";
|
|
47
42
|
description: string;
|
|
48
43
|
choices: {
|
|
49
|
-
value: "
|
|
44
|
+
value: "bigquery" | "mariadb" | "mysql" | "postgresql" | "sqlite";
|
|
50
45
|
description: string;
|
|
51
46
|
}[];
|
|
52
47
|
};
|
|
@@ -57,14 +52,10 @@ declare module "../types.js" {
|
|
|
57
52
|
}
|
|
58
53
|
interface EmbeddedDefaultIdentifiersHolder extends DefaultIdentifiersHolder {
|
|
59
54
|
}
|
|
60
|
-
interface
|
|
55
|
+
interface PluginEmbedOptions {
|
|
61
56
|
[EMBEDDED_LANGUAGE_IDENTIFIERS]?: Identifiers;
|
|
62
57
|
[EMBEDDED_LANGUAGE_PLUGIN]?: SqlPlugin;
|
|
63
58
|
[EMBEDDED_LANGUAGE_PARSER]?: SqlCstParser;
|
|
64
59
|
}
|
|
65
60
|
}
|
|
66
|
-
declare module "prettier" {
|
|
67
|
-
interface Options extends PrettierPluginDepsOptions {
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
61
|
export {};
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { type AutocompleteStringList, type StringListToInterfaceKey, type UnionToIntersection } from "../utils.js";
|
|
1
|
+
import { type AutocompleteStringList, type StringListToInterfaceKey } from "../utils.js";
|
|
3
2
|
/**
|
|
4
3
|
* References:
|
|
5
4
|
*
|
|
6
5
|
* - https://github.com/github-linguist/linguist/blob/7ca3799b8b5f1acde1dd7a8dfb7ae849d3dfb4cd/lib/linguist/languages.yml#L6890
|
|
7
6
|
*/
|
|
8
7
|
declare const DEFAULT_IDENTIFIERS: readonly ["toml"];
|
|
9
|
-
type Identifiers = AutocompleteStringList<typeof DEFAULT_IDENTIFIERS>;
|
|
8
|
+
type Identifiers = AutocompleteStringList<(typeof DEFAULT_IDENTIFIERS)[number]>;
|
|
10
9
|
type DefaultIdentifiersHolder = StringListToInterfaceKey<typeof DEFAULT_IDENTIFIERS>;
|
|
11
10
|
declare const EMBEDDED_LANGUAGE_IDENTIFIERS: "embeddedTomlIdentifiers";
|
|
12
|
-
export interface PrettierPluginDepsOptions extends UnionToIntersection<PrettierTaploOptions> {
|
|
13
|
-
}
|
|
14
11
|
export declare const options: {
|
|
15
12
|
readonly embeddedTomlIdentifiers: {
|
|
16
13
|
readonly category: "Embed";
|
|
@@ -28,12 +25,8 @@ declare module "../types.js" {
|
|
|
28
25
|
}
|
|
29
26
|
interface EmbeddedDefaultIdentifiersHolder extends DefaultIdentifiersHolder {
|
|
30
27
|
}
|
|
31
|
-
interface
|
|
28
|
+
interface PluginEmbedOptions {
|
|
32
29
|
[EMBEDDED_LANGUAGE_IDENTIFIERS]?: Identifiers;
|
|
33
30
|
}
|
|
34
31
|
}
|
|
35
|
-
declare module "prettier" {
|
|
36
|
-
interface Options extends PrettierPluginDepsOptions {
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
32
|
export {};
|
|
@@ -6,14 +6,12 @@ import { type AutocompleteStringList, type StringListToInterfaceKey } from "../u
|
|
|
6
6
|
* - https://github.com/github-linguist/linguist/blob/7ca3799b8b5f1acde1dd7a8dfb7ae849d3dfb4cd/lib/linguist/languages.yml#L7158
|
|
7
7
|
*/
|
|
8
8
|
declare const DEFAULT_IDENTIFIERS: readonly ["ts", "tsx", "cts", "mts", "typescript"];
|
|
9
|
-
type Identifiers = AutocompleteStringList<typeof DEFAULT_IDENTIFIERS>;
|
|
9
|
+
type Identifiers = AutocompleteStringList<(typeof DEFAULT_IDENTIFIERS)[number]>;
|
|
10
10
|
type DefaultIdentifiersHolder = StringListToInterfaceKey<typeof DEFAULT_IDENTIFIERS>;
|
|
11
11
|
declare const TS_PARSERS: readonly ["typescript", "babel-ts"];
|
|
12
12
|
export type TsParser = (typeof TS_PARSERS)[number];
|
|
13
13
|
declare const EMBEDDED_LANGUAGE_PARSER: "embeddedTsParser";
|
|
14
14
|
declare const EMBEDDED_LANGUAGE_IDENTIFIERS: "embeddedTsIdentifiers";
|
|
15
|
-
export interface PrettierPluginDepsOptions {
|
|
16
|
-
}
|
|
17
15
|
export declare const options: {
|
|
18
16
|
readonly embeddedTsIdentifiers: {
|
|
19
17
|
readonly category: "Embed";
|
|
@@ -41,13 +39,9 @@ declare module "../types.js" {
|
|
|
41
39
|
}
|
|
42
40
|
interface EmbeddedDefaultIdentifiersHolder extends DefaultIdentifiersHolder {
|
|
43
41
|
}
|
|
44
|
-
interface
|
|
42
|
+
interface PluginEmbedOptions {
|
|
45
43
|
[EMBEDDED_LANGUAGE_IDENTIFIERS]?: Identifiers;
|
|
46
44
|
[EMBEDDED_LANGUAGE_PARSER]?: TsParser;
|
|
47
45
|
}
|
|
48
46
|
}
|
|
49
|
-
declare module "prettier" {
|
|
50
|
-
interface Options extends PrettierPluginDepsOptions {
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
47
|
export {};
|
package/dist/embedded/types.d.ts
CHANGED
|
@@ -14,6 +14,6 @@ export type EmbeddedLanguage = Satisfies<EmbeddedLanguageNamingConvention, keyof
|
|
|
14
14
|
export interface EmbeddedDefaultIdentifiersHolder {
|
|
15
15
|
}
|
|
16
16
|
export type EmbeddedDefaultIdentifier = keyof EmbeddedDefaultIdentifiersHolder;
|
|
17
|
-
export interface
|
|
17
|
+
export interface PluginEmbedOptions {
|
|
18
18
|
}
|
|
19
19
|
export {};
|
package/dist/embedded/utils.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Comment, Expression, TemplateLiteral } from "estree";
|
|
2
2
|
import type { AstPath, Doc, Options } from "prettier";
|
|
3
3
|
import { builders } from "prettier/doc";
|
|
4
|
+
import type { LiteralUnion, OmitIndexSignature, UnionToIntersection } from "type-fest";
|
|
4
5
|
import type { InternalPrintFun } from "../types.js";
|
|
5
6
|
export declare function printTemplateExpression(path: AstPath<Expression & {
|
|
6
7
|
comments?: Comment[];
|
|
@@ -18,9 +19,11 @@ export declare function escapeRegExp(text: string): string;
|
|
|
18
19
|
export declare function makeIdentifiersOptionName<T extends string>(language: T): `${T}Identifiers`;
|
|
19
20
|
export declare function makePluginOptionName<T extends string>(language: T): `${T}Plugin`;
|
|
20
21
|
export declare function makeParserOptionName<T extends string>(language: T): `${T}Parser`;
|
|
21
|
-
export type AutocompleteStringList<T extends
|
|
22
|
+
export type AutocompleteStringList<T extends string> = LiteralUnion<T, string>[];
|
|
22
23
|
export type StringListToInterfaceKey<T extends readonly string[]> = {
|
|
23
24
|
[key in T[number]]: undefined;
|
|
24
25
|
};
|
|
25
26
|
export type Satisfies<U, T extends U> = T;
|
|
26
|
-
export type
|
|
27
|
+
export type NormalizeOptions<T> = OmitIndexSignature<{
|
|
28
|
+
[k in keyof UnionToIntersection<T>]?: k extends keyof T ? T[k] : UnionToIntersection<T>[k];
|
|
29
|
+
}>;
|
|
@@ -6,15 +6,9 @@ import { type AutocompleteStringList, type StringListToInterfaceKey } from "../u
|
|
|
6
6
|
* - https://github.com/github-linguist/linguist/blob/7ca3799b8b5f1acde1dd7a8dfb7ae849d3dfb4cd/lib/linguist/languages.yml#L7712
|
|
7
7
|
*/
|
|
8
8
|
declare const DEFAULT_IDENTIFIERS: readonly ["xml", "opml", "rss", "svg"];
|
|
9
|
-
type Identifiers = AutocompleteStringList<typeof DEFAULT_IDENTIFIERS>;
|
|
9
|
+
type Identifiers = AutocompleteStringList<(typeof DEFAULT_IDENTIFIERS)[number]>;
|
|
10
10
|
type DefaultIdentifiersHolder = StringListToInterfaceKey<typeof DEFAULT_IDENTIFIERS>;
|
|
11
11
|
declare const EMBEDDED_LANGUAGE_IDENTIFIERS: "embeddedXmlIdentifiers";
|
|
12
|
-
export interface PrettierPluginDepsOptions {
|
|
13
|
-
xmlSelfClosingSpace?: boolean;
|
|
14
|
-
xmlWhitespaceSensitivity?: "strict" | "preserve" | "ignore";
|
|
15
|
-
xmlSortAttributesByKey?: boolean;
|
|
16
|
-
xmlQuoteAttributes?: "preserve" | "single" | "double";
|
|
17
|
-
}
|
|
18
12
|
export declare const options: {
|
|
19
13
|
readonly embeddedXmlIdentifiers: {
|
|
20
14
|
readonly category: "Embed";
|
|
@@ -44,12 +38,8 @@ declare module "../types.js" {
|
|
|
44
38
|
}
|
|
45
39
|
interface EmbeddedDefaultIdentifiersHolder extends DefaultIdentifiersHolder {
|
|
46
40
|
}
|
|
47
|
-
interface
|
|
41
|
+
interface PluginEmbedOptions {
|
|
48
42
|
[EMBEDDED_LANGUAGE_IDENTIFIERS]?: Identifiers;
|
|
49
43
|
}
|
|
50
44
|
}
|
|
51
|
-
declare module "prettier" {
|
|
52
|
-
interface Options extends PrettierPluginDepsOptions {
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
45
|
export {};
|
|
@@ -5,11 +5,9 @@ import { type AutocompleteStringList, type StringListToInterfaceKey } from "../u
|
|
|
5
5
|
* - https://github.com/github-linguist/linguist/blob/7ca3799b8b5f1acde1dd7a8dfb7ae849d3dfb4cd/lib/linguist/languages.yml#L7940
|
|
6
6
|
*/
|
|
7
7
|
declare const DEFAULT_IDENTIFIERS: readonly ["yaml", "yml"];
|
|
8
|
-
type Identifiers = AutocompleteStringList<typeof DEFAULT_IDENTIFIERS>;
|
|
8
|
+
type Identifiers = AutocompleteStringList<(typeof DEFAULT_IDENTIFIERS)[number]>;
|
|
9
9
|
type DefaultIdentifiersHolder = StringListToInterfaceKey<typeof DEFAULT_IDENTIFIERS>;
|
|
10
10
|
declare const EMBEDDED_LANGUAGE_IDENTIFIERS: "embeddedYamlIdentifiers";
|
|
11
|
-
export interface PrettierPluginDepsOptions {
|
|
12
|
-
}
|
|
13
11
|
export declare const options: {
|
|
14
12
|
readonly embeddedYamlIdentifiers: {
|
|
15
13
|
readonly category: "Embed";
|
|
@@ -27,12 +25,8 @@ declare module "../types.js" {
|
|
|
27
25
|
}
|
|
28
26
|
interface EmbeddedDefaultIdentifiersHolder extends DefaultIdentifiersHolder {
|
|
29
27
|
}
|
|
30
|
-
interface
|
|
28
|
+
interface PluginEmbedOptions {
|
|
31
29
|
[EMBEDDED_LANGUAGE_IDENTIFIERS]?: Identifiers;
|
|
32
30
|
}
|
|
33
31
|
}
|
|
34
|
-
declare module "prettier" {
|
|
35
|
-
interface Options extends PrettierPluginDepsOptions {
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
32
|
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
export * from "./embedded/index.js";
|
|
2
1
|
export { options } from "./options.js";
|
|
3
2
|
export { parsers } from "./parsers.js";
|
|
4
3
|
export { printers } from "./printers.js";
|
|
5
|
-
export type
|
|
4
|
+
export type { PluginEmbedOptions } from "./embedded/index.js";
|
|
5
|
+
export type { EmbeddedOverride } from "./types.js";
|
|
6
|
+
export type {
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Renamed to `PluginEmbedOptions`
|
|
9
|
+
*/
|
|
10
|
+
PluginEmbedOptions as PrettierPluginEmbedOptions, } from "./embedded/index.js";
|