phryneas / remark-typescript-tools

MIT License
129 stars 7 forks source link

✨ Add support for `tsx` codeblocks #10

Closed Shrugsy closed 2 years ago

Shrugsy commented 2 years ago

Under b7fa5c978350a7046aecf6090e2d77d1ceca4cb2, support was added to allow for jsx transpiling when a file comment such as // file: App.tsx was included.

e.g. This was fine

```ts
// file: App.tsx
function App() {
  return <div />
}

However, this still required the snippet to be explicitly specified as `ts`, not `tsx`. 

As a result, the syntax highlighting would not be complete:

`ts` highlighting:
```ts
function App() {
  return <div />
}

tsx highlighting:

function App() {
  return <div />
}

This MR allows for also respecting the tsx language indicator when transpiling snippets, hence now supporting this:

```tsx
// file: App.tsx
function App() {
  return <div />
}
phryneas commented 2 years ago

looks good :)

phryneas commented 2 years ago

released as 1.0.11