Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Remove duped module definitions #1598

Merged
merged 1 commit into from
Oct 11, 2020
Merged

Remove duped module definitions #1598

merged 1 commit into from
Oct 11, 2020

Conversation

orta
Copy link
Contributor

@orta orta commented Oct 11, 2020

I'm on windows, and I can't figure out how to take a screenshot of the auto-complete. However this is trivial to repro, create a new sapper project, run the TS migration then go to servert.ts and try get auto-complete in sapper.middleware({}) - it will give nothing useful, if you cmd click in to middleware then delete these it will get fixed

I don't know the history, of how it got setup here, but TS sees the first declare modules which effectively says 'make it an any` then later TS sees the more concrete types but they get eaten by the 'any' in the compiler (because all types are a subtype of any)

@orta orta requested a review from benmccann October 11, 2020 09:53
@benmccann
Copy link
Member

I added the types in #1402 by copying a file that the community had been using. I'm no TypeScript expert, but this looks fine and reasonable to me. @babichjacob I'll probably merge this unless you have any feedback on it

@babichjacob
Copy link
Member

I'm no TypeScript expert, but this looks fine and reasonable to me. @babichjacob I'll probably merge this unless you have any feedback on it

I'm also not a TypeScript expert, just a person who uses it 😄.

@benmccann benmccann merged commit b972a69 into master Oct 11, 2020
@TheComputerM
Copy link
Contributor

Just FYI, press windows_key+shift+S for a screenshot.

@orta
Copy link
Contributor Author

orta commented Oct 12, 2020

Hah, thanks 👍🏻

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants