Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix type files geneartion to export only types #119

Closed
RayRedGoose opened this issue Jul 3, 2024 · 0 comments · Fixed by #120
Closed

Fix type files geneartion to export only types #119

RayRedGoose opened this issue Jul 3, 2024 · 0 comments · Fixed by #120
Labels
bug Something isn't working

Comments

@RayRedGoose
Copy link
Contributor

RayRedGoose commented Jul 3, 2024

🐛 Bug Report

The type definition files output assignment which is not legal in definitions files. TypeScript definition files (*.d.ts) only declare types and do not assign values. It is a subtle difference, but the = should be changed to : and the as const removed.

Expected Behavior

// es6/system/index.d.ts
export declare const color: {
  bg: {
    "default": "--cnvs-sys-color-bg-default",
    // ...
  },
  // ...
};

// es6/base/index.d.ts
export declare const cinnamon100: "--cnvs-base-palette-cinnamon-100";

Actual Behavior

// es6/system/index.d.ts
export declare const color = {
  bg: {
    "default": "--cnvs-sys-color-bg-default",
    // ...
  } as const,
  // ...
} as const;

// es6/base/index.d.ts
export declare const cinnamon100 = "--cnvs-base-palette-cinnamon-100";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

1 participant