Conversation
…Export-to-default
There was a problem hiding this comment.
is there are a release note/docs link to add as references here ?
There was a problem hiding this comment.
I think the only resource for now is the PR: nodejs/node#61727
The idea is that we release the deprecation with this codemod, so I think the deprecation hasn’t been added to the docs yet, but I could be wrong.
Co-authored-by: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com>
JakobJingleheimer
left a comment
There was a problem hiding this comment.
Cool, thanks for the tidy. Did you see the bit about unshift vs push?
I did a small research and tried using The possible solutions I thought of were:
I think the best approach would be the for loop with a pointer, but let me know if you have a better idea. |
Co-authored-by: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com>
add recipe to handle deprecated
options.defaultExportandoptions.namedExportsonnode:test.mockadd intoExample
mock.module('…', { - defaultExport: …, - namedExports: { - foo: … - }, + exports: { + default: …, + foo: …, + }, });ref: nodejs/node#61727