tsdjs / tsd

Check TypeScript type definitions
MIT License
2.38k stars 68 forks source link

Unify Documentation for Assertions #157

Closed tommy-mitchell closed 1 year ago

tommy-mitchell commented 1 year ago

In https://github.com/SamVerschueren/tsd/pull/130#discussion_r967803264, it's pointed out that the descriptions of each assertion is different between the readme and the assert.ts file. For example, expectDeprecated() is defined as:

https://github.com/SamVerschueren/tsd/blob/14f28125e74ca533645d264209e7f9fd0e778568/source/lib/assertions/assert.ts#L55-L63

Whereas the readme says:

expectDeprecated(value)

Check that value is marked a @deprecated.


This PR changes each assertion description to consistently use expression and to say:

Asserts that (the type of) expression . . .

In addition, the documentation comment of each assertion handler follows the same form:

/**
 * Asserts that the argument of the assertion ...
 *
 * @param checker - The TypeScript type checker.
 * @param nodes - The `expectASSERTION` AST nodes.
 * @return List of custom diagnostics.
 */
sindresorhus commented 1 year ago

Thanks for doing this :)