From 699dd6b2e2c4dbc34e4db9c1f1afe1fc4d29d268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20B=C5=82a=C5=BCejewicz=20=28Peter=20Blazejewicz=29?= Date: Fri, 17 Jan 2020 17:43:24 +0100 Subject: [PATCH] docs(readme): Add hint about prettier ignore (#41593) This is an aftermath of problem discussed here: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/41567#discussion_r365882974 Thanks! --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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(); }`.