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

1.0 for Twoslash #965

Merged
merged 3 commits into from
Aug 25, 2020
Merged

1.0 for Twoslash #965

merged 3 commits into from
Aug 25, 2020

Conversation

orta
Copy link
Contributor

@orta orta commented Aug 24, 2020

Wraps up my final 1.0 blocker #962 which means I you can make a code sample like:

```ts twoslash
// @filename: Component.tsx
import React from "react"

export function Hello() {
  return (
    <div>
      <h1>Hello World</h1>
    </div>
  )
}

// @filename: index.ts
import { Hello } from "./Component"
console.log(Hello)
```

Without a bunch of faff.

Basically the underlaying vfs will first look for virtual files then it will think that you have a subfolder in your repo's root with this source code. It will then correctly look up through your repo's node_modules for the right types via the normal TS routing.

@orta orta mentioned this pull request Aug 24, 2020
@orta orta merged commit 7a4b6ec into v2 Aug 25, 2020
@jakebailey jakebailey deleted the ts_1 branch May 17, 2024 22:01
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.

1 participant