cli-lib: onMsgExtracted never gets called
adbl opened this issue · comments
Andreas Amsenius commented
Which package?
cli-lib
Describe the bug
Setting the option onMsgExtracted
has no effect when using extract
from @formatjs/cli-lib
, the callback never gets called because that option gets overridden here:
formatjs/packages/cli-lib/src/extract.ts
Line 106 in 34634ce
To Reproduce
Codesandbox URL
n/a
Reproducible Steps/Repo
- Run a script like:
import { extract } from "@formatjs/cli-lib";
import { DEFAULT_ID_INTERPOLATION_PATTERN } from "babel-plugin-formatjs";
await extract(<files>, {
extractSourceLocation: true,
// needed for some reason
idInterpolationPattern: DEFAULT_ID_INTERPOLATION_PATTERN,
throws: true,
// doesn't get called 🤥
onMsgExtracted: (...args) => {
console.log("onMsgExtracted");
},
});
- Observe that
onMsgExtracted
doesn't get printed.
Expected behavior
onMsgExtracted
should be printed on the console.
Desktop (please complete the following information):
n/a
Smartphone (please complete the following information):
n/a
Additional context
Nothing I can think of.
Andreas Amsenius commented
PR upcoming...