amzn / style-dictionary

A build system for creating cross-platform styles.
https://styledictionary.com
Apache License 2.0
3.93k stars 558 forks source link

fix: use js extensions instead of ts in imports #1374

Closed jorenbroekema closed 2 weeks ago

jorenbroekema commented 3 weeks ago

Issue #, if available: closes https://github.com/amzn/style-dictionary/issues/1371

Description of changes:

Generally speaking TypeScript expects .js extensions for imports because the compiled output is .js. In the future TS might release a new feature allowing .ts extensions, but currently under NodeNext moduleResolution, .js is the way to go for files that actually compile to JS.

That said, in JSDocs annotated type-only imports we should use .d.ts extension because we only emit declaration files for these, so the compiled output is just .d.ts files.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

aws-amplify-us-west-1[bot] commented 3 weeks ago

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-1374.d16eby4ekpss5y.amplifyapp.com

zacowan commented 3 weeks ago

This closes #1371 🥂