diff --git a/README.md b/README.md index ff6e1492ed..a11bd1a599 100644 --- a/README.md +++ b/README.md @@ -182,7 +182,11 @@ For a good example package, see [base64-js](https://github.com/DefinitelyTyped/D #### Common mistakes * First, follow advice from the [handbook](http://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html). -* Formatting: Use 4 spaces. Prettier is set up on this repo, so you can run `npm run prettier -- --write path/to/package`. +* Formatting: Use 4 spaces. Prettier is set up on this repo, so you can run `npm run prettier -- --write path/to/package`. [When using assertions](https://github.com/SamVerschueren/tsd#assertions), add `// prettier-ignore` exclusion to mark line(s) of code as excluded from formatting: + ```tsx + // prettier-ignore + const incompleteThemeColorModes: Theme = { colors: { modes: { papaya: { // $ExpectError + ``` * `function sum(nums: number[]): number`: Use `ReadonlyArray` if a function does not write to its parameters. * `interface Foo { new(): Foo; }`: This defines a type of objects that are new-able. You probably want `declare class Foo { constructor(); }`.