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.
Files changed (53) hide show
  1. package/README.md +56 -0
  2. package/dist/embedded/css/language.d.ts +1 -1
  3. package/dist/embedded/es/language.d.ts +1 -1
  4. package/dist/embedded/es/options.d.ts +1 -1
  5. package/dist/embedded/glsl/language.d.ts +1 -1
  6. package/dist/embedded/graphql/language.d.ts +1 -1
  7. package/dist/embedded/html/language.d.ts +1 -1
  8. package/dist/embedded/ini/language.d.ts +1 -1
  9. package/dist/embedded/java/embedder.d.ts +12 -0
  10. package/dist/embedded/java/index.d.ts +3 -0
  11. package/dist/embedded/java/language.d.ts +9 -0
  12. package/dist/embedded/java/options.d.ts +38 -0
  13. package/dist/embedded/json/language.d.ts +1 -1
  14. package/dist/embedded/jsonata/embedder.d.ts +12 -0
  15. package/dist/embedded/jsonata/index.d.ts +3 -0
  16. package/dist/embedded/jsonata/language.d.ts +9 -0
  17. package/dist/embedded/jsonata/options.d.ts +33 -0
  18. package/dist/embedded/latex/language.d.ts +1 -1
  19. package/dist/embedded/markdown/language.d.ts +1 -1
  20. package/dist/embedded/nginx/embedder.d.ts +12 -0
  21. package/dist/embedded/nginx/index.d.ts +3 -0
  22. package/dist/embedded/nginx/language.d.ts +9 -0
  23. package/dist/embedded/nginx/options.d.ts +34 -0
  24. package/dist/embedded/noop/language.d.ts +1 -1
  25. package/dist/embedded/pegjs/embedder.d.ts +12 -0
  26. package/dist/embedded/pegjs/index.d.ts +3 -0
  27. package/dist/embedded/pegjs/language.d.ts +9 -0
  28. package/dist/embedded/pegjs/options.d.ts +36 -0
  29. package/dist/embedded/php/language.d.ts +1 -1
  30. package/dist/embedded/prisma/embedder.d.ts +12 -0
  31. package/dist/embedded/prisma/index.d.ts +3 -0
  32. package/dist/embedded/prisma/language.d.ts +9 -0
  33. package/dist/embedded/prisma/options.d.ts +33 -0
  34. package/dist/embedded/properties/language.d.ts +1 -1
  35. package/dist/embedded/pug/embedder.d.ts +12 -0
  36. package/dist/embedded/pug/index.d.ts +3 -0
  37. package/dist/embedded/pug/language.d.ts +9 -0
  38. package/dist/embedded/pug/options.d.ts +60 -0
  39. package/dist/embedded/register.d.ts +23 -17
  40. package/dist/embedded/ruby/language.d.ts +1 -1
  41. package/dist/embedded/sh/language.d.ts +1 -1
  42. package/dist/embedded/sql/language.d.ts +1 -1
  43. package/dist/embedded/toml/language.d.ts +1 -1
  44. package/dist/embedded/ts/language.d.ts +1 -1
  45. package/dist/embedded/ts/options.d.ts +1 -1
  46. package/dist/embedded/utils.d.ts +2 -2
  47. package/dist/embedded/xml/language.d.ts +1 -1
  48. package/dist/embedded/yaml/language.d.ts +1 -1
  49. package/dist/index.js +1275 -1043
  50. package/dist/options.d.ts +73 -19
  51. package/dist/types.d.ts +1 -1
  52. package/dist/utils.d.ts +1 -1
  53. package/package.json +19 -9
package/dist/options.d.ts CHANGED
@@ -142,6 +142,15 @@ export declare const options: {
142
142
  }];
143
143
  readonly description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded INI language. This option requires the `prettier-plugin-ini` plugin.";
144
144
  };
145
+ readonly embeddedJavaIdentifiers: {
146
+ readonly category: "Embed";
147
+ readonly type: "string";
148
+ readonly array: true;
149
+ readonly default: [{
150
+ readonly value: ["java"];
151
+ }];
152
+ 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.";
153
+ };
145
154
  readonly embeddedJsonIdentifiers: {
146
155
  readonly category: "Embed";
147
156
  readonly type: "string";
@@ -161,6 +170,15 @@ export declare const options: {
161
170
  description: string;
162
171
  }[];
163
172
  };
173
+ readonly embeddedJsonataIdentifiers: {
174
+ readonly category: "Embed";
175
+ readonly type: "string";
176
+ readonly array: true;
177
+ readonly default: [{
178
+ readonly value: ["jsonata"];
179
+ }];
180
+ 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.";
181
+ };
164
182
  readonly embeddedLatexIdentifiers: {
165
183
  readonly category: "Embed";
166
184
  readonly type: "string";
@@ -189,6 +207,43 @@ export declare const options: {
189
207
  description: string;
190
208
  }[];
191
209
  };
