You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @typedef: Improve error spans from declaration emit
This is a proof-of-concept fix. I think it could be expanded for all of
jsdoc, but I only set it up for jsdoc type aliases. It could use a lot
of polish too.
* track error node in isSymbolAccessible instead
* Switch to using enclosingDeclaration
Remove trueErrorNode
* add test of @callback and @enum
* Better error + fix @enum error
Since enums don't have a name property, you *have* to call
`getNameOfDeclaration` to go looking through the AST for one.
Copy file name to clipboardExpand all lines: tests/baselines/reference/jsDeclarationsParameterTagReusesInputNodeInEmit1.errors.txt
+18-4
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,6 @@
1
-
tests/cases/conformance/jsdoc/declarations/file.js(8,1): error TS9006: Declaration emit for this file requires using private name 'Base' from module '"tests/cases/conformance/jsdoc/declarations/base"'. An explicit type annotation may unblock declaration emit.
1
+
tests/cases/conformance/jsdoc/declarations/file.js(1,5): error TS4084: Exported type alias 'BaseFactory' has or is using private name 'Base' from module "tests/cases/conformance/jsdoc/declarations/base".
2
+
tests/cases/conformance/jsdoc/declarations/file.js(3,4): error TS4084: Exported type alias 'BaseFactoryFactory' has or is using private name 'Base' from module "tests/cases/conformance/jsdoc/declarations/base".
3
+
tests/cases/conformance/jsdoc/declarations/file.js(6,5): error TS4084: Exported type alias 'couldntThinkOfAny' has or is using private name 'Base' from module "tests/cases/conformance/jsdoc/declarations/base".
!!! error TS4084: Exported type alias 'BaseFactory' has or is using private name 'Base' from module "tests/cases/conformance/jsdoc/declarations/base".
23
+
/**
24
+
* @callback BaseFactoryFactory
25
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26
+
* @param {import('./base')} factory
27
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
28
+
*/
29
+
~
30
+
!!! error TS4084: Exported type alias 'BaseFactoryFactory' has or is using private name 'Base' from module "tests/cases/conformance/jsdoc/declarations/base".
31
+
/** @enum {import('./base')} */
32
+
~~~~~~~~~~~~~~~~~~~~~~~~
33
+
!!! error TS4084: Exported type alias 'couldntThinkOfAny' has or is using private name 'Base' from module "tests/cases/conformance/jsdoc/declarations/base".
34
+
const couldntThinkOfAny = {}
19
35
20
36
/**
21
37
*
22
38
* @param {InstanceType<BaseFactory["Base"]>} base
23
39
* @returns {InstanceType<BaseFactory["Base"]>}
24
40
*/
25
41
const test = (base) => {
26
-
~~~~~
27
-
!!! error TS9006: Declaration emit for this file requires using private name 'Base' from module '"tests/cases/conformance/jsdoc/declarations/base"'. An explicit type annotation may unblock declaration emit.
0 commit comments