Skip to content

fix extractor support for shorthand namespace options - #291

Draft
aaronshaf wants to merge 1 commit into
i18next:mainfrom
aaronshaf:fix/namespace-shorthand
Draft

aaronshaf wants to merge 1 commit into
i18next:mainfrom
aaronshaf:fix/namespace-shorthand

Conversation

@aaronshaf

Copy link
Copy Markdown

The extractor resolves explicit options such as { ns: NS }, but misses shorthand { ns } because SWC represents the shorthand as a bare Identifier rather than a KeyValueProperty.

Handle that AST form with the existing identifier resolver and add a regression test proving the key is written to the resolved namespace.

Tests:

  • npm test
  • npx vitest run test/extractor.t.test.ts
  • mutation check: the new test fails without the production fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant