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

Multi-word svg attributes TS error if using dataAttributes #2606

Closed
Doeke opened this issue Apr 14, 2023 · 0 comments
Closed

Multi-word svg attributes TS error if using dataAttributes #2606

Doeke opened this issue Apr 14, 2023 · 0 comments

Comments

@Doeke
Copy link

Doeke commented Apr 14, 2023

When I enable both strictTemplates and dataAttributes together I see the following error on all elements with multi-word attributes like stroke-linecap:

src/base/icon/NavIcon.vue:717:11 - error TS2322: Type '{ id: string; d: string; transform: string; fill: string; stroke: string; strokeLinecap: string; strokeLinejoin: string; strokeWidth: string; }' is not assignable to type 'ElementAttrs<SVGAttributes>'.
  Property 'strokeLinecap' does not exist on type 'ElementAttrs<SVGAttributes>'. Did you mean ''stroke-linecap''?

717           stroke-linecap="round"
              ~~~~~~~~~~~~~~

This is in my tsconfig:

  "vueCompilerOptions": {
    "strictTemplates": true,
    "dataAttributes": [
      "data-testid"
    ]
  },

For now my workaround that seems to work is adding "stroke-linecap" to the "dataAttributes" array

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