Skip to content

Commit 6d65af0

Browse files
committed
revert formatting workaround
1 parent 2c88177 commit 6d65af0

2 files changed

Lines changed: 9 additions & 15 deletions

File tree

src/livecodes/formatter/format.worker.ts

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -116,20 +116,14 @@ const format = async (
116116
singleQuote: formatterConfig.singleQuote ?? defaultConfig.singleQuote,
117117
trailingComma: formatterConfig.trailingComma === false ? 'none' : 'all',
118118
};
119-
const formatted = await (self as any).prettier.formatWithCursor(value, {
120-
parser: parser?.name,
121-
plugins: prettierPlugins,
122-
cursorOffset,
123-
...options,
124-
});
125-
126-
// TODO: remove when ripple plugin is fixed
127-
if (formatted && language === 'ripple') {
128-
formatted.formatted = formatted.formatted.replace(/,?\[object Object\],?/g, '');
129-
if (formatted.cursorOffset < 1) formatted.cursorOffset = 1;
130-
}
131-
132-
return formatted || unFormatted;
119+
return (
120+
(await (self as any).prettier.formatWithCursor(value, {
121+
parser: parser?.name,
122+
plugins: prettierPlugins,
123+
cursorOffset,
124+
...options,
125+
})) || unFormatted
126+
);
133127
}
134128
if (getFormatter(language) != null) {
135129
const formatFn = loadFormatter(language);

src/livecodes/vendors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ export const postcssImportUrlUrl = /* @__PURE__ */ getUrl(
344344
export const prettierBaseUrl = /* @__PURE__ */ getUrl('prettier@3.3.2/');
345345

346346
export const prettierRippleUrl = /* @__PURE__ */ getUrl(
347-
'@hatemhosny/prettier-plugin-ripple@0.0.5/build/parser-ripple.js',
347+
'@hatemhosny/prettier-plugin-ripple@0.0.6/build/parser-ripple.js',
348348
);
349349

350350
export const prettierPhpUrl = /* @__PURE__ */ getUrl('@prettier/plugin-php@0.22.2/standalone.js');

0 commit comments

Comments
 (0)