Fix <this.x /> (#1886)
Would be nice to get it properly handled in https://github.com/eslint/typescript-eslint-parser/issues/307 Fixes #1877master
parent
74f7f96fe4
commit
0e35d3758a
|
@ -1510,12 +1510,9 @@ 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/257
|
||||
if (n.object && n.property) {
|
||||
return join(".", [
|
||||
path.call(print, "object"),
|
||||
path.call(print, "property")
|
||||
]);
|
||||
// https://github.com/eslint/typescript-eslint-parser/issues/307
|
||||
if (!n.name) {
|
||||
return "this";
|
||||
}
|
||||
return "" + n.name;
|
||||
case "JSXNamespacedName":
|
||||
|
|
|
@ -37,3 +37,10 @@ const MyCoolList = ({ things }) =>
|
|||
const MyCoolThing = ({ thingo }) => <li>{thingo}</li>;
|
||||
|
||||
`;
|
||||
|
||||
exports[`this.tsx 1`] = `
|
||||
<this.state.Component />;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
<this.state.Component />;
|
||||
|
||||
`;
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
<this.state.Component />;
|
Loading…
Reference in New Issue