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

Can not write recommended #await shorthand #323

Closed
phcoliveira opened this issue Nov 18, 2022 · 2 comments · Fixed by #324
Closed

Can not write recommended #await shorthand #323

phcoliveira opened this issue Nov 18, 2022 · 2 comments · Fixed by #324
Labels
bug Something isn't working

Comments

@phcoliveira
Copy link

Hello there!

I want to write this, because I only care about the possibility of an error.

  {#await goto('/somewhere') catch error}
    {@debug error}
  {/await}

But Prettier formats the snippet above returning this.

  {#await goto('/somewhere')}{:catch error}
    {@debug error}
  {/await}

This needless separation also leaves a warning: Empty blocksvelte(empty-block), because there is nothing between the #await block and the :catch one.

My prettier config is as such.

/**
 * @type {import('prettier').Options}
 */
module.exports = {
  plugins: [require('prettier-plugin-tailwindcss')],
  pluginSearchDirs: ['.'],
  overrides: [{files: '*.svelte', options: {parser: 'svelte'}}],
  tailwindConfig: './tailwind.config.cjs',
  arrowParens: 'always',
  bracketSpacing: false,
  endOfLine: 'lf',
  plugins: [],
  pluginSearchDirs: ['../../'],
  printWidth: 80,
  semi: true,
  singleQuote: true,
  tabWidth: 2,
  trailingComma: 'es5',
  useTabs: false,
  svelteSortOrder: 'options-styles-scripts-markup',
  svelteStrictMode: true,
  svelteBracketNewLine: false,
  svelteAllowShorthand: false,
  svelteIndentScriptAndStyle: true,
};

Should I remove strict mode? In any case, shouldn't this be allowed?

Kind regards.

@dummdidumm dummdidumm added the bug Something isn't working label Nov 18, 2022
@phcoliveira
Copy link
Author

That was fast!

@phcoliveira
Copy link
Author

That was even faster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants