facebook / facebook/docusaurus

Improve TypeScript Types for ThemeConfig

Đang mở
#11,187 4 bình luận 0 reaction 0 người được giao Xem trên GitHub
feature
Ngôn ngữ chính
TypeScript
Star
66.2k
Fork
10k
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
52

Mô tả

### Have you read the Contributing Guidelines on issues?

- [x] I have read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#issues).

### Description

I would like to suggest providing better TypeScript types for `ThemeConfig` to improve the developer experience.

### Has this been requested on Canny?

_No response_

### Motivation

Currently, the `ThemeConfig` type is defined as:

```
export type ThemeConfig = {
[key: string]: unknown;
};
```

As a result, developers are unable to benefit from IDE IntelliSense when configuring `ThemeConfig` within `docusaurus.config.ts`.

Improving the type definition would greatly enhance the DX by enabling better autocompletion, error checking, and documentation directly within the editor.

### API design

_No response_

### Have you tried building it?

_No response_

### Self-service

- [ ] I'd be willing to contribute this feature to Docusaurus myself.

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.