prettier-plugin-embed 0.4.7 → 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 +56 -0
- package/dist/embedded/css/language.d.ts +1 -1
- 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/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 +23 -17
- 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 +1275 -1043
- package/dist/options.d.ts +73 -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)
|
|
@@ -204,6 +210,14 @@ If you want to specify different parsers for different identifiers, check [`embe
|
|
|
204
210
|
|
|
205
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.
|
|
206
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
|
+
|
|
207
221
|
#### JSON
|
|
208
222
|
|
|
209
223
|
| Option | Type | Default | Description |
|
|
@@ -215,6 +229,14 @@ Formatting embedded JSON language doesn't require other plugins and uses the par
|
|
|
215
229
|
|
|
216
230
|
If you want to specify different parsers for different identifiers, check [`embeddedOverrides`](#embeddedoverrides).
|
|
217
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
|
+
|
|
218
240
|
#### LaTeX
|
|
219
241
|
|
|
220
242
|
| Option | Type | Default | Description |
|
|
@@ -238,6 +260,24 @@ If you want to specify different parsers for different identifiers, check [`embe
|
|
|
238
260
|
|
|
239
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).
|
|
240
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
|
+
|
|
241
281
|
#### PHP
|
|
242
282
|
|
|
243
283
|
| Option | Type | Default | Description |
|
|
@@ -246,6 +286,14 @@ The `remark` parser is [an alias of the `markdown` parser](https://github.com/pr
|
|
|
246
286
|
|
|
247
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.
|
|
248
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
|
+
|
|
249
297
|
#### Properties
|
|
250
298
|
|
|
251
299
|
| Option | Type | Default | Description |
|
|
@@ -254,6 +302,14 @@ Formatting embedded PHP language requires the [`@prettier/plugin-php`](https://g
|
|
|
254
302
|
|
|
255
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.
|
|
256
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
|
+
|
|
257
313
|
#### Ruby
|
|
258
314
|
|
|
259
315
|
| Option | Type | Default | Description |
|
|
@@ -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 {};
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type AutocompleteStringList, type StringListToInterfaceKey } from "../utils.js";
|
|
2
|
+
declare const DEFAULT_IDENTIFIERS: readonly ["prisma"];
|
|
3
|
+
type Identifiers = AutocompleteStringList<typeof DEFAULT_IDENTIFIERS>;
|
|
4
|
+
type DefaultIdentifiersHolder = StringListToInterfaceKey<typeof DEFAULT_IDENTIFIERS>;
|
|
5
|
+
declare const EMBEDDED_LANGUAGE_IDENTIFIERS: "embeddedPrismaIdentifiers";
|
|
6
|
+
export interface PrettierPluginDepsOptions {
|
|
7
|
+
}
|
|
8
|
+
export declare const options: {
|
|
9
|
+
readonly embeddedPrismaIdentifiers: {
|
|
10
|
+
readonly category: "Embed";
|
|
11
|
+
readonly type: "string";
|
|
12
|
+
readonly array: true;
|
|
13
|
+
readonly default: [{
|
|
14
|
+
readonly value: ["prisma"];
|
|
15
|
+
}];
|
|
16
|
+
readonly description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Prisma language. This option requires the `prettier-plugin-prisma` 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 {};
|
|
@@ -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
|
+
}
|