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
Purpose: Fix the JSDoc in lib/config/default.js so that editors and IDEs can infer the type from the factory function correctly.
The installation steps for this project mention in step 3 that you should copy and paste a code snippet with a comment referring developers to a file at some relative path, which is confusing (lib/config/default.js... I saw this in my codebase and thought it was referring to some file in our app that got deleted). The proper way to offer documentation on the configuration API would be to either include it in @types or use JSDoc properly (ideally both).
My editor should be able to infer the return type of the definition function, or the default config options should be fully documented, rather than using the shortcut of @returns {object}.
Editor: VSCode
Node version: N/A but I see it with v16 and v18
OS: replicated on both macOS and Windows 10
node-newrelic version is 9.15
Additional context
I was able to solve this by removing a single line, so I was hoping someone else could take up this PR, because going through the work to figure out the CLA agent is going to be more work than the proposed fix.
Screenshot:
Thanks
The text was updated successfully, but these errors were encountered:
Purpose: Fix the JSDoc in
lib/config/default.js
so that editors and IDEs can infer the type from the factory function correctly.The installation steps for this project mention in step 3 that you should copy and paste a code snippet with a comment referring developers to a file at some relative path, which is confusing (
lib/config/default.js
... I saw this in my codebase and thought it was referring to some file in our app that got deleted). The proper way to offer documentation on the configuration API would be to either include it in@types
or use JSDoc properly (ideally both).Description
When I try to import the path using a JSDoc import, VS Code shows the type as
() => any
because of the@returns
statement in the docExpected Behavior
My editor should be able to infer the return type of the
definition
function, or the default config options should be fully documented, rather than using the shortcut of@returns {object}
.Troubleshooting or NR Diag results
N/A
Steps to Reproduce
Using JSDoc , import the
definition
export and create a new@typedef
This shows
Definition
to have the type() => any
Then obviously this is just
any
Screenshot:
Your Environment
Editor: VSCode
Node version: N/A but I see it with v16 and v18
OS: replicated on both macOS and Windows 10
node-newrelic version is 9.15
Additional context
I was able to solve this by removing a single line, so I was hoping someone else could take up this PR, because going through the work to figure out the CLA agent is going to be more work than the proposed fix.
Screenshot:
Thanks
The text was updated successfully, but these errors were encountered: