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 Linting Error #41

Open
abhay-agarwal opened this issue Jun 4, 2023 · 4 comments
Open

Typescript Linting Error #41

abhay-agarwal opened this issue Jun 4, 2023 · 4 comments

Comments

@abhay-agarwal
Copy link

abhay-agarwal commented Jun 4, 2023

When using your library, the following linting error has started to appear in VSCode for me:

Argument of type '{ size: number; strokeWidth: number; "stroke-width": number; }' is not assignable to parameter of type 'SVGProps'.
  Object literal may only specify known properties, but 'strokeWidth' does not exist in type 'SVGProps'. Did you mean to write 'stroke-width'?ts(2345)

I use it as follows:

<template>
<icon-plus :size="20" :stroke-width="1.5" />
</template>
<script setup lang="ts">
import { IconPlus } from '@tabler/icons-vue'
</script>
@steklopod
Copy link

steklopod commented Jul 2, 2023

+1
Снимок экрана 2023-07-02 в 18 12 03

@alex-oleshkevich
Copy link
Owner

alex-oleshkevich commented Jul 3, 2023 via email

@brunorabelo
Copy link

I have the same issue

@brunorabelo
Copy link

brunorabelo commented Aug 23, 2023

I managed to solve it by applying a work around.

Created a file named vue_tabler_icon.d.ts under types/... (as you want).

Then used:

import { SVGAttributes, VNodeProps } from 'vue';
declare module '@vue/runtime-dom' {
  export interface HTMLAttributes {
    $children?: VNodeChild;
  }
  export interface SVGAttributes {
    $children?: VNodeChild;
    strokeWidth?: string | number;
  }
}

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

4 participants