210
+ readonly embeddedNginxIdentifiers: {
211
+ readonly category: "Embed";
212
+ readonly type: "string";
213
+ readonly array: true;
214
+ readonly default: [{
215
+ readonly value: ["nginx"];
216
+ }];
217
+ 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.";
218
+ };
219
+ readonly embeddedTsIdentifiers: {
220
+ readonly category: "Embed";
221
+ readonly type: "string";
222
+ readonly array: true;
223
+ readonly default: [{
224
+ readonly value: ["ts", "tsx", "cts", "mts", "typescript"];
225
+ }];
226
+ readonly description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded TypeScript language.";
227
+ };
228
+ readonly embeddedTsParser: {
229
+ category: string;
230
+ type: "choice";
231
+ default: "typescript";
232
+ description: string;
233
+ choices: {
234
+ value: "typescript" | "babel-ts";
235
+ description: string;
236
+ }[];
237
+ };
238
+ readonly embeddedPegjsIdentifiers: {
239
+ readonly category: "Embed";
240
+ readonly type: "string";
241
+ readonly array: true;
242
+ readonly default: [{
243
+ readonly value: ["pegjs", "peggy", "peg"];
244
+ }];
245
+ 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.";
246
+ };
192
247
  readonly embeddedPhpIdentifiers: {
193
248
  readonly category: "Embed";
194
249
  readonly type: "string";
@@ -198,6 +253,15 @@ export declare const options: {
198
253
  }];
199
254
  readonly description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded PHP language. This option requires the `@prettier/plugin-php` plugin.";
200
255
  };
256
+ readonly embeddedPrismaIdentifiers: {
257
+ readonly category: "Embed";
258
+ readonly type: "string";
259
+ readonly array: true;
260
+ readonly default: [{
261
+ readonly value: ["prisma"];
262
+ }];
263
+ 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.";
264
+ };
201
265
  readonly embeddedPropertiesIdentifiers: {
202
266
  readonly category: "Embed";
203
267
  readonly type: "string";
@@ -207,6 +271,15 @@ export declare const options: {
207
271
  }];
208
272
  readonly description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Properties language. This option requires the `prettier-plugin-properties` plugin.";
209
273
  };
274
+ readonly embeddedPugIdentifiers: {
275
+ readonly category: "Embed";
276
+ readonly type: "string";
277
+ readonly array: true;
278
+ readonly default: [{
279
+ readonly value: ["pug", "jade"];
280
+ }];
281
+ readonly description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Pug language. This option requires the `@prettier/plugin-pug` plugin.";
282
+ };
210
283
  readonly embeddedRubyIdentifiers: {
211
284
  readonly category: "Embed";
212
285
  readonly type: "string";
@@ -273,25 +346,6 @@ export declare const options: {
273
346
  }];
274
347
  readonly description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded TOML language. This option requires the `prettier-plugin-toml` plugin.";
275
348
  };
