From b806ebc6c355972dfa8a1fe8ff26901bbf82edd8 Mon Sep 17 00:00:00 2001 From: Jon Ambas Date: Wed, 10 Apr 2024 20:21:27 -0400 Subject: [PATCH] fix(codegen): fix missing initializer error (#28) --- src/__tests__/codegen.test.ts | 5 +++-- src/codegen.ts | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/__tests__/codegen.test.ts b/src/__tests__/codegen.test.ts index 8e1401a..8e07add 100644 --- a/src/__tests__/codegen.test.ts +++ b/src/__tests__/codegen.test.ts @@ -37,12 +37,13 @@ describe('codegen', () => { "file": "ct.mjs", }, { - "code": "type PluginCtMapType = { + "code": "/* eslint-disable */ + type PluginCtMapType = { 'foo.100': '#fff'; 'foo.200': {"base":"#000","lg":"#111"}; 'bar.100': 'red'; 'bar.200': 'blue';}; - export const ct: (alias: T) => PluginCtMapType[T];", + export declare const ct: (alias: T) => PluginCtMapType[T];", "file": "ct.d.ts", }, ], diff --git a/src/codegen.ts b/src/codegen.ts index 014ba82..c974e46 100644 --- a/src/codegen.ts +++ b/src/codegen.ts @@ -34,8 +34,8 @@ export const codegen = ( const ctDtsFile: ArtifactContent = { file: `ct.d.${dtsExt}`, - code: `type PluginCtMapType = {${serializeMapTypes(map)}}; - export const ct: (alias: T) => PluginCtMapType[T];`, + code: `/* eslint-disable */\ntype PluginCtMapType = {${serializeMapTypes(map)}}; + export declare const ct: (alias: T) => PluginCtMapType[T];`, }; cssFn.files.push(ctFile, ctDtsFile);