Repository navigation
v0.6.0
Minor Changes
-
Support regular expression strings in
embedded<Language>Tagsfor simple and member-expression tags. Apply per-tagembeddedOverridesto the configured pattern that matches.Match
queryanddb.querywith one pattern and applysingleQuoteto their embedded JavaScript:// prettier.config.mjs export default { plugins: ["prettier-plugin-embed"], embeddedEsTags: ["/query$/i"], embeddedOverrides: JSON.stringify([ { tags: ["/query$/i"], options: { singleQuote: true } }, ]), };
Output comparison (
-:0.5.1;+: this release):-const first = query`const message="hello"`; -const second = db.query`const message="hello"`; +const first = query`const message = 'hello';`; +const second = db.query`const message = 'hello';`;
-
Fix line breaks and indentation around SQL interpolations, including nested templates and JavaScript comments. Preserve source line breaks before interpolations with
prettier-plugin-sqland follow the formatted layout withprettier-plugin-sql-cst.With
prettier-plugin-sql, preserve the input line break before${condition}:const query = sql` SELECT * FROM users WHERE id = ${id} ${condition} `;
Output comparison (
-:0.5.1;+: this release):const query = sql` SELECT * FROM users WHERE - id = ${id} ${condition} + id = ${id} + ${condition} `; -
Keep embedded XML documents and fragments compatible with the consumer's
@prettier/plugin-xml, including plugin objects exported by shared configuration packages. -
Load JavaScript and TypeScript
embeddedOverrideswith the active Node.js or Bun runtime and consumer-enabled module hooks. Use a consumer-installedtsxwhen additional TypeScript loading or transformation support is needed. -
Reuse loaded
embeddedOverrideswithin each formatting context and match each template's tag or comment independently. Reflect edits to override modules and their imported dependencies in subsequent calls, and report invalid modules with their original diagnostics. -
Resolve relative
embeddedOverridespaths from the current Prettier configuration afterprettier.clearConfigCache(). -
Reduce installed dependencies and keep the dependency tree compatible with Node.js 18.
-
List supported languages with their default identifiers, and document tag patterns and JavaScript and TypeScript override configuration.