We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
await
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
^8.44.0
eslint-plugin-svelte
^2.32.2
module.exports = { root: true, extends: [ 'eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:@typescript-eslint/recommended-requiring-type-checking', 'plugin:@typescript-eslint/strict', 'plugin:svelte/recommended', 'plugin:svelte/prettier', 'prettier', ], parser: '@typescript-eslint/parser', plugins: ['@typescript-eslint'], parserOptions: { sourceType: 'module', ecmaVersion: 2020, project: './tsconfig.eslint.json', extraFileExtensions: ['.svelte'], }, env: { browser: true, es2017: true, node: true, }, overrides: [ { files: ['*.svelte'], parser: 'svelte-eslint-parser', parserOptions: { parser: '@typescript-eslint/parser', }, }, ], rules: { '@typescript-eslint/consistent-type-exports': 'error', '@typescript-eslint/consistent-type-imports': 'error', '@typescript-eslint/default-param-last': 'error', '@typescript-eslint/method-signature-style': 'error', '@typescript-eslint/no-import-type-side-effects': 'error', '@typescript-eslint/prefer-readonly': 'error', '@typescript-eslint/promise-function-async': ['error', { checkArrowFunctions: false }], '@typescript-eslint/require-array-sort-compare': 'error', '@typescript-eslint/return-await': 'error', '@typescript-eslint/sort-type-constituents': 'error', '@typescript-eslint/switch-exhaustiveness-check': 'error', // SvelteKit uses that for returning errors in routes '@typescript-eslint/no-throw-literal': 'off', // Receiving markdown from the API 'svelte/no-at-html-tags': 'off', }, }
<script lang="ts"> import type { CommunityView } from 'lemmy-js-client' export let community: Promise<CommunityView> export let followCommunity: (follow: boolean) => Promise<void> </script> {#await community} <button class="rounded-full bg-surface px-4 py-2 text-on-surface">Loading...</button> {:then community} {#if community.subscribed === 'NotSubscribed'} <button class="rounded-full border-surface-container bg-surface-container px-4 py-2 text-on-surface-container hover:bg-surface hover:text-on-surface" on:click={() => followCommunity(true)} > Join </button> {/if} {/await}
Linting should pass
/home/nato/Code/github.com/NatoBoram/Leanish/src/lib/SubscribeButton.svelte 11:7 error Unsafe member access .subscribed on an `any` value @typescript-eslint/no-unsafe-member-access ✖ 1 problem (1 error, 0 warnings)
https://github.com/NatoBoram/bug-report-terrtc/commit/8c5c4c89aa1bb4e0a86cc8ef05c90b14dd7a53f5 (Deleted)
This happens when plugin:@typescript-eslint/recommended-requiring-type-checking is enabled
plugin:@typescript-eslint/recommended-requiring-type-checking
I think this can be worked around by changing the name of the variable after :then
:then
The text was updated successfully, but these errors were encountered:
any
then
Thank you for posting this issue. Using the same name for #await and :then does not seem to work. To fix the problem we need to fix the parser.
#await
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Before You File a Bug Report Please Confirm You Have Done The Following...
What version of ESLint are you using?
^8.44.0
What version of
eslint-plugin-svelte
are you using?^2.32.2
What did you do?
Configuration
What did you expect to happen?
Linting should pass
What actually happened?
Link to GitHub Repo with Minimal Reproducible Example
https://github.com/NatoBoram/bug-report-terrtc/commit/8c5c4c89aa1bb4e0a86cc8ef05c90b14dd7a53f5(Deleted)Additional comments
This happens when
plugin:@typescript-eslint/recommended-requiring-type-checking
is enabledI think this can be worked around by changing the name of the variable after
:then
The text was updated successfully, but these errors were encountered: