New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support TypeScript 4.1 via typescript-estree #9636
Changes from all commits
5d5a4f0
0e801c9
a04127a
599f5f1
ca42089
27e7b46
a918330
589a689
cd545a8
8cb07ca
c31a3df
c563159
6c20946
4fc37c7
27a4473
5b15eb2
1484a2e
9a94c6b
1209987
9571318
a760c59
53fff41
5978c26
6ba07e0
4f693ed
ae8071d
9de9bc7
80cf659
07ed145
768e593
93a44d7
b048b0b
ff1ed80
24cfed1
beae5e1
1b7d159
109aa25
b4dd8c8
4f35ff3
7c65de6
be58419
e06ae5e
42913c2
702aeeb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export default { | ||
EOL: "\n", | ||
platform: () => "browser", | ||
cpus: () => [{ model: "Prettier" }], | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -464,6 +464,7 @@ const simpleTypeAnnotations = new Set([ | |
"BigIntLiteralTypeAnnotation", | ||
"NumberLiteralTypeAnnotation", | ||
"TSLiteralType", | ||
"TSTemplateLiteralType", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure about this. Unlike other node types in this list, template literal types aren't that simple and can contain complex expressions. We can keep them here though and see if users will complain about it. Probably it's okay. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's also what I thought 😄 |
||
// flow only, `empty`, `mixed` | ||
"EmptyTypeAnnotation", | ||
"MixedTypeAnnotation", | ||
|
@@ -647,11 +648,17 @@ function isNgForOf(node, index, parentNode) { | |
* @returns {boolean} | ||
*/ | ||
function isSimpleTemplateLiteral(node) { | ||
if (node.expressions.length === 0) { | ||
let expressionsKey = "expressions"; | ||
if (node.type === "TSTemplateLiteralType") { | ||
expressionsKey = "types"; | ||
} | ||
const expressions = node[expressionsKey]; | ||
|
||
if (expressions.length === 0) { | ||
return false; | ||
} | ||
|
||
return node.expressions.every((expr) => { | ||
return expressions.every((expr) => { | ||
// Disallow comments since printDocToString can't print them here | ||
if (expr.comments) { | ||
return false; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why, but this change removes the TypeScript typecheck error. Why...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe #9207