Fix <this.Component /> (#2472)
This is a workaround while waiting on https://github.com/eslint/typescript-eslint-parser/issues/337. Fixes #2471master
parent
ef91e28434
commit
1691b85322
|
@ -1596,6 +1596,11 @@ function genericPrintNoParens(path, options, print, args) {
|
|||
|
||||
return concat(parts);
|
||||
case "JSXIdentifier":
|
||||
// Can be removed when this is fixed:
|
||||
// https://github.com/eslint/typescript-eslint-parser/issues/337
|
||||
if (!n.name) {
|
||||
return "this";
|
||||
}
|
||||
return "" + n.name;
|
||||
case "JSXNamespacedName":
|
||||
return join(":", [
|
||||
|
|
|
@ -46,7 +46,9 @@ const MyCoolThing = ({ thingo }) => <li>{thingo}</li>;
|
|||
|
||||
exports[`this.tsx 1`] = `
|
||||
<this.state.Component />;
|
||||
<this.Component />;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
<this.state.Component />;
|
||||
<this.Component />;
|
||||
|
||||
`;
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
<this.state.Component />;
|
||||
<this.Component />;
|
||||
|
|
Loading…
Reference in New Issue