Skip to content

[fix] prevent unused types warning #6293

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

Merged
merged 3 commits into from
Aug 26, 2022
Merged

[fix] prevent unused types warning #6293

merged 3 commits into from
Aug 26, 2022

Conversation

dummdidumm
Copy link
Member

Fixes #6290

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. All changesets should be patch until SvelteKit 1.0

@changeset-bot
Copy link

changeset-bot bot commented Aug 25, 2022

🦋 Changeset detected

Latest commit: 140b849

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dummdidumm
Copy link
Member Author

dummdidumm commented Aug 25, 2022

Just realized it's also benefitial to add a ts-nocheck comment at the top of all of these, so in case there are type errors they don't show up twice. Will do that tomorrow on this PR.

@Rich-Harris
Copy link
Member

hahaha this is an incredible solution — i was thinking about walking the AST to see if the import type declaration was unused so we could remove it altogether. real 'the russians used a pencil' energy

Copy link
Member

@Rich-Harris Rich-Harris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rescinding my approval, but only so i don't accidentally merge it before the no-check stuff gets added

@benmccann
Copy link
Member

This really does feel like we need type tests 😄 I don't know that we need to hold this up for tests since there's so much on our plates right now, but it might be nice to do post-summit

@dummdidumm
Copy link
Member Author

I agree we need type tests, but this one isn't really related to that. It's a hidden file generated from the user's file, and there are already tests for it.

@benmccann
Copy link
Member

Ah, I missed that there's a test because it was in the src die and I'm so used to all our tests being integration tests. Thanks for correcting me!

@Rich-Harris Rich-Harris merged commit 493ec4d into master Aug 26, 2022
@Rich-Harris Rich-Harris deleted the unused-types branch August 26, 2022 13:29
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 this pull request may close these issues.

'PageLoad is declared but its value is never read' when running svelte-check
3 participants