Skip to content

Svelte 5: svelte-ignore unused-export-let is ignored #11890

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

Closed
kyoshino opened this issue Jun 3, 2024 · 2 comments · Fixed by #11896
Closed

Svelte 5: svelte-ignore unused-export-let is ignored #11890

kyoshino opened this issue Jun 3, 2024 · 2 comments · Fixed by #11896
Labels
bug good first issue A small, encapsulated issue, ideal for a new contributor to Svelte to tackle.
Milestone

Comments

@kyoshino
Copy link
Contributor

kyoshino commented Jun 3, 2024

Describe the bug

When I build my Sveltia CMS app with Svelte 5 RC, I see a bunch of warnings about unused exports, e.g.

[vite-plugin-svelte] src/lib/components/contents/details/widgets/string/string-editor.svelte:15:13 Component has unused export property 'locale'. If it is for external reference only, please consider using export const locale

Here’s the relevant code.

I’ve noticed in #11833 that at some point svelte-ignore unused-export-let has become svelte-ignore export_let_unused. I can confirm that changing unused-export-let to export_let_unused can silence the warnings.

If it’s an intentional change, please mention it in the breaking changes document. Otherwise, please restore the support for unused-export-let and possibly other warning codes.

Additional context: These unused exports are used along with svelte-ignore unused-export-let to suppress browser console warnings like <String_editor> was created with unknown prop 'locale'. These components are loaded with <svelte:component>, and not all the components use all the props. It may no longer be necessary after migrating to the Svelte 5 $props rune (I haven’t tested it yet.) (Edit: it seems so, according to #4652)

Reproduction

  1. Clone the Sveltia CMS repo
  2. Run pnpm install svelte@next -D && pnpm build

Logs

No response

System Info

System:
    OS: macOS 14.5
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 549.19 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 20.14.0 - /usr/local/opt/node@20/bin/node
    Yarn: 1.22.22 - /usr/local/bin/yarn
    npm: 10.7.0 - /usr/local/opt/node@20/bin/npm
    pnpm: 9.1.4 - /usr/local/bin/pnpm
  Browsers:
    Chrome: 125.0.6422.142
    Firefox Nightly: 124.0a1
    Safari: 17.5
  npmPackages:
    svelte: 5.0.0-next.148 => 5.0.0-next.148

Severity

annoyance

@dummdidumm
Copy link
Member

This is a bug in our legacy mode: replacements in extract_svelte_ignore.js needs the old code new code mapping

@dummdidumm dummdidumm added this to the 5.0 milestone Jun 3, 2024
@dummdidumm dummdidumm added bug good first issue A small, encapsulated issue, ideal for a new contributor to Svelte to tackle. labels Jun 3, 2024
@kyoshino kyoshino changed the title Svelte 5: svelte-ignore unused-export-let is ignored Svelte 5: svelte-ignore unused-export-let is ignored Jun 3, 2024
@kyoshino
Copy link
Contributor Author

kyoshino commented Jun 6, 2024

VERIFIED FIXED with [email protected] 👍🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue A small, encapsulated issue, ideal for a new contributor to Svelte to tackle.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants