-
Notifications
You must be signed in to change notification settings - Fork 712
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
The "defined in" points to node_modules type rather than to actual code #2307
Comments
Yet another reason to not use This happens because the signature declaration takes display priority, and the signature for that variable is defined in the types. TypeDoc should probably check here if the reflection is a signature and does not share a source declaration location with its parent, in which case it should replace its source declaration with that defined on the parent. |
I notice that it also points to the wrong place when using currying, which might be related (if not I can create a new issue): // times.ts
const times = b => a => a * b;
// double.ts
const double = times(2); In previous versions of TypeDoc this generated "defined in double.ts" for |
The fix I described above should handle both of these cases |
... well, it would, if it that didn't break in this case: export const all: {
<T>(fn: (item: T) => boolean, iterator: Iterable<T>): boolean;
<T>(fn: (item: T) => boolean): (iterator: Iterable<T>) => boolean;
} = () => false as any; This is trickier than I thought.. |
Search terms
defined in
node_modules
react
functional component
FC
Expected Behavior
The Defined in field in generated docs should refer to the actual file where the documented function is defined, rather than the library code where its type is defined.
Actual Behavior
The doc entry for a react functional component declared in
my-package/src/MyComponent.tsx
as follows:Contains this Defined in section:
It is the same for any component defined in any module this way.
Steps to reproduce the bug
The typedoc config in
tsconfig.json
:Run as
typedoc --plugin typedoc-plugin-markdown
Environment
The text was updated successfully, but these errors were encountered: