-
Notifications
You must be signed in to change notification settings - Fork 121
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
SyntaxError: 'return' outside of function. when used with Astro #210
Comments
We are also experiencing this error. Astro supports early returns inside their script part ---
const { slug } = Astro.params
if (!slug) {
return new Response(null, { status: 404 })
}
--- In regular javascript top level return is not supported. |
I have this too, how to solve it? <script is:inline define:vars={{ defaultTheme: UI.theme }}>
if (window.basic_script) {
return;
} |
I also ran into this error trying to save some files. Strangely, changing my Format On Save Mode setting of VS Code to |
Does using this with |
Your Environment
Describe the bug
I want to use this plugin with my Astro project. My prettier config looks like this:
The plugin works great for most files, but I encountered the following error when I'm using Astro's SSR's redirect function:
Expected behavior
The file to be compiled successfully even when using SSR's return function
Error log
Contribute to @trivago/prettier-plugin-sort-imports
The text was updated successfully, but these errors were encountered: