Skip to content

Commit f680e4c

Browse files
committed
fix(core): change const enum naming
1 parent 8291d09 commit f680e4c

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

packages/core/src/getters/enum.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ const getTypeConstEnum = (
5050
descriptions?: string[],
5151
enumNamingConvention?: NamingConvention,
5252
) => {
53-
let enumValue = `export type ${enumName} = typeof ${enumName}[keyof typeof ${enumName}]`;
53+
let enumValue = `export type ${enumName} = (typeof ${enumName}Consts)[keyof typeof ${enumName}Consts]`;
5454

5555
if (value.endsWith(' | null')) {
5656
value = value.replace(' | null', '');
5757
enumValue += ' | null';
5858
}
5959

60-
enumValue += ';\n';
60+
enumValue += ';\n\n';
6161

6262
const implementation = getEnumImplementation(
6363
value,
@@ -66,11 +66,7 @@ const getTypeConstEnum = (
6666
enumNamingConvention,
6767
);
6868

69-
enumValue += '\n\n';
70-
71-
enumValue += '// eslint-disable-next-line @typescript-eslint/no-redeclare\n';
72-
73-
enumValue += `export const ${enumName} = {\n${implementation}} as const;\n`;
69+
enumValue += `export const ${enumName}Consts = {\n${implementation}} as const;\n`;
7470

7571
return enumValue;
7672
};

0 commit comments

Comments
 (0)