facebook / facebook/docusaurus

Improve TypeScript Types for ThemeConfig

オープン
#11,187 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る
feature
主要言語
TypeScript
スター
66.2k
フォーク
10k
平均マージ
1日 3時間
マージ済み PR(30日)
52

説明

### 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.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。