From fe557617d5f6bcc70ef2be8f9b9166c218210fe5 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 15 Sep 2017 07:24:04 -0700 Subject: [PATCH] In README, mention that adding your name to "Definitions by" sends you notifications (#19751) * In README, mention that adding your name to "Definitions by" sends you notifications * Update README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4b16884273..902176532a 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,7 @@ First, [fork](https://guides.github.com/activities/forking/) this repository, in * `cd types/my-package-to-edit` * Make changes. Remember to edit tests. * You may also want to add yourself to "Definitions by" section of the package header. + - This will cause you to be notified (via your GitHub username) whenever someone makes a pull request or issue about the package. - Do this by adding your name to the end of the line, as in `// Definitions by: Alice , Bob `. - Or if there are more people, it can be multiline ```typescript @@ -145,7 +146,7 @@ For a good example package, see [base64-js](https://github.com/DefinitelyTyped/D Example where it is not acceptable: `function parseJson(json: string): T;`. Exception: `new Map()` is OK. * Using the types `Function` and `Object` is almost never a good idea. In 99% of cases it's possible to specify a more specific type. Examples are `(x: number) => number` for [functions](http://www.typescriptlang.org/docs/handbook/functions.html#function-types) and `{ x: number, y: number }` for objects. If there is no certainty at all about the type, [`any`](http://www.typescriptlang.org/docs/handbook/basic-types.html#any) is the right choice, not `Object`. If the only known fact about the type is that it's some object, use the type [`object`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#object-type), not `Object` or `{ [key: string]: any }`. -* `var foo: string | any`: +* `var foo: string | any`: When `any` is used in a union type, the resulting type is still `any`. So while the `string` portion of this type annotation may _look_ useful, it in fact offers no additional typechecking over simply using `any`. Depending on the intention, acceptable alternatives could be `any`, `string`, or `string | object`. @@ -297,7 +298,7 @@ When `dts-gen` is used to scaffold a scoped package, the `paths` property has to "@foo/bar": ["foo__bar"] } } -``` +``` #### The file history in GitHub looks incomplete.