Skip to content
This repository has been archived by the owner on Jan 19, 2019. It is now read-only.

JSX parsing error on .tsx #376

Closed
mizchi opened this issue Aug 22, 2017 · 1 comment
Closed

JSX parsing error on .tsx #376

mizchi opened this issue Aug 22, 2017 · 1 comment
Labels

Comments

@mizchi
Copy link

mizchi commented Aug 22, 2017

What version of TypeScript are you using?

2.4

What version of typescript-eslint-parser are you using?

7.0.0

What code were you trying to parse?

import * as React from 'react'
type Props = {
  title: string
}

export default function App(props: Props) {
  return (
    <h1>
      {props.title}
    </h1>
  )
}

What did you expect to happen?

Pass jsx syntax correctly.

What happened?

/Users/mz/sandbox/ts-proj/src/components/App.tsx
  9:12  error  Parsing error: ':' expected
@JamesHenry
Copy link
Member

Thanks so much for your patience on this @mizchi!

This highlighted to me the fact that we currently have no way of testing TSX files specifically. We have typescript-specific construct tests, and JSX tests, but no way to explicitly test .tsx files.

I am addressing that in a PR and have used the source you have provided as the first test case. It seems that your issue has been resolved at some point, either in this project or in TypeScript itself, as the source no longer produces an error on latest master of this project and its supported stable TypeScript version of 2.5.x.

If you still have the issue when using the latest supported version please feel free to repoen, but otherwise I will be closing this when my PR lands.

Thanks again!

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

No branches or pull requests

3 participants