Skip to content

Commit

Permalink
docs(eslint-plugin): [type-annotation-spacing] typo (#2392)
Browse files Browse the repository at this point in the history
  • Loading branch information
koooge committed Aug 14, 2020
1 parent 71c4c72 commit daf649f
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions packages/eslint-plugin/docs/rules/type-annotation-spacing.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ class Foo {
name : string;
}

type Foo = ()=>{};
type Foo = () =>{};
type Foo = ()=> {};
```

Expand Down Expand Up @@ -113,6 +115,8 @@ class Foo {
name : string;
}

type Foo = ()=>{};
type Foo = () =>{};
type Foo = () => {};
```

Expand Down Expand Up @@ -156,6 +160,10 @@ class Foo {
class Foo {
name :string;
}

type Foo = ()=>{};
type Foo = () =>{};
type Foo = ()=> {};
```

Examples of **correct** code for this rule with `{ "before": true, "after": true }` options:
Expand All @@ -169,6 +177,8 @@ function foo() : string {}
class Foo {
name : string;
}

type Foo = () => {};
```

### overrides - colon
Expand Down Expand Up @@ -197,12 +207,12 @@ class Foo {
name :string;
}

type Foo = {
name: (name:string) => string;
}
type Foo = () =>{};
type Foo = ()=> {};
type Foo = () => {};
```

Examples of **correct** code for this rule with `{ "before": true, "after": true, overrides: { colon: { before: true, after: true }} }` options:
Examples of **correct** code for this rule with `{ "before": false, "after": false, overrides: { colon: { before: true, after: true }} }` options:

<!-- prettier-ignore -->
```ts
Expand All @@ -217,6 +227,8 @@ class Foo {
type Foo = {
name: (name : string)=>string;
}

type Foo = ()=>{};
```

### overrides - arrow
Expand Down Expand Up @@ -245,17 +257,9 @@ class Foo {
name :string;
}

type Foo = {
name: (name : string)=>string;
}

type Foo = {
name: (name : string) =>string;
}

type Foo = {
name: (name : string)=> string;
}
type Foo = ()=>{};
type Foo = () =>{};
type Foo = ()=> {};
```

Examples of **correct** code for this rule with `{ "before": false, "after": false, overrides: { arrow: { before: true, after: true }} }` options:
Expand All @@ -270,9 +274,7 @@ class Foo {
name:string;
}

type Foo = {
name: (name:string) => string;
}
type Foo = () => {};
```

## When Not To Use It
Expand Down

0 comments on commit daf649f

Please sign in to comment.