Logo
Explore Help
Register Sign In
yujunjun/playwright
1
0
Fork 0
You've already forked playwright
mirror of https://github.com/microsoft/playwright.git synced 2025-06-26 21:40:17 +00:00
Code Issues Packages Projects Releases Wiki Activity
playwright/utils/doclint/check_public_api/test/check-nullish/api.ts

19 lines
354 B
TypeScript
Raw Normal View History

fix(docs): fixup and lint optionals and return values in api.md (#1376) Currently in our API `?` means null, but sometimes it means optional. Linting optional/nulls with this patch is required for #1166 to land nicely. Previously, return types were not being linted in `api.md`. This is fixed, along with many broken return types. This patch considers `?` to mean nullable, and has some heuristics to determine optionality. I believe this to be the minimal patch needed to unblock #1166. After it lands, we can consider changing the api docs to hopefully remove some heuristics and strangeness.
2020-03-18 16:23:25 -07:00
class Foo {
bar(options: {x: number, y: number, maybe?: number, nullable: string|null, object?: {one: number, two?: number}}) {
}
async goBack() : Promise<Response | null> {
return null;
}
response(): Response | null {
return null;
}
baz(): {abc: number, def?: number, ghi: string} | null {
return null;
}
}
export {Foo};
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.5 Page: 441ms Template: 14ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API