Skip to content
Permalink
Browse files

Fixes @jsx pragma detection + tests

  • Loading branch information
claudiopro committed Nov 17, 2015
1 parent d2e07cf commit 6d1a6dfc94d9a77ab332c2ef7d74e2c0d7e7b618
@@ -1,5 +1,5 @@
export default function ({ types: t }) {
let JSX_ANNOTATION_REGEX = /^\*\s*@jsx\s+([^\s]+)/;
let JSX_ANNOTATION_REGEX = /\*?\s*@jsx\s+([^\s]+)/;

let visitor = require("babel-helper-builder-react-jsx")({
pre(state) {
@@ -0,0 +1,10 @@
/**
* @jsx React.DOM
*/

<Foo></Foo>;

var profile = <div>
<img src="avatar.png" className="profile" />
<h3>{[user.firstName, user.lastName].join(" ")}</h3>
</div>;
@@ -0,0 +1,3 @@
{
"throws": "The @jsx React.DOM pragma has been deprecated as of React 0.12"
}
@@ -0,0 +1,8 @@
/* @jsx React.DOM */

<Foo></Foo>;

var profile = <div>
<img src="avatar.png" className="profile" />
<h3>{[user.firstName, user.lastName].join(" ")}</h3>
</div>;
@@ -0,0 +1,3 @@
{
"throws": "The @jsx React.DOM pragma has been deprecated as of React 0.12"
}
@@ -0,0 +1,8 @@
// @jsx React.DOM

<Foo></Foo>;

var profile = <div>
<img src="avatar.png" className="profile" />
<h3>{[user.firstName, user.lastName].join(" ")}</h3>
</div>;
@@ -0,0 +1,3 @@
{
"throws": "The @jsx React.DOM pragma has been deprecated as of React 0.12"
}
@@ -0,0 +1,8 @@
/** @jsx React.DOM */

<Foo></Foo>;

var profile = <div>
<img src="avatar.png" className="profile" />
<h3>{[user.firstName, user.lastName].join(" ")}</h3>
</div>;
@@ -0,0 +1,3 @@
{
"throws": "The @jsx React.DOM pragma has been deprecated as of React 0.12"
}

0 comments on commit 6d1a6df

Please sign in to comment.
You can’t perform that action at this time.