Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Commit 28a864b

Browse files
committed
Add test case for #152
1 parent 265cb8f commit 28a864b

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

tests/lib/rules/type-annotation-spacing.js

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3380,6 +3380,71 @@ type Foo = {
33803380
column: 26
33813381
}
33823382
]
3383+
},
3384+
// https://github.com/bradzacher/eslint-plugin-typescript/issues/152
3385+
{
3386+
code: `
3387+
class Some {
3388+
a : {some: string, other: {more: number}};
3389+
someMethod : (args : {some: string, other: {more: number}}) => void;
3390+
doSomething(args : {some: string, other: {more: number}}) : void {}
3391+
}
3392+
`,
3393+
options: [{ after: true, before: true }],
3394+
output: `
3395+
class Some {
3396+
a : {some : string, other : {more : number}};
3397+
someMethod : (args : {some : string, other : {more : number}}) => void;
3398+
doSomething(args : {some : string, other : {more : number}}) : void {}
3399+
}
3400+
`,
3401+
errors: [
3402+
{
3403+
message: `Expected a space before the ':'`,
3404+
line: 3,
3405+
column: 30
3406+
},
3407+
{
3408+
message: `Expected a space before the ':'`,
3409+
line: 3,
3410+
column: 45
3411+
},
3412+
{
3413+
message: `Expected a space before the ':'`,
3414+
line: 3,
3415+
column: 52
3416+
},
3417+
{
3418+
message: `Expected a space before the ':'`,
3419+
line: 4,
3420+
column: 47
3421+
},
3422+
{
3423+
message: `Expected a space before the ':'`,
3424+
line: 4,
3425+
column: 62
3426+
},
3427+
{
3428+
message: `Expected a space before the ':'`,
3429+
line: 4,
3430+
column: 69
3431+
},
3432+
{
3433+
message: `Expected a space before the ':'`,
3434+
line: 5,
3435+
column: 45
3436+
},
3437+
{
3438+
message: `Expected a space before the ':'`,
3439+
line: 5,
3440+
column: 60
3441+
},
3442+
{
3443+
message: `Expected a space before the ':'`,
3444+
line: 5,
3445+
column: 67
3446+
}
3447+
]
33833448
}
33843449
]
33853450
});

0 commit comments

Comments
 (0)