|
3 | 3 | ## Submitting a new type |
4 | 4 |
|
5 | 5 | - One type addition per pull request, unless they are connected. |
6 | | -- Please help review the other open pull requests. If there are no open pull requests, provide some feedback on some of the open issues. |
| 6 | +- **Please help review the other open pull requests.** |
| 7 | + - If there are no open pull requests, provide some feedback on some of the open issues. |
| 8 | +- [Example of a type contribution.](https://github.com/sindresorhus/type-fest/commit/5374588a88ee643893784f66367bc26b8e6509ec) |
7 | 9 | - Create a new file in the `test-d` directory and write at least one type test. |
8 | 10 | - See the other tests for inspiration. |
9 | 11 | - If it makes sense, also write a negative test using [`expectNotAssignable()`](https://github.com/SamVerschueren/tsd#expectnotassignabletexpression-any) or, to test other diagnostics, [`expectError()`](https://github.com/SamVerschueren/tsd#expecterrort--anyexpression-t). |
10 | 12 | - Don't use one-character type names like `T` and `U`. Use descriptive names. See the existing types for inspiration. |
| 13 | +- Follow the existing code style, even in documentation code examples. |
11 | 14 | - Write a good documentation comment that includes: |
12 | 15 | - Write a short and clear description of what the type does. |
| 16 | + - The first line should match the description in the readme. |
13 | 17 | - Write about some real-world use-cases where it can be useful. (It can be hard sometimes for users to see where they would use something) |
14 | 18 | - Example code block with a realistic example. |
15 | 19 | - At the bottom, explain how the type works. Some types can be quite advanced and hard to understand. We can use this opportunity to teach users. |
16 | 20 | - If there has been any discussion somewhere about this type, include a link to it. For example, a discussion on the TypeScript issue tracker. |
| 21 | + - Add relevant `@category` tags. See other types for examples. |
17 | 22 | - If you add any internal helper types, they should still be properly documented and tested. |
18 | 23 | - Add the type to the readme. |
19 | 24 | - Make sure the file in the `source` directory uses a `.d.ts` extension and not `.ts`. |
|
0 commit comments