diff --git a/package.json b/package.json index 76cc592ed..d70d57fb2 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "srcset": "2.0.1", "string-width": "4.2.0", "tslib": "1.12.0", - "typescript": "3.8.3", + "typescript": "3.9.2", "unicode-regex": "3.0.0", "unified": "9.0.0", "vnopts": "1.0.2", diff --git a/tests/misc/errors/typescript/__snapshots__/jsfmt.spec.js.snap b/tests/misc/errors/typescript/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 000000000..2e3e83b00 --- /dev/null +++ b/tests/misc/errors/typescript/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`invalid-jsx-1.ts error test 1`] = ` +"Unexpected token. Did you mean \`{'>'}\` or \`>\`? (3:45) + 1 | // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-9.html#-and--are-now-invalid-jsx-text-characters + 2 | +> 3 | let directions =
Navigate to: Menu Bar > Tools > Options
+ | ^ + 4 | " +`; + +exports[`snippet: #0 error test 1`] = ` +"Unexpected token. Did you mean \`{'}'}\` or \`}\`? (1:15) +> 1 | let x1 =
}
; + | ^" +`; + +exports[`snippet: #1 error test 1`] = ` +"Unexpected token. Did you mean \`{'>'}\` or \`>\`? (1:15) +> 1 | let x2 =
>
; + | ^" +`; + +exports[`snippet: #2 error test 1`] = ` +"':' expected. (1:21) +> 1 | let x3 =
{\\"foo\\"}}
; + | ^" +`; + +exports[`snippet: #3 error test 1`] = ` +"':' expected. (1:21) +> 1 | let x4 =
{\\"foo\\"}>
; + | ^" +`; + +exports[`snippet: #4 error test 1`] = ` +"Expression expected. (1:15) +> 1 | let x5 =
}{\\"foo\\"}
; + | ^" +`; + +exports[`snippet: #5 error test 1`] = ` +"Expression expected. (1:15) +> 1 | let x6 =
>{\\"foo\\"}
; + | ^" +`; diff --git a/tests/misc/errors/typescript/invalid-jsx-1.ts b/tests/misc/errors/typescript/invalid-jsx-1.ts new file mode 100644 index 000000000..4f079b066 --- /dev/null +++ b/tests/misc/errors/typescript/invalid-jsx-1.ts @@ -0,0 +1,3 @@ +// https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-9.html#-and--are-now-invalid-jsx-text-characters + +let directions =
Navigate to: Menu Bar > Tools > Options
diff --git a/tests/misc/errors/typescript/jsfmt.spec.js b/tests/misc/errors/typescript/jsfmt.spec.js new file mode 100644 index 000000000..0f311b90f --- /dev/null +++ b/tests/misc/errors/typescript/jsfmt.spec.js @@ -0,0 +1,14 @@ +run_spec( + { + dirname: __dirname, + snippets: [ + "let x1 =
}
;", + "let x2 =
>
;", + 'let x3 =
{"foo"}}
;', + 'let x4 =
{"foo"}>
;', + 'let x5 =
}{"foo"}
;', + 'let x6 =
>{"foo"}
;', + ], + }, + ["typescript"] +); diff --git a/yarn.lock b/yarn.lock index 4a568cc6d..128185a12 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7527,10 +7527,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@3.8.3: - version "3.8.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.3.tgz#409eb8544ea0335711205869ec458ab109ee1061" - integrity sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w== +typescript@3.9.2: + version "3.9.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.2.tgz#64e9c8e9be6ea583c54607677dd4680a1cf35db9" + integrity sha512-q2ktq4n/uLuNNShyayit+DTobV2ApPEo/6so68JaD5ojvc/6GClBipedB9zNWYxRSAlZXAe405Rlijzl6qDiSw== uglify-js@^3.1.4: version "3.7.6"