Skip to content

Feature Request: Typescript token files support. #1391

@hsjobeki

Description

@hsjobeki

When using typescript with

deno
bun
or node with the --experimental-strip-types (nodejs/node#53725)

It is not required to transpile typescript into javascript anymore.

With style-dictionary it is possible to use javascript to generate style rules. such as I do.

I use typescript to proof that all my themes are consistent and for stability reasons.

source: ["build/*.*js"]

// src/dark.ts
import { light } from "../light/color.token.js";

// Let Typescript check that dark theme has the same values as light theme
type Dark = typeof light;

const dark: Dark = {...}

Unfortunately style dictionary cannot load my .ts files directly by using:

`source: ["src/*.*ts"]`

This would be much more convenient especially since all major runtimes do now support running typescript natively and i can run all my stuff without the intermediate step of transpiling everything.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions