Skip to content

Commit 0acd957

Browse files
committed
Upgrade typescript-eslint-parser, use JSXText instead of Literal for strings inside JSXElement
eslint/typescript-eslint-parser#272 was merged, so this fixes prettier#1558 See here for more info about the new TSQualifiedName node type: eslint/typescript-eslint-parser@3491b4b
1 parent 681c1ad commit 0acd957

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"rollup-plugin-node-globals": "1.1.0",
3737
"rollup-plugin-node-resolve": "2.0.0",
3838
"typescript": "2.3.2",
39-
"typescript-eslint-parser": "git://github.com/eslint/typescript-eslint-parser.git#3f9f41c7d8bcdaa3fbd68767e390f07f05555c3a"
39+
"typescript-eslint-parser": "git://github.com/eslint/typescript-eslint-parser.git#b7220fdbf5a923c64bb6e5bbbfc2ad689ec779eb"
4040
},
4141
"scripts": {
4242
"test": "jest",

src/parser.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ function tryParseTypeScript(text, jsx) {
118118
range: true,
119119
tokens: true,
120120
comment: true,
121+
useJSXTextNode: true,
121122
ecmaFeatures: { jsx }
122123
});
123124
}

src/printer.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,6 +1456,8 @@ function genericPrintNoParens(path, options, print, args) {
14561456
path.call(print, "object"),
14571457
path.call(print, "property")
14581458
]);
1459+
case "TSQualifiedName":
1460+
return join(".", [path.call(print, "left"), path.call(print, "right")]);
14591461
case "JSXSpreadAttribute":
14601462
return concat(["{...", path.call(print, "argument"), "}"]);
14611463
case "JSXExpressionContainer": {

yarn.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2688,9 +2688,9 @@ typedarray@^0.0.6:
26882688
version "0.0.6"
26892689
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
26902690

2691-
"typescript-eslint-parser@git://github.com/eslint/typescript-eslint-parser.git#3f9f41c7d8bcdaa3fbd68767e390f07f05555c3a":
2691+
"typescript-eslint-parser@git://github.com/eslint/typescript-eslint-parser.git#b7220fdbf5a923c64bb6e5bbbfc2ad689ec779eb":
26922692
version "3.0.0"
2693-
resolved "git://github.com/eslint/typescript-eslint-parser.git#3f9f41c7d8bcdaa3fbd68767e390f07f05555c3a"
2693+
resolved "git://github.com/eslint/typescript-eslint-parser.git#b7220fdbf5a923c64bb6e5bbbfc2ad689ec779eb"
26942694
dependencies:
26952695
lodash.unescape "4.0.1"
26962696
semver "5.3.0"

0 commit comments

Comments
 (0)