File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import type { Plugin , Printer } from 'prettier' ;
1+ import type { Plugin } from 'prettier' ;
22
33import { languages } from './languages.js' ;
44import { options } from './options.js' ;
55import { parsers } from './parsers.js' ;
6- import { printer } from './print/index.js' ;
7- import { type NodeType , PRINTER_NAME } from './utils/index.js' ;
8-
9- const printers : Record < string , Printer < NodeType > > = {
10- [ PRINTER_NAME ] : printer ,
11- } ;
6+ import { printers } from './printers.js' ;
7+ import type { NodeType } from './utils/index.js' ;
128
139const plugin : Plugin < NodeType > = {
1410 languages,
Original file line number Diff line number Diff line change @@ -18,18 +18,6 @@ const templateExportDefault: BooleanSupportOption = {
1818 type : 'boolean' ,
1919} ;
2020
21- /**
22- * Extracts a valid `templateSingleQuote` option out of the provided options. If
23- * `templateSingleQuote` is defined, it will be used, otherwise the value for
24- * `singleQuote` will be inherited.
25- */
26- export function getTemplateSingleQuote ( options : PluginOptions ) : boolean {
27- const { singleQuote, templateSingleQuote } = options ;
28- return typeof templateSingleQuote === 'boolean'
29- ? templateSingleQuote
30- : singleQuote ;
31- }
32-
3321const templateSingleQuote : BooleanSupportOption = {
3422 category : 'Format' ,
3523 description :
Original file line number Diff line number Diff line change 1+ import type { Printer } from 'prettier' ;
2+
3+ import { printer } from './printers/index.js' ;
4+ import { type NodeType , PRINTER_NAME } from './utils/index.js' ;
5+
6+ export const printers : Record < string , Printer < NodeType > > = {
7+ [ PRINTER_NAME ] : printer ,
8+ } ;
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import type { Options as PrettierOptions } from 'prettier';
22import { doc } from 'prettier' ;
33
44import type { PluginOptions } from '../options.js' ;
5- import { getTemplateSingleQuote } from '../options.js' ;
65import { flattenDoc } from '../utils/doc.js' ;
76import { TEMPLATE_TAG_CLOSE , TEMPLATE_TAG_OPEN } from '../utils/index.js' ;
87
@@ -30,7 +29,7 @@ export async function printTemplateContent(
3029 return await textToDoc ( text . trim ( ) , {
3130 ...options ,
3231 parser : 'glimmer' ,
33- singleQuote : getTemplateSingleQuote ( options ) ,
32+ singleQuote : options . templateSingleQuote ?? options . singleQuote ,
3433 } ) ;
3534}
3635
You can’t perform that action at this time.
0 commit comments