noUnusedParameters: add note about underscore prefix exception#3178
noUnusedParameters: add note about underscore prefix exception#3178jakebailey merged 3 commits intomicrosoft:v2from
Conversation
| Parameters declaration with names starting with an underscore _ are exempt from the unused parameter checking. e.g.: | ||
|
|
||
| ```ts twoslash | ||
| function returnNull(_a) { |
There was a problem hiding this comment.
This needs a type annotation to prevent the error: https://victorious-plant-05c166c10-3178.centralus.5.azurestaticapps.net/tsconfig/#noUnusedParameters
There was a problem hiding this comment.
Also, set // @noUnusedParameters here. Best to copy the above example and just rename the parameter, actually (but without the @errors)
Copy first example, modify for the example
|
Finally got back to this. @jakebailey thanks for the feedback, should be ready to go...hopefully! |
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://victorious-plant-05c166c10-3178.centralus.5.azurestaticapps.net |
jakebailey
left a comment
There was a problem hiding this comment.
Minor nit, given _ is special in markdown.
packages/tsconfig-reference/copy/en/options/noUnusedParameters.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
|
Just remembered this issue and committed that change, @jakebailey. Anything else? |
|
Thank you!! |
In the release notes for noUnusedParameters, there's a note about prefixing the parameter name with an underscore to bypass this error.
This PR adds that same note and example to the noUnusedParameters documentation.
(thanks to @lindboe for noticing this and pointing me to the release docs!)