Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dollar sign ($) issue in Vue SFC #101

Merged
merged 1 commit into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/preprocessors/vue.ts
Expand Up @@ -84,6 +84,6 @@ function sortScript(

return code.replace(
content,
`\n${preprocessor(content, adjustedOptions)}\n`,
() => `\n${preprocessor(content, adjustedOptions)}\n`,
);
}
8 changes: 8 additions & 0 deletions tests/Vue/__snapshots__/ppsi.spec.ts.snap
Expand Up @@ -149,6 +149,10 @@ import { defineComponent } from 'vue'
function add(a,b) {
return a + b;
}

const number = 500;
const dollarSign = '$';
const dollarPrefixed =\`\\$\${number}\`;
</script>

<template>
Expand Down Expand Up @@ -179,6 +183,10 @@ import sameLevelRelativePath from "./sameLevelRelativePath";
function add(a, b) {
return a + b;
}

const number = 500;
const dollarSign = "$";
const dollarPrefixed = \`\\$\${number}\`;
</script>

<template>
Expand Down
4 changes: 4 additions & 0 deletions tests/Vue/setup.vue
Expand Up @@ -17,6 +17,10 @@ import { defineComponent } from 'vue'
function add(a,b) {
return a + b;
}

const number = 500;
const dollarSign = '$';
const dollarPrefixed =`\$${number}`;
</script>

<template>
Expand Down