276
- readonly embeddedTsIdentifiers: {
277
- readonly category: "Embed";
278
- readonly type: "string";
279
- readonly array: true;
280
- readonly default: [{
281
- readonly value: ["ts", "tsx", "cts", "mts", "typescript"];
282
- }];
283
- readonly description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded TypeScript language.";
284
- };
285
- readonly embeddedTsParser: {
286
- category: string;
287
- type: "choice";
288
- default: "typescript";
289
- description: string;
290
- choices: {
291
- value: "typescript" | "babel-ts";
292
- description: string;
293
- }[];
294
- };
295
349
  readonly embeddedXmlIdentifiers: {
296
350
  readonly category: "Embed";
297
351
  readonly type: "string";
package/dist/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { TemplateLiteral } from "estree";
2
2
  import type { AstPath, Doc, Options } from "prettier";
3
- import { makeIdentifiersOptionName, type AutocompleteStringList, type EmbeddedDefaultIdentifier, type EmbeddedLanguage, type PrettierPluginEmbedOptions } from "./embedded/index.js";
3
+ import { type AutocompleteStringList, type EmbeddedDefaultIdentifier, type EmbeddedLanguage, type PrettierPluginEmbedOptions, makeIdentifiersOptionName } from "./embedded/index.js";
4
4
  import type { PrettierPluginGlobalOptions } from "./options.js";
5
5
  import { RemoveIndex } from "./utils.js";
6
6
  declare module "estree" {
package/dist/utils.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { Node } from "estree";
2
2
  import { type AstPath, type Options } from "prettier";
3
- export declare const resolveEmbeddedOverrideOptions: (embeddedOverridesString: string | undefined, identifier: string, sourceFilePath?: string) => Promise<Omit<Omit<RemoveIndex<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>;
3
+ export declare const resolveEmbeddedOverrideOptions: (embeddedOverridesString: string | undefined, identifier: string, sourceFilePath?: string) => Promise<Omit<Omit<RemoveIndex<Options>, keyof import("./index.js").PrettierPluginEmbedOptions> & Omit<import("./index.js").PrettierPluginEmbedOptions, "embeddedNoopIdentifiers" | "embeddedCssIdentifiers" | "embeddedEsIdentifiers" | "embeddedGlslIdentifiers" | "embeddedGraphqlIdentifiers" | "embeddedHtmlIdentifiers" | "embeddedIniIdentifiers" | "embeddedJavaIdentifiers" | "embeddedJsonIdentifiers" | "embeddedJsonataIdentifiers" | "embeddedLatexIdentifiers" | "embeddedMarkdownIdentifiers" | "embeddedNginxIdentifiers" | "embeddedTsIdentifiers" | "embeddedPegjsIdentifiers" | "embeddedPhpIdentifiers" | "embeddedPrismaIdentifiers" | "embeddedPropertiesIdentifiers" | "embeddedPugIdentifiers" | "embeddedRubyIdentifiers" | "embeddedShIdentifiers" | "embeddedSqlIdentifiers" | "embeddedTomlIdentifiers" | "embeddedXmlIdentifiers" | "embeddedYamlIdentifiers" | keyof import("./options.js").PrettierPluginGlobalOptions>, "parser" | "filepath" | "endOfLine" | "embeddedLanguageFormatting" | "printWidth" | "tabWidth" | "useTabs" | `__${string}`> | undefined>;
4
4
  export declare function getIdentifierFromComment({ node, parent }: AstPath<Node>, comments: string[], options: Options): string | undefined;
5
5
  export declare function getIdentifierFromTag({ node, parent }: AstPath<Node>, tags: string[], options: Options): string | undefined;
6
6
  export type RemoveIndex<T> = {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "prettier-plugin-embed",
3
3
  "description": "A configurable Prettier plugin to format embedded languages in js/ts files.",
4
4
  "private": false,
5
- "version": "0.4.7",
5
+ "version": "0.4.8",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "./dist"
@@ -42,11 +42,14 @@
42
42
  "access": "public"
43
43
  },
44
44
  "scripts": {
45
+ "prepare": "husky install",
46
+ "bump": "bumpp",
45
47
  "dev": "vite",
46
- "lint": "eslint . --ext .ts",
48
+ "lint": "biome lint .",
47
49
  "type-check": "tsc --noEmit --emitDeclarationOnly false",
48
- "format": "prettier . --write",
49
- "prebuild": "npm run lint && npm run type-check && npm run format",
50
+ "format": "biome format . --write",
51
+ "check": "biome check --apply .",
52
+ "prebuild": "npm run check && npm run type-check",
50
53
  "build": "vite build",
51
54
  "add-glob-import-types": "tsx ./scripts/add-glob-import-types.ts",
52
55
  "postbuild": "tsc --project ./tsconfig.production.json && npm run add-glob-import-types",
@@ -61,37 +64,44 @@
61
64
  "postncu": "npm i"
62
65
  },
63
66
  "devDependencies": {
67
+ "@biomejs/biome": "1.5.2",
64
68
  "@commitlint/cli": "^18.4.4",
65
69
  "@commitlint/config-conventional": "^18.4.4",
66
70
  "@prettier/plugin-php": "^0.22.1",
71
+ "@prettier/plugin-pug": "^3.0.0",
67
72
  "@prettier/plugin-ruby": "^4.0.4",
68
73
  "@prettier/plugin-xml": "^3.2.2",
74
+ "@stedi/prettier-plugin-jsonata": "^2.1.1",
69
75
  "@types/estree": "^1.0.5",
70
76
  "@types/node": "^20.11.5",
71
- "@typescript-eslint/eslint-plugin": "^6.19.0",
72
- "@typescript-eslint/parser": "^6.19.0",
73
77
  "@vitest/coverage-istanbul": "^1.2.1",
74
78
  "@vitest/ui": "^1.2.1",
75
79
  "@xml-tools/parser": "^1.0.11",
80
+ "bumpp": "^9.3.0",
76
81
  "chevrotain": "7.1.1",
77
82
  "esbuild": "^0.19.11",
78
- "eslint": "^8.56.0",
79
83
  "fast-glob": "^3.3.2",
84
+ "husky": "^8.0.3",
85
+ "lint-staged": "^15.2.0",
80
86
  "npm-check-updates": "^16.14.12",
81
87
  "prettier": "^3.2.4",
82
88
  "prettier-plugin-glsl": "^0.1.3",
83
89
  "prettier-plugin-ini": "^1.1.0",
90
+ "prettier-plugin-java": "^2.5.0",
84
91
  "prettier-plugin-jsdoc": "^1.3.0",
85
92
  "prettier-plugin-latex": "^2.0.1",
93
+ "prettier-plugin-nginx": "^1.0.3",
86
94
  "prettier-plugin-organize-imports": "^3.2.4",
95
+ "prettier-plugin-pegjs": "^2.0.2",
96
+ "prettier-plugin-prisma": "^5.0.0",
87
97
  "prettier-plugin-properties": "^0.3.0",
88
- "prettier-plugin-sh": "^0.13.1",
98
+ "prettier-plugin-sh": "^0.14.0",
89
99
  "prettier-plugin-sql": "^0.18.0",
90
100
  "prettier-plugin-sql-cst": "^0.10.2",
91
101
  "prettier-plugin-toml": "^2.0.1",
92
102
  "tsx": "^4.7.0",
93
103
  "typescript": "^5.3.3",
94
- "vite": "^5.0.11",
104
+ "vite": "^5.0.12",
95
105
  "vitest": "^1.2.1"
96
106
  },
97
107
  "dependencies": {