@@ -82,7 +82,7 @@ function command(config: LinguiConfig, options) {
8282 if ( doMerge ) {
8383 mergedCatalogs = { ...mergedCatalogs , ...messages }
8484 } else {
85- const namespace = options . namespace || config . compileNamespace
85+ const namespace = options . typescript ? "ts" : options . namespace || config . compileNamespace
8686 const compiledCatalog = createCompiledCatalog ( locale , messages , {
8787 strict : false ,
8888 namespace,
@@ -97,7 +97,7 @@ function command(config: LinguiConfig, options) {
9797 )
9898
9999 if ( options . typescript ) {
100- const typescriptPath = compiledPath . replace ( / \. j s x ? $ / , "" ) + ".d.ts"
100+ const typescriptPath = compiledPath . replace ( / \. t s ? $ / , "" ) + ".d.ts"
101101 fs . writeFileSync (
102102 typescriptPath ,
103103 `import { Messages } from '@lingui/core';
@@ -156,7 +156,7 @@ if (require.main === module) {
156156 const results = command ( config , {
157157 verbose : program . verbose || false ,
158158 allowEmpty : ! program . strict ,
159- typescript : program . typescript || false ,
159+ typescript : program . typescript || config . compileNamespace === "ts" || false ,
160160 namespace : program . namespace , // we want this to be undefined if user does not specify so default can be used
161161 } )
162162
0 commit comments