diff --git a/src/index.ts b/src/index.ts index f3a8aa56..6a9f57b2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -483,12 +483,16 @@ export const plugin: Plugin = { useSemi = false; } let val = token.val; - val = format(val, { - parser: 'babel', - ...codeInterpolationOptions, - semi: useSemi, - endOfLine: 'lf' - }); + try { + val = format(val, { + parser: 'babel', + ...codeInterpolationOptions, + semi: useSemi, + endOfLine: 'lf' + }); + } catch (error) { + logger.warn(error); + } val = val.slice(0, -1); result += ` ${val}`; break;