fix(29648): Error message related to JSDoc for non-JSDoc syntax error (#50793)

* fix(29648): improve diagnostics of non-JSDoc syntax errors

* fix lint errors

* update tests

* change diagnostic type suggestion. fix QF for jsdoc nullable type

* move error handling from the parser to the checker

* change diagnostic message. remove speculative parsing

* update baseline
This commit is contained in:
Oleksandr T
2022-12-29 16:50:57 -08:00
committed by GitHub
parent ba393b6b9f
commit 44152bc22e
30 changed files with 667 additions and 76 deletions
+3 -2
View File
@@ -809,12 +809,13 @@ export const enum NodeFlags {
/** @internal */ PossiblyContainsDynamicImport = 1 << 21,
/** @internal */ PossiblyContainsImportMeta = 1 << 22,
JSDoc = 1 << 23, // If node was parsed inside jsdoc
JSDoc = 1 << 23, // If node was parsed inside jsdoc
/** @internal */ Ambient = 1 << 24, // If node was inside an ambient context -- a declaration file, or inside something with the `declare` modifier.
/** @internal */ InWithStatement = 1 << 25, // If any ancestor of node was the `statement` of a WithStatement (not the `expression`)
JsonFile = 1 << 26, // If node was parsed in a Json
JsonFile = 1 << 26, // If node was parsed in a Json
/** @internal */ TypeCached = 1 << 27, // If a type was cached for node at any point
/** @internal */ Deprecated = 1 << 28, // If has '@deprecated' JSDoc tag
/** @internal */ ConditionalTypeContext = 1 << 29,
BlockScoped = Let | Const,