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

svelte5 - custom attributes like src must be removed from tag when preprocessing them #652

Open
dominikg opened this issue Aug 27, 2024 · 0 comments · May be fixed by #653
Open

svelte5 - custom attributes like src must be removed from tag when preprocessing them #652

dominikg opened this issue Aug 27, 2024 · 0 comments · May be fixed by #653

Comments

@dominikg
Copy link
Member

Describe the bug
A recent change in svelte5 made attributes on <script> protected. Proprocessors using custom attributes must remove them to avoid warnings

/home/dominikg/develop/sveltejs/vite-plugin-svelte/packages/e2e-tests/svelte-preprocess/src/lib/multifile/MultiFile.svelte
  2:19  error  Unrecognized attribute — should be one of `generics`, `lang` or `module`. If this exists for a preprocessor, ensure that the preprocessor removes it(script_unknown_attribute)  svelte/valid-compile

https://github.com/sveltejs/vite-plugin-svelte/pull/960/files#diff-22639710c6daf7afe79020aa0bd65ee0147141762bf41af679f23042a2a4128b

Logs
Please include browser console and server logs around the time this bug occurred.

To Reproduce
clone vite-plugin-svelte repo
remove disable comment: https://github.com/sveltejs/vite-plugin-svelte/blob/12b7af76dac68b4cf3b60bba269aa927a2528716/packages/e2e-tests/svelte-preprocess/src/lib/multifile/MultiFile.svelte#L2

run pnpm lint

Expected behavior
no warning

Information about your project:

latest vite, svelte5-next and svelte-preprocess

Additional context
eslint-plugin-svelte currently makes an error out of this warning, which might be too harsh

dummdidumm added a commit that referenced this issue Aug 27, 2024
- global for style tags
- src for script/style tags

fixes #652
@dummdidumm dummdidumm linked a pull request Aug 27, 2024 that will close this issue
4 tasks
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

Successfully merging a pull request may close this issue.

1 participant