Description
Describe the bug
Writing a dollar sign '$' in code followed immediately by certain symbols (in my case I've confirmed it with '#' and '@') throws an invalid character error.
To Reproduce
Try setting a variable to the string "$#" in a Typescript enabled Sveltekit page and attempt to build the project or run dev and navigate to the respective page.
Here is a repo example: https://github.com/evan-sheehan/svelte-preprocess-bug
I used the "npm init svelte@next" command according to Sveltekit documentation and started a project using the demo template with Typescript but no Eslint and no Prettier.
Expected behavior
An error should not be thrown when svelte-preprocess parses '$#' in the context of a string or comment.
Information about your project:
- Chrome Version 96.0.4664.45 (Official Build) (64-bit)
- Zorin 16 - Ubuntu 20.04. 3 LTS
- Svelte-preprocess anything 4.9.0 and after as far as I've tested.
- Using Sveltekit so Vite and Rollup are used internally.
Seems related to #402 but not exactly the same.