Run prettier
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import jsx from "babel-plugin-syntax-jsx";
|
||||
import helper from "babel-helper-builder-react-jsx";
|
||||
|
||||
export default function ({ types: t }) {
|
||||
export default function({ types: t }) {
|
||||
const JSX_ANNOTATION_REGEX = /\*?\s*@jsx\s+([^\s]+)/;
|
||||
|
||||
const visitor = helper({
|
||||
@@ -20,7 +20,7 @@ export default function ({ types: t }) {
|
||||
},
|
||||
});
|
||||
|
||||
visitor.Program = function (path, state) {
|
||||
visitor.Program = function(path, state) {
|
||||
const { file } = state;
|
||||
let id = state.opts.pragma || "React.createElement";
|
||||
|
||||
@@ -29,19 +29,21 @@ export default function ({ types: t }) {
|
||||
if (matches) {
|
||||
id = matches[1];
|
||||
if (id === "React.DOM") {
|
||||
throw file.buildCodeFrameError(comment,
|
||||
"The @jsx React.DOM pragma has been deprecated as of React 0.12");
|
||||
throw file.buildCodeFrameError(
|
||||
comment,
|
||||
"The @jsx React.DOM pragma has been deprecated as of React 0.12",
|
||||
);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
state.set(
|
||||
"jsxIdentifier",
|
||||
() => id.split(".").map((name) => t.identifier(name)).reduce(
|
||||
(object, property) => t.memberExpression(object, property)
|
||||
)
|
||||
state.set("jsxIdentifier", () =>
|
||||
id
|
||||
.split(".")
|
||||
.map(name => t.identifier(name))
|
||||
.reduce((object, property) => t.memberExpression(object, property)),
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user