stdlib-js / stdlib-js/stdlib

Question: how to use the project with TypeScript?

Đang mở
#2,545 5 bình luận 0 reaction 1 người được giao Được @Planeshifter nhận Xem trên GitHub
Documentation Question TypeScript
Ngôn ngữ chính
JavaScript
Star
6k
Fork
1.3k
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
611

Mô tả

### Description

I'm tying to use some of the libs with TS and it's very unclear how to do this.

import * as ss from "@stdlib/nlp-sentencize"

gives an error:

This module can only be referenced with ECMAScript imports/exports by turning on the 'allowSyntheticDefaultImports' flag and referencing its default export.ts(2497)

so should i add that to a `tsconfig` ?

allowSyntheticDefaultImports: true

doesn't seem to help.

it seems most people write TS nowadays so a bit less of an onboarding brick wall would be helpful.

I searched the docs and can find no mention of how to import into a typescript project.

### Related Issues

Related issues # , # , and # .

### Questions

No.

### Other

No.

### Checklist

- [X] I have read and understood the [Code of Conduct](https://github.com/stdlib-js/stdlib/blob/develop/CODE_OF_CONDUCT.md).
- [X] Searched for existing issues and pull requests.
- [X] The issue name begins with `RFC:`.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.