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

[typescript] Error no-unsafe-call on store in module #176

Open
orblazer opened this issue Apr 13, 2022 · 0 comments
Open

[typescript] Error no-unsafe-call on store in module #176

orblazer opened this issue Apr 13, 2022 · 0 comments

Comments

@orblazer
Copy link

orblazer commented Apr 13, 2022

Hello,
I have an issue with no-unsafe-call rules when i want use store in module.

Layout:

<script context="module" lang="ts">
  import { writable } from 'svelte/store'
  export const title = writable<string>(null)
</script>

Page:

<script context="module">
  import DefaultLayout, { title } from '@layouts/dashboard.svelte'
  export const layout = DefaultLayout

  title.set('test') // Error appear here
</script>

Eslint config:

module.exports = {
  root: true,
  parser: '@typescript-eslint/parser',
  extends: [
    'eslint:recommended',
    'plugin:@typescript-eslint/recommended',
    'plugin:@typescript-eslint/recommended-requiring-type-checking',
    'standard',
    'prettier'
  ],
  plugins: ['svelte3', '@typescript-eslint'],
  env: {
    es2021: true,
    browser: true
  },
  parserOptions: {
    ecmaVersion: 2021,
    sourceType: 'module',
    project: ['./tsconfig.eslint.json', './tsconfig.json'],
    extraFileExtensions: ['.svelte']
  },
  settings: {
    'svelte3/typescript': () => require('typescript') // pass the TypeScript package to the Svelte plugin
  },
  globals: {
    svelte: true //  For `svelte.JSX` type
  },
  overrides: [
    {
      files: ['*.svelte'],
      processor: 'svelte3/svelte3',
      rules: {
        'import/first': 'off',
        'import/no-duplicates': 'off',
        'import/no-mutable-exports': 'off',
        'import/prefer-default-export': 'off'
      }
    }
  ]
}

Thanks

@orblazer orblazer changed the title Error no-unsafe-member-access and no-unsafe-call on store in module [typescript] Error no-unsafe-member-access and no-unsafe-call on store in module Apr 13, 2022
@orblazer orblazer changed the title [typescript] Error no-unsafe-member-access and no-unsafe-call on store in module [typescript] Error no-unsafe-call on store in module Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant