prettier-plugin-embed 0.4.6 → 0.4.8
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 +71 -7
- package/dist/embedded/css/language.d.ts +1 -1
- package/dist/embedded/css/options.d.ts +14 -0
- package/dist/embedded/es/language.d.ts +1 -1
- package/dist/embedded/es/options.d.ts +1 -1
- package/dist/embedded/glsl/language.d.ts +1 -1
- package/dist/embedded/graphql/language.d.ts +1 -1
- package/dist/embedded/html/language.d.ts +1 -1
- package/dist/embedded/ini/language.d.ts +1 -1
- package/dist/embedded/java/embedder.d.ts +12 -0
- package/dist/embedded/java/index.d.ts +3 -0
- package/dist/embedded/java/language.d.ts +9 -0
- package/dist/embedded/java/options.d.ts +38 -0
- package/dist/embedded/json/language.d.ts +1 -1
- package/dist/embedded/jsonata/embedder.d.ts +12 -0
- package/dist/embedded/jsonata/index.d.ts +3 -0
- package/dist/embedded/jsonata/language.d.ts +9 -0
- package/dist/embedded/jsonata/options.d.ts +33 -0
- package/dist/embedded/latex/language.d.ts +1 -1
- package/dist/embedded/markdown/language.d.ts +1 -1
- package/dist/embedded/markdown/options.d.ts +14 -0
- package/dist/embedded/nginx/embedder.d.ts +12 -0
- package/dist/embedded/nginx/index.d.ts +3 -0
- package/dist/embedded/nginx/language.d.ts +9 -0
- package/dist/embedded/nginx/options.d.ts +34 -0
- package/dist/embedded/noop/language.d.ts +1 -1
- package/dist/embedded/pegjs/embedder.d.ts +12 -0
- package/dist/embedded/pegjs/index.d.ts +3 -0
- package/dist/embedded/pegjs/language.d.ts +9 -0
- package/dist/embedded/pegjs/options.d.ts +36 -0
- package/dist/embedded/php/language.d.ts +1 -1
- package/dist/embedded/prisma/embedder.d.ts +12 -0
- package/dist/embedded/prisma/index.d.ts +3 -0
- package/dist/embedded/prisma/language.d.ts +9 -0
- package/dist/embedded/prisma/options.d.ts +33 -0
- package/dist/embedded/properties/language.d.ts +1 -1
- package/dist/embedded/pug/embedder.d.ts +12 -0
- package/dist/embedded/pug/index.d.ts +3 -0
- package/dist/embedded/pug/language.d.ts +9 -0
- package/dist/embedded/pug/options.d.ts +60 -0
- package/dist/embedded/register.d.ts +20 -14
- package/dist/embedded/ruby/language.d.ts +1 -1
- package/dist/embedded/sh/language.d.ts +1 -1
- package/dist/embedded/sql/language.d.ts +1 -1
- package/dist/embedded/toml/language.d.ts +1 -1
- package/dist/embedded/ts/language.d.ts +1 -1
- package/dist/embedded/ts/options.d.ts +1 -1
- package/dist/embedded/utils.d.ts +2 -2
- package/dist/embedded/xml/language.d.ts +1 -1
- package/dist/embedded/yaml/language.d.ts +1 -1
- package/dist/index.js +1295 -1043
- package/dist/options.d.ts +93 -19
- package/dist/types.d.ts +1 -1
- package/dist/utils.d.ts +1 -1
- package/package.json +19 -9
package/README.md
CHANGED
|
@@ -115,11 +115,17 @@ Supported embedded languages are:
|
|
|
115
115
|
- [GraphQL](#graphql)
|
|
116
116
|
- [HTML](#html)
|
|
117
117
|
- [INI](#ini)
|
|
118
|
+
- [Java](#java)
|
|
118
119
|
- [JSON](#json)
|
|
120
|
+
- [JSONata](#jsonata)
|
|
119
121
|
- [LaTeX](#latex)
|
|
120
122
|
- [Markdown](#markdown)
|
|
123
|
+
- [NGINX](#nginx)
|
|
124
|
+
- [Pegjs](#pegjs)
|
|
121
125
|
- [PHP](#php)
|
|
126
|
+
- [Prisma](#prisma)
|
|
122
127
|
- [Properties](#properties)
|
|
128
|
+
- [Pug](#pug)
|
|
123
129
|
- [Ruby](#ruby)
|
|
124
130
|
- [Sh (Shell)](#sh-shell)
|
|
125
131
|
- [SQL](#sql)
|
|
@@ -139,18 +145,21 @@ Click Here to Toggle
|
|
|
139
145
|
| :-----------------------: | :--------: | :------------------------------------: | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
140
146
|
| `embeddedNoopIdentifiers` | `string[]` | [`[]`](./src/embedded/noop/options.ts) | Tag or comment identifiers that prevent their subsequent template literals from being identified as embedded languages and thus from being formatted. |
|
|
141
147
|
|
|
142
|
-
This option doesn't require other plugins and can override the native embedded language formatting. It serves as a way to turn off embedded language formatting for
|
|
148
|
+
This option doesn't require other plugins and can override the native embedded language formatting. It serves as a way to turn off embedded language formatting for the specified language identifiers.
|
|
143
149
|
|
|
144
150
|
#### CSS
|
|
145
151
|
|
|
146
|
-
| Option |
|
|
147
|
-
| :----------------------: |
|
|
148
|
-
| `embeddedCssIdentifiers` |
|
|
152
|
+
| Option | Type | Default | Description |
|
|
153
|
+
| :----------------------: | :----------------------------------------------------------: | :----------------------------------------: | --------------------------------------------------------------------------------------------------------------- |
|
|
154
|
+
| `embeddedCssIdentifiers` | `string[]` | [`["css"]`](./src/embedded/css/options.ts) | Tag or comment identifiers that make their subsequent template literals be identified as embedded CSS language. |
|
|
155
|
+
| `embeddedCssParser` | [`"css" \| "less"\| "scss"`](./src/embedded/css/options.ts) | [`"scss"`](./src/embedded/css/options.ts) | The parser used to parse the embedded CSS language. |
|
|
149
156
|
|
|
150
157
|
Formatting embedded CSS language doesn't require other plugins and uses the parsers and printers provided by Prettier natively.
|
|
151
158
|
|
|
152
159
|
This can override the native formatting bahavior for embedded CSS language. If you want to keep the native behavior, set `embeddedCssIdentifiers` to `[]` or other identifiers.
|
|
153
160
|
|
|
161
|
+
If you want to specify different parsers for different identifiers, check [`embeddedOverrides`](#embeddedoverrides).
|
|
162
|
+
|
|
154
163
|
#### ES (ECMAScript/JavaScript)
|
|
155
164
|
|
|
156
165
|
| Option | Type | Default | Description |
|
|
@@ -201,6 +210,14 @@ If you want to specify different parsers for different identifiers, check [`embe
|
|
|
201
210
|
|
|
202
211
|
Formatting embedded INI language requires the [`prettier-plugin-ini`](https://github.com/kddnewton/prettier-plugin-ini) plugin 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.
|
|
203
212
|
|
|
213
|
+
#### Java
|
|
214
|
+
|
|
215
|
+
| Option | Type | Default | Description |
|
|
216
|
+
| :-----------------------: | :--------: | :------------------------------------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
217
|
+
| `embeddedJavaIdentifiers` | `string[]` | [`["java"]`](./src/embedded/java/options.ts) | Tag or comment identifiers that make their subsequent template literals be identified as embedded Java language. This option requires the `prettier-plugin-java` plugin. |
|
|
218
|
+
|
|
219
|
+
Formatting embedded Java language requires the [`prettier-plugin-java`](https://github.com/jhipster/prettier-java/tree/main/packages/prettier-plugin-java) plugin to be loaded as well. And [options](https://github.com/jhipster/prettier-java/tree/main/packages/prettier-plugin-java#options) supported by `prettier-plugin-java` can therefore be used to further control the formatting behavior.
|
|
220
|
+
|
|
204
221
|
#### JSON
|
|
205
222
|
|
|
206
223
|
| Option | Type | Default | Description |
|
|
@@ -212,6 +229,14 @@ Formatting embedded JSON language doesn't require other plugins and uses the par
|
|
|
212
229
|
|
|
213
230
|
If you want to specify different parsers for different identifiers, check [`embeddedOverrides`](#embeddedoverrides).
|
|
214
231
|
|
|
232
|
+
#### JSONata
|
|
233
|
+
|
|
234
|
+
| Option | Type | Default | Description |
|
|
235
|
+
| :--------------------------: | :--------: | :------------------------------------------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
236
|
+
| `embeddedJsonataIdentifiers` | `string[]` | [`["jsonata"]`](./src/embedded/jsonata/options.ts) | Tag or comment identifiers that make their subsequent template literals be identified as embedded JSONata language. This option requires the `@stedi/prettier-plugin-jsonata` plugin. |
|
|
237
|
+
|
|
238
|
+
Formatting embedded JSONata language requires the [`@stedi/prettier-plugin-jsonata`](https://github.com/Stedi/prettier-plugin-jsonata) plugin to be loaded as well.
|
|
239
|
+
|
|
215
240
|
#### LaTeX
|
|
216
241
|
|
|
217
242
|
| Option | Type | Default | Description |
|
|
@@ -222,14 +247,37 @@ Formatting embedded LaTeX language requires the [`prettier-plugin-latex`](https:
|
|
|
222
247
|
|
|
223
248
|
#### Markdown
|
|
224
249
|
|
|
225
|
-
| Option |
|
|
226
|
-
| :---------------------------: |
|
|
227
|
-
| `embeddedMarkdownIdentifiers` |
|
|
250
|
+
| Option | Type | Default | Description |
|
|
251
|
+
| :---------------------------: | :---------------------------------------------------------------------: | :--------------------------------------------------------: | -------------------------------------------------------------------------------------------------------------------- |
|
|
252
|
+
| `embeddedMarkdownIdentifiers` | `string[]` | [`["md", "markdown"]`](./src/embedded/markdown/options.ts) | Tag or comment identifiers that make their subsequent template literals be identified as embedded Markdown language. |
|
|
253
|
+
| `embeddedMarkdownParser` | [`"markdown" \| "mdx"\| "remark"`](./src/embedded/markdown/options.ts) | [`"markdown"`](./src/embedded/markdown/options.ts) | The parser used to parse the embedded Markdown language. |
|
|
228
254
|
|
|
229
255
|
Formatting embedded Markdown language doesn't require other plugins and uses the parsers and printers provided by Prettier natively.
|
|
230
256
|
|
|
231
257
|
This can override the native formatting for embedded Markdown language. If you want to keep the native behavior, set `embeddedMarkdownIdentifiers` to `[]` or other identifiers.
|
|
232
258
|
|
|
259
|
+
If you want to specify different parsers for different identifiers, check [`embeddedOverrides`](#embeddedoverrides).
|
|
260
|
+
|
|
261
|
+
The `remark` parser is [an alias of the `markdown` parser](https://github.com/prettier/prettier/blob/ed23dacc9e655c3876971b30859497b17ff2cf9f/src/language-markdown/parser-markdown.js#L57).
|
|
262
|
+
|
|
263
|
+
#### NGINX
|
|
264
|
+
|
|
265
|
+
| Option | Type | Default | Description |
|
|
266
|
+
| :------------------------: | :--------: | :--------------------------------------------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
267
|
+
| `embeddedNginxIdentifiers` | `string[]` | [`["nginx"]`](./src/embedded/nginx/options.ts) | Tag or comment identifiers that make their subsequent template literals be identified as embedded NGINX language. This option requires the `prettier-plugin-nginx` plugin. |
|
|
268
|
+
|
|
269
|
+
Formatting embedded Pegjs language requires the [`prettier-plugin-nginx`](https://github.com/jxddk/prettier-plugin-nginx) plugin to be loaded as well. And [options](https://github.com/jxddk/prettier-plugin-nginx?tab=readme-ov-file#configuration) supported by `prettier-plugin-nginx` can therefore be used to further control the formatting behavior.
|
|
270
|
+
|
|
271
|
+
#### Pegjs
|
|
272
|
+
|
|
273
|
+
| Option | Type | Default | Description |
|
|
274
|
+
| :------------------------: | :--------: | :------------------------------------------------------------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
275
|
+
| `embeddedPegjsIdentifiers` | `string[]` | [`["pegjs", "peggy", "peg"]`](./src/embedded/pegjs/options.ts) | Tag or comment identifiers that make their subsequent template literals be identified as embedded Pegjs language. This option requires the `prettier-plugin-pegjs` plugin. |
|
|
276
|
+
|
|
277
|
+
Formatting embedded Pegjs language requires the [`prettier-plugin-pegjs`](https://github.com/siefkenj/prettier-plugin-pegjs) plugin to be loaded as well. And [options](https://github.com/siefkenj/prettier-plugin-pegjs?tab=readme-ov-file#options) supported by `prettier-plugin-pegjs` can therefore be used to further control the formatting behavior.
|
|
278
|
+
|
|
279
|
+
Note that `prettier-plugin-pegjs` supports different parsers for the action blocks and they are specified by the [`actionParser` option](https://github.com/siefkenj/prettier-plugin-pegjs?tab=readme-ov-file#options). If you want to specify different action parsers for different identifiers, check [`embeddedOverrides`](#embeddedoverrides).
|
|
280
|
+
|
|
233
281
|
#### PHP
|
|
234
282
|
|
|
235
283
|
| Option | Type | Default | Description |
|
|
@@ -238,6 +286,14 @@ This can override the native formatting for embedded Markdown language. If you w
|
|
|
238
286
|
|
|
239
287
|
Formatting embedded PHP language requires the [`@prettier/plugin-php`](https://github.com/prettier/plugin-php) plugin to be loaded as well. And [options](https://github.com/prettier/plugin-php#configuration) supported by `@prettier/plugin-php` can therefore be used to further control the formatting behavior.
|
|
240
288
|
|
|
289
|
+
#### Prisma
|
|
290
|
+
|
|
291
|
+
| Option | Type | Default | Description |
|
|
292
|
+
| :-------------------------: | :--------: | :----------------------------------------------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
293
|
+
| `embeddedPrismaIdentifiers` | `string[]` | [`["prisma"]`](./src/embedded/prisma/options.ts) | Tag or comment identifiers that make their subsequent template literals be identified as embedded Prisma language. This option requires the `prettier-plugin-prisma` plugin. |
|
|
294
|
+
|
|
295
|
+
Formatting embedded Prisma language requires the [`prettier-plugin-prisma`](https://github.com/avocadowastaken/prettier-plugin-prisma) plugin to be loaded as well.
|
|
296
|
+
|
|
241
297
|
#### Properties
|
|
242
298
|
|
|
243
299
|
| Option | Type | Default | Description |
|
|
@@ -246,6 +302,14 @@ Formatting embedded PHP language requires the [`@prettier/plugin-php`](https://g
|
|
|
246
302
|
|
|
247
303
|
Formatting embedded Properties language requires the [`prettier-plugin-properties`](https://github.com/eemeli/prettier-plugin-properties) plugin 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.
|
|
248
304
|
|
|
305
|
+
#### Pug
|
|
306
|
+
|
|
307
|
+
| Option | Type | Default | Description |
|
|
308
|
+
| :----------------------: | :--------: | :------------------------------------------------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
309
|
+
| `embeddedPugIdentifiers` | `string[]` | [`["pug", "jade"]`](./src/embedded/pug/options.ts) | Tag or comment identifiers that make their subsequent template literals be identified as embedded Pug language. This option requires the `@prettier/plugin-pug` plugin. |
|
|
310
|
+
|
|
311
|
+
Formatting embedded Shell language requires the [`@prettier/plugin-pug`](https://github.com/prettier/plugin-pug) plugin to be loaded as well. And [options](https://github.com/prettier/plugin-pug?tab=readme-ov-file#configuration) supported by `@prettier/plugin-pug` can therefore be used to further control the formatting behavior.
|
|
312
|
+
|
|
249
313
|
#### Ruby
|
|
250
314
|
|
|
251
315
|
| Option | Type | Default | Description |
|
|
@@ -8,7 +8,10 @@ import { type AutocompleteStringList, type StringListToInterfaceKey } from "../u
|
|
|
8
8
|
declare const DEFAULT_IDENTIFIERS: readonly ["css"];
|
|
9
9
|
type Identifiers = AutocompleteStringList<typeof DEFAULT_IDENTIFIERS>;
|
|
10
10
|
type DefaultIdentifiersHolder = StringListToInterfaceKey<typeof DEFAULT_IDENTIFIERS>;
|
|
11
|
+
declare const CSS_PARSERS: readonly ["css", "less", "scss"];
|
|
12
|
+
type CssParser = (typeof CSS_PARSERS)[number];
|
|
11
13
|
declare const EMBEDDED_LANGUAGE_IDENTIFIERS: "embeddedCssIdentifiers";
|
|
14
|
+
declare const EMBEDDED_LANGUAGE_PARSER: "embeddedCssParser";
|
|
12
15
|
export interface PrettierPluginDepsOptions {
|
|
13
16
|
}
|
|
14
17
|
export declare const options: {
|
|
@@ -21,6 +24,16 @@ export declare const options: {
|
|
|
21
24
|
}];
|
|
22
25
|
readonly description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded CSS language.";
|
|
23
26
|
};
|
|
27
|
+
readonly embeddedCssParser: {
|
|
28
|
+
category: string;
|
|
29
|
+
type: "choice";
|
|
30
|
+
default: "scss";
|
|
31
|
+
description: string;
|
|
32
|
+
choices: {
|
|
33
|
+
value: "css" | "less" | "scss";
|
|
34
|
+
description: string;
|
|
35
|
+
}[];
|
|
36
|
+
};
|
|
24
37
|
};
|
|
25
38
|
type Options = typeof options;
|
|
26
39
|
declare module "../types.js" {
|
|
@@ -30,6 +43,7 @@ declare module "../types.js" {
|
|
|
30
43
|
}
|
|
31
44
|
interface PrettierPluginEmbedOptions {
|
|
32
45
|
[EMBEDDED_LANGUAGE_IDENTIFIERS]?: Identifiers;
|
|
46
|
+
[EMBEDDED_LANGUAGE_PARSER]?: CssParser;
|
|
33
47
|
}
|
|
34
48
|
}
|
|
35
49
|
declare module "prettier" {
|
|
@@ -9,7 +9,7 @@ declare const DEFAULT_IDENTIFIERS: readonly ["js", "jsx", "es", "es6", "mjs", "c
|
|
|
9
9
|
type Identifiers = AutocompleteStringList<typeof DEFAULT_IDENTIFIERS>;
|
|
10
10
|
type DefaultIdentifiersHolder = StringListToInterfaceKey<typeof DEFAULT_IDENTIFIERS>;
|
|
11
11
|
declare const ES_PARSERS: readonly ["babel", "babel-flow", "acorn", "espree", "flow", "meriyah"];
|
|
12
|
-
type EsParser = (typeof ES_PARSERS)[number];
|
|
12
|
+
export type EsParser = (typeof ES_PARSERS)[number];
|
|
13
13
|
declare const EMBEDDED_LANGUAGE_IDENTIFIERS: "embeddedEsIdentifiers";
|
|
14
14
|
declare const EMBEDDED_LANGUAGE_PARSER: "embeddedEsParser";
|
|
15
15
|
export interface PrettierPluginDepsOptions {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Options } from "prettier";
|
|
2
|
+
import type { Embedder } from "../../types.js";
|
|
3
|
+
import { language } from "./language.js";
|
|
4
|
+
export declare const embedder: Embedder<Options>;
|
|
5
|
+
/**
|
|
6
|
+
* Register the embedder to the EmbeddedEmbedders
|
|
7
|
+
*/
|
|
8
|
+
declare module "../types.js" {
|
|
9
|
+
interface EmbeddedEmbedders {
|
|
10
|
+
[language]: typeof embedder;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type AutocompleteStringList, type StringListToInterfaceKey } from "../utils.js";
|
|
2
|
+
declare const DEFAULT_IDENTIFIERS: readonly ["java"];
|
|
3
|
+
type Identifiers = AutocompleteStringList<typeof DEFAULT_IDENTIFIERS>;
|
|
4
|
+
type DefaultIdentifiersHolder = StringListToInterfaceKey<typeof DEFAULT_IDENTIFIERS>;
|
|
5
|
+
declare const EMBEDDED_LANGUAGE_IDENTIFIERS: "embeddedJavaIdentifiers";
|
|
6
|
+
/**
|
|
7
|
+
* Location:
|
|
8
|
+
* https://github.com/jhipster/prettier-java/blob/983a09d890ae832565ceda1a28b3074e061e3cea/packages/prettier-plugin-java/src/options.js
|
|
9
|
+
*/
|
|
10
|
+
export interface PrettierPluginDepsOptions {
|
|
11
|
+
entrypoint?: "arrayInitializer" | "variableInitializerList" | "block" | "blockStatements" | "blockStatement" | "localVariableDeclarationStatement" | "localVariableDeclaration" | "localVariableType" | "statement" | "statementWithoutTrailingSubstatement" | "emptyStatement" | "labeledStatement" | "expressionStatement" | "statementExpression" | "ifStatement" | "assertStatement" | "switchStatement" | "switchBlock" | "switchBlockStatementGroup" | "switchLabel" | "switchRule" | "caseConstant" | "whileStatement" | "doStatement" | "forStatement" | "basicForStatement" | "forInit" | "forUpdate" | "statementExpressionList" | "enhancedForStatement" | "breakStatement" | "continueStatement" | "returnStatement" | "throwStatement" | "synchronizedStatement" | "tryStatement" | "catches" | "catchClause" | "catchFormalParameter" | "catchType" | "finally" | "tryWithResourcesStatement" | "resourceSpecification" | "resourceList" | "resource" | "yieldStatement" | "variableAccess" | "classDeclaration" | "normalClassDeclaration" | "classModifier" | "typeParameters" | "typeParameterList" | "superclass" | "superinterfaces" | "interfaceTypeList" | "classPermits" | "classBody" | "classBodyDeclaration" | "classMemberDeclaration" | "fieldDeclaration" | "fieldModifier" | "variableDeclaratorList" | "variableDeclarator" | "variableDeclaratorId" | "variableInitializer" | "unannType" | "unannPrimitiveTypeWithOptionalDimsSuffix" | "unannPrimitiveType" | "unannReferenceType" | "unannClassOrInterfaceType" | "unannClassType" | "unannInterfaceType" | "unannTypeVariable" | "methodDeclaration" | "methodModifier" | "methodHeader" | "result" | "methodDeclarator" | "receiverParameter" | "formalParameterList" | "formalParameter" | "variableParaRegularParameter" | "variableArityParameter" | "variableModifier" | "throws" | "exceptionTypeList" | "exceptionType" | "methodBody" | "instanceInitializer" | "staticInitializer" | "constructorDeclaration" | "constructorModifier" | "constructorDeclarator" | "simpleTypeName" | "constructorBody" | "explicitConstructorInvocation" | "unqualifiedExplicitConstructorInvocation" | "qualifiedExplicitConstructorInvocation" | "enumDeclaration" | "enumBody" | "enumConstantList" | "enumConstant" | "enumConstantModifier" | "enumBodyDeclarations" | "recordDeclaration" | "recordHeader" | "recordComponentList" | "recordComponent" | "variableArityRecordComponent" | "recordComponentModifier" | "recordBody" | "recordBodyDeclaration" | "compactConstructorDeclaration" | "isDims" | "expression" | "lambdaExpression" | "lambdaParameters" | "lambdaParametersWithBraces" | "lambdaParameterList" | "inferredLambdaParameterList" | "explicitLambdaParameterList" | "lambdaParameter" | "regularLambdaParameter" | "lambdaParameterType" | "lambdaBody" | "ternaryExpression" | "binaryExpression" | "unaryExpression" | "unaryExpressionNotPlusMinus" | "primary" | "primaryPrefix" | "primarySuffix" | "fqnOrRefType" | "fqnOrRefTypePartRest" | "fqnOrRefTypePartCommon" | "fqnOrRefTypePartFirst" | "parenthesisExpression" | "castExpression" | "primitiveCastExpression" | "referenceTypeCastExpression" | "newExpression" | "unqualifiedClassInstanceCreationExpression" | "classOrInterfaceTypeToInstantiate" | "typeArgumentsOrDiamond" | "diamond" | "methodInvocationSuffix" | "argumentList" | "arrayCreationExpression" | "arrayCreationDefaultInitSuffix" | "arrayCreationExplicitInitSuffix" | "dimExprs" | "dimExpr" | "classLiteralSuffix" | "arrayAccessSuffix" | "methodReferenceSuffix" | "pattern" | "typePattern" | "recordPattern" | "componentPatternList" | "componentPattern" | "unnamedPattern" | "guard" | "isRefTypeInMethodRef" | "interfaceDeclaration" | "normalInterfaceDeclaration" | "interfaceModifier" | "extendsInterfaces" | "interfacePermits" | "interfaceBody" | "interfaceMemberDeclaration" | "constantDeclaration" | "constantModifier" | "interfaceMethodDeclaration" | "interfaceMethodModifier" | "annotationTypeDeclaration" | "annotationTypeBody" | "annotationTypeMemberDeclaration" | "annotationTypeElementDeclaration" | "annotationTypeElementModifier" | "defaultValue" | "annotation" | "elementValuePairList" | "elementValuePair" | "elementValue" | "elementValueArrayInitializer" | "elementValueList" | "literal" | "integerLiteral" | "floatingPointLiteral" | "booleanLiteral" | "moduleName" | "packageName" | "typeName" | "expressionName" | "methodName" | "packageOrTypeName" | "ambiguousName" | "compilationUnit" | "ordinaryCompilationUnit" | "modularCompilationUnit" | "packageDeclaration" | "packageModifier" | "importDeclaration" | "typeDeclaration" | "moduleDeclaration" | "moduleDirective" | "requiresModuleDirective" | "exportsModuleDirective" | "opensModuleDirective" | "usesModuleDirective" | "providesModuleDirective" | "requiresModifier" | "primitiveType" | "numericType" | "integralType" | "floatingPointType" | "referenceType" | "classOrInterfaceType" | "classType" | "interfaceType" | "typeVariable" | "dims" | "typeParameter" | "typeParameterModifier" | "typeBound" | "additionalBound" | "typeArguments" | "typeArgumentList" | "typeArgument" | "wildcard" | "wildcardBounds";
|
|
12
|
+
}
|
|
13
|
+
export declare const options: {
|
|
14
|
+
readonly embeddedJavaIdentifiers: {
|
|
15
|
+
readonly category: "Embed";
|
|
16
|
+
readonly type: "string";
|
|
17
|
+
readonly array: true;
|
|
18
|
+
readonly default: [{
|
|
19
|
+
readonly value: ["java"];
|
|
20
|
+
}];
|
|
21
|
+
readonly description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Java language. This option requires the `prettier-plugin-java` plugin.";
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
type Options = typeof options;
|
|
25
|
+
declare module "../types.js" {
|
|
26
|
+
interface EmbeddedOptions extends Options {
|
|
27
|
+
}
|
|
28
|
+
interface EmbeddedDefaultIdentifiersHolder extends DefaultIdentifiersHolder {
|
|
29
|
+
}
|
|
30
|
+
interface PrettierPluginEmbedOptions {
|
|
31
|
+
[EMBEDDED_LANGUAGE_IDENTIFIERS]?: Identifiers;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
declare module "prettier" {
|
|
35
|
+
interface Options extends PrettierPluginDepsOptions {
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Options } from "prettier";
|
|
2
|
+
import type { Embedder } from "../../types.js";
|
|
3
|
+
import { language } from "./language.js";
|
|
4
|
+
export declare const embedder: Embedder<Options>;
|
|
5
|
+
/**
|
|
6
|
+
* Register the embedder to the EmbeddedEmbedders
|
|
7
|
+
*/
|
|
8
|
+
declare module "../types.js" {
|
|
9
|
+
interface EmbeddedEmbedders {
|
|
10
|
+
[language]: typeof embedder;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type AutocompleteStringList, type StringListToInterfaceKey } from "../utils.js";
|
|
2
|
+
declare const DEFAULT_IDENTIFIERS: readonly ["jsonata"];
|
|
3
|
+
type Identifiers = AutocompleteStringList<typeof DEFAULT_IDENTIFIERS>;
|
|
4
|
+
type DefaultIdentifiersHolder = StringListToInterfaceKey<typeof DEFAULT_IDENTIFIERS>;
|
|
5
|
+
declare const EMBEDDED_LANGUAGE_IDENTIFIERS: "embeddedJsonataIdentifiers";
|
|
6
|
+
export interface PrettierPluginDepsOptions {
|
|
7
|
+
}
|
|
8
|
+
export declare const options: {
|
|
9
|
+
readonly embeddedJsonataIdentifiers: {
|
|
10
|
+
readonly category: "Embed";
|
|
11
|
+
readonly type: "string";
|
|
12
|
+
readonly array: true;
|
|
13
|
+
readonly default: [{
|
|
14
|
+
readonly value: ["jsonata"];
|
|
15
|
+
}];
|
|
16
|
+
readonly description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded JSONata language. This option requires the `@stedi/prettier-plugin-jsonata` plugin.";
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
type Options = typeof options;
|
|
20
|
+
declare module "../types.js" {
|
|
21
|
+
interface EmbeddedOptions extends Options {
|
|
22
|
+
}
|
|
23
|
+
interface EmbeddedDefaultIdentifiersHolder extends DefaultIdentifiersHolder {
|
|
24
|
+
}
|
|
25
|
+
interface PrettierPluginEmbedOptions {
|
|
26
|
+
[EMBEDDED_LANGUAGE_IDENTIFIERS]?: Identifiers;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
declare module "prettier" {
|
|
30
|
+
interface Options extends PrettierPluginDepsOptions {
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -8,7 +8,10 @@ import { type AutocompleteStringList, type StringListToInterfaceKey } from "../u
|
|
|
8
8
|
declare const DEFAULT_IDENTIFIERS: readonly ["md", "markdown"];
|
|
9
9
|
type Identifiers = AutocompleteStringList<typeof DEFAULT_IDENTIFIERS>;
|
|
10
10
|
type DefaultIdentifiersHolder = StringListToInterfaceKey<typeof DEFAULT_IDENTIFIERS>;
|
|
11
|
+
declare const MARKDOWN_PARSERS: readonly ["markdown", "mdx", "remark"];
|
|
12
|
+
type MarkdownParser = (typeof MARKDOWN_PARSERS)[number];
|
|
11
13
|
declare const EMBEDDED_LANGUAGE_IDENTIFIERS: "embeddedMarkdownIdentifiers";
|
|
14
|
+
declare const EMBEDDED_LANGUAGE_PARSER: "embeddedMarkdownParser";
|
|
12
15
|
export interface PrettierPluginDepsOptions {
|
|
13
16
|
__inJsTemplate?: boolean;
|
|
14
17
|
}
|
|
@@ -22,6 +25,16 @@ export declare const options: {
|
|
|
22
25
|
}];
|
|
23
26
|
readonly description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Markdown language.";
|
|
24
27
|
};
|
|
28
|
+
readonly embeddedMarkdownParser: {
|
|
29
|
+
category: string;
|
|
30
|
+
type: "choice";
|
|
31
|
+
default: "markdown";
|
|
32
|
+
description: string;
|
|
33
|
+
choices: {
|
|
34
|
+
value: "markdown" | "mdx" | "remark";
|
|
35
|
+
description: string;
|
|
36
|
+
}[];
|
|
37
|
+
};
|
|
25
38
|
};
|
|
26
39
|
type Options = typeof options;
|
|
27
40
|
declare module "../types.js" {
|
|
@@ -31,6 +44,7 @@ declare module "../types.js" {
|
|
|
31
44
|
}
|
|
32
45
|
interface PrettierPluginEmbedOptions {
|
|
33
46
|
[EMBEDDED_LANGUAGE_IDENTIFIERS]?: Identifiers;
|
|
47
|
+
[EMBEDDED_LANGUAGE_PARSER]?: MarkdownParser;
|
|
34
48
|
}
|
|
35
49
|
}
|
|
36
50
|
declare module "prettier" {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Options } from "prettier";
|
|
2
|
+
import type { Embedder } from "../../types.js";
|
|
3
|
+
import { language } from "./language.js";
|
|
4
|
+
export declare const embedder: Embedder<Options>;
|
|
5
|
+
/**
|
|
6
|
+
* Register the embedder to the EmbeddedEmbedders
|
|
7
|
+
*/
|
|
8
|
+
declare module "../types.js" {
|
|
9
|
+
interface EmbeddedEmbedders {
|
|
10
|
+
[language]: typeof embedder;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { NginxOptions } from "prettier-plugin-nginx";
|
|
2
|
+
import { type AutocompleteStringList, type StringListToInterfaceKey, type UnionToIntersection } from "../utils.js";
|
|
3
|
+
declare const DEFAULT_IDENTIFIERS: readonly ["nginx"];
|
|
4
|
+
type Identifiers = AutocompleteStringList<typeof DEFAULT_IDENTIFIERS>;
|
|
5
|
+
type DefaultIdentifiersHolder = StringListToInterfaceKey<typeof DEFAULT_IDENTIFIERS>;
|
|
6
|
+
declare const EMBEDDED_LANGUAGE_IDENTIFIERS: "embeddedNginxIdentifiers";
|
|
7
|
+
export interface PrettierPluginDepsOptions extends Partial<UnionToIntersection<NginxOptions>> {
|
|
8
|
+
}
|
|
9
|
+
export declare const options: {
|
|
10
|
+
readonly embeddedNginxIdentifiers: {
|
|
11
|
+
readonly category: "Embed";
|
|
12
|
+
readonly type: "string";
|
|
13
|
+
readonly array: true;
|
|
14
|
+
readonly default: [{
|
|
15
|
+
readonly value: ["nginx"];
|
|
16
|
+
}];
|
|
17
|
+
readonly description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded NGINX language. This option requires the `prettier-plugin-nginx` plugin.";
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
type Options = typeof options;
|
|
21
|
+
declare module "../types.js" {
|
|
22
|
+
interface EmbeddedOptions extends Options {
|
|
23
|
+
}
|
|
24
|
+
interface EmbeddedDefaultIdentifiersHolder extends DefaultIdentifiersHolder {
|
|
25
|
+
}
|
|
26
|
+
interface PrettierPluginEmbedOptions {
|
|
27
|
+
[EMBEDDED_LANGUAGE_IDENTIFIERS]?: Identifiers;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
declare module "prettier" {
|
|
31
|
+
interface Options extends PrettierPluginDepsOptions {
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Options } from "prettier";
|
|
2
|
+
import type { Embedder } from "../../types.js";
|
|
3
|
+
import { language } from "./language.js";
|
|
4
|
+
export declare const embedder: Embedder<Options>;
|
|
5
|
+
/**
|
|
6
|
+
* Register the embedder to the EmbeddedEmbedders
|
|
7
|
+
*/
|
|
8
|
+
declare module "../types.js" {
|
|
9
|
+
interface EmbeddedEmbedders {
|
|
10
|
+
[language]: typeof embedder;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { EsParser } from "../es/options.js";
|
|
2
|
+
import type { TsParser } from "../ts/options.js";
|
|
3
|
+
import { type AutocompleteStringList, type StringListToInterfaceKey } from "../utils.js";
|
|
4
|
+
declare const DEFAULT_IDENTIFIERS: readonly ["pegjs", "peggy", "peg"];
|
|
5
|
+
type Identifiers = AutocompleteStringList<typeof DEFAULT_IDENTIFIERS>;
|
|
6
|
+
type DefaultIdentifiersHolder = StringListToInterfaceKey<typeof DEFAULT_IDENTIFIERS>;
|
|
7
|
+
declare const EMBEDDED_LANGUAGE_IDENTIFIERS: "embeddedPegjsIdentifiers";
|
|
8
|
+
export interface PrettierPluginDepsOptions {
|
|
9
|
+
actionParser?: EsParser | TsParser;
|
|
10
|
+
}
|
|
11
|
+
export declare const options: {
|
|
12
|
+
readonly embeddedPegjsIdentifiers: {
|
|
13
|
+
readonly category: "Embed";
|
|
14
|
+
readonly type: "string";
|
|
15
|
+
readonly array: true;
|
|
16
|
+
readonly default: [{
|
|
17
|
+
readonly value: ["pegjs", "peggy", "peg"];
|
|
18
|
+
}];
|
|
19
|
+
readonly description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Pegjs language. This option requires the `prettier-plugin-pegjs` plugin.";
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
type Options = typeof options;
|
|
23
|
+
declare module "../types.js" {
|
|
24
|
+
interface EmbeddedOptions extends Options {
|
|
25
|
+
}
|
|
26
|
+
interface EmbeddedDefaultIdentifiersHolder extends DefaultIdentifiersHolder {
|
|
27
|
+
}
|
|
28
|
+
interface PrettierPluginEmbedOptions {
|
|
29
|
+
[EMBEDDED_LANGUAGE_IDENTIFIERS]?: Identifiers;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
declare module "prettier" {
|
|
33
|
+
interface Options extends PrettierPluginDepsOptions {
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Options } from "prettier";
|
|
2
|
+
import type { Embedder } from "../../types.js";
|
|
3
|
+
import { language } from "./language.js";
|
|
4
|
+
export declare const embedder: Embedder<Options>;
|
|
5
|
+
/**
|
|
6
|
+
* Register the embedder to the EmbeddedEmbedders
|
|
7
|
+
*/
|
|
8
|
+
declare module "../types.js" {
|
|
9
|
+
interface EmbeddedEmbedders {
|
|
10
|
+
[language]: typeof embedder;
|
|
11
|
+
}
|
|
12
|
+
}